Provide the sql code that inserts data into all of the table

Assignment Help Database Management System
Reference no: EM13915088

For this assessment, you will be creating models, databases, tables, and query reports for a smartphone application.

To complete this assessment, you will be using SQL Fiddle, an online SQL tool, to test run the MySQL code that you will develop for parts C through G. After running the code, you will take a screenshot of your results, which should be copied into the document "SQL Fiddle Instructions."
Scenario:

You are the database designer and developer for a donut shop that wants to create a smartphone application where customers can order donuts. First, you will design a normalized entity-relationship (E-R) logical database model to store data related to the customer, donuts, and donut order. Next, you will create three tables with primary and foreign keys that are derived from your E-R model. Once the tables have been built, then you will create views and indexes to protect and fine-tune query performance. You will populate each of the tables with sample data. Finally, you will create both a simple "select-from-where" (sfw) query and a complex join query to produce meaningful reports on individual donut orders and summaries to determine which donuts sell the best.

Requirements:

A. Construct a normalized model to represent the donut shop smartphone application database that supports the scenario above by doing the following:

1. Using the unnormalized order form ("Sales Order Form" attached below) for the donut ordering database as a reference, produce the final logical schema for this database by doing the following:

Note: You can design the tables using any method of your choice (e.g., using a drawing tool using tables).

a. Design a table that is in1st normal formand fulfills the following requirements:

• The table should have a primary key that uniquely identifies the records.

• The values in each of the columns should be atomic.

• There should be no repeating groups.

i. Write aoneparagraph explanation of how you designed the table.

b. Designat leasttwotables that are in2nd normal formand fulfill the following requirements:

• The tables should meet all of the requirements for the 1st normal form.

• Redundant data appearing in multiple rows should be eliminated with the creation of the new tables.

• Each of the tables should be related using foreign keys.

i. Write aoneparagraph explanation of how you designed the table

c. Designat leastthreenormalized tables that are in3rd normalform and fulfill the following requirements:

• The tables should meet all of the requirements for the 1st and 2nd normal forms.

• Fields that do not depend on the primary key or any other field should be eliminated.

• There should be at least three resulting tables, one for customer information, one for donut information, and one for order information.

i. Write aoneparagraph explanation of how you designed the table

B. Using the tables you designed in3rd normalform from part A1c, create an entity-relationship (E-R) diagram that fulfills the following requirements:

Note: You can use any drawing tool of your choice to create the diagram.

• Entities should be drawn that representeachof the tables from the 3rd normalized form.

• All appropriate fields (i.e., attributes) should be entered into each of the entities.

• Primary keys (PK) and foreign keys (FK) should be appropriately designated.

• Data types for each attribute (Numeric, Fixed, Char, Varchar, or Timestamp) should be appropriately designated.

• Relationships drawn between the entities should be labeled with a relationship name.

1. Provide a written explanation for the following:

a. Explain why you selected the entities represented in your diagram.

b. Explain how you determined the relationships between these entities.

c. Explain what the cardinality is foreachof the relationships.

C. Develop the SQL code foreachof the tables you designed in part A and refined in part B by doing the following:

1. Provide the SQL code you wrote foreachtable.

Note: Make sure all of the primary and foreign keys and data types are assigned to each of the fields in the create table SQL code.

a. Demonstrate that you have used SQL Fiddle to test your code from part C1 by providing a screenshot of your results.

D. Using the table that contains the customer information fields, develop SQL code to create a View that shows all of the customer information with the First Name and Last Name concatenated (CONCAT()) to show full name as one field by doing the following:

1. Provide the SQL code you wrote to create the View for the customer information.

a. Demonstrate that you have used SQL Fiddle to test your code from part D1 by providing a screenshot of your results.

E. Using the table that contains the donut information fields, develop SQL code to create an Index for the donut name field by doing the following:

1. Provide the SQL code you wrote to create the Index for the donut information.

a. Demonstrate that you have used SQL Fiddle to test your code from part E1 by providing a screenshot of your results.

F. Using all of the tables you developed in part C, develop SQL code to populateeachof the tables by doing the following:

1. Provide the SQL code that inserts data into all of the tables.

Note: Make sure that data is inserted first into the table(s) with primary keys before inserting data into the other tables.

a. Demonstrate that you have used SQL Fiddle to test your code from part F1 by providing a screenshot of your results.

G. Using the tables you populated in part F, develop SQL code to display the values in a requested table or tables by doing the following:

1. Provide the SQL code for the simple (sfw) queries to display all of the data in each of the tables you have created and populated.

a. Demonstrate that you have used SQL Fiddle to test your code from part G1 by providing a screenshot of your results.

2. Provide the SQL code for a complex join query to display all of the information contained in the attached "Sales Order Form."

a. Demonstrate that you have used SQL Fiddle to test your code from part G2 by providing a screenshot of your results.

Reference no: EM13915088

Questions Cloud

Describe the lifo inventory method : Describe the LIFO inventory method. What effects does it have on reported income, cash flows, and income taxes during periods of price changes?
A students personal leadership plan : Name is a student currently studying to obtain her degree in Human Services Management. It is name's goal to graduate with her associate's degree then continue on with her education graduating from the University of Phoenix with a bachelor's degre..
Performance of two distinct sorting algorithms : This lab assignment requires you to compare the performance of two distinct sorting algorithms to obtain some appreciation for the parameters to be considered in selecting an appropriate sort.
What should the probability of winning : Suppose ABC Company is considering bidding on a given contract. It will cost $2,000 to prepare the bid. If the bid is lost, the $2,000 cost is also lost. If ABC Company wins the bid, it will make $40,000 and recover the $2,000 bid preparation cost..
Provide the sql code that inserts data into all of the table : Provide the SQL code that inserts data into all of the tables
Onus is on the senders of messages. : How well do you respond to honest feedback from someone who sent it? What are some ways in which senders might receive feedback from their messages? How might this feedback affect the sender and the message? Why is this important?
How would you apply confidence intervals : Summarize what the case is about, and what the variables represent. How would you apply confidence intervals? How would you apply hypothesis testing
Why the lcm rule resulted in a write-down in the first year : Explain why the LCM rule resulted in a write-down in the first year. What is the inconsistency between the first- and second- year treatments of the change in the price of oil?
Resistance of the shunt field : Explain the difference in the resistances found for the shunt field, series field, and armature circuits. In particular, why is the resistance of the shunt field so different from the resistances of the armature and series field?

Reviews

Write a Review

Database Management System Questions & Answers

  This program must comprise of two classes one for handling

the fourth programming project involves writing a program to manage a student database. the interface to the program

  Build the prototype as a distributed system

You should document a UML design for the proposed system. This should include a description of: architecture, requirements and functionality, detailed system design.

  Explain components represented in cell using mccumber model

Suppose that the security model is required for protection of information in class. Using NSTISSC model, analyze each of cells (i.e. 27 cells related with McCumber model).

  Create an erd to show the resultant tables

Create an ERD to show the resultant tables at the 3NF level with all the needed attributes, Primary/Foreign keys etc - Create the RDM with appropriate attributes, primary and foreign keys.

  Draw an entity relationship diagram

Draw an entity relationship diagram (ERD) for the following situation: A company has a number of employees. Each employee is identified by an Employee_Id. The company wants to store Employee_Name, Employee_Address, and Employee_BirthDate in the d..

  Design a set of 3nf tables for database scenario

Draw an ER diagram for your database scenario. Design a set of 3NF tables for your database scenario.

  What is the role of a dbms

What is the role of a DBMS, and what are it advantages - what are its disadvantages?

  Create a form to link the spreadsheet to a table

Create a form (frmUpdateMediaLink) to link the spreadsheet to a table in the database (you can link the spreadsheet manually using the wizard but you will lose 4 points)

  Functional dependencies explain the difference between

explain the difference between functional dependencies that arise from equations and those that do

  Specify the foreign keys for schema

First, specify the foreign keys for this schema, stating any assumptions you make. Next, populate the relations with a few example tuples.

  Relations of airline flight information

The relations given below keep track of airline flight information:Flights(flno: integer, from: string, to: string, distance:integer, departs: time, arrives: time, price: real)Aircraft(aid: integer, aflame: string, cruisingrange: integer)

  Convert the erd into tables in access

Convert the ERD into tables in Access. Submit screenshots. Use Access tools to generate forms for users to populate the tables.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd