Develop sql code to populate all of the tables

This preview shows page 8 - 11 out of 11 pages.

F. Develop SQL code to populate all of the tables developed in part C: INSERT INTO customer VALUES('1','Ed', 'Burke', '123 Main St', '8', 'San Diego', 'CA', '92116', '3023002150', '8584545900', '3024567891'); INSERT INTO donut VALUES ('1', 'Plain', 'Plain donut', '1.75'); INSERT INTO donutorder VALUES ('1', '1', '2016-06-03','This guy always tips'); INSERT INTO orderdetails VALUES ('1', '1', '3');
G. Develop SQL code to display the values in a requested table or tables using the tables populated in part F 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. SELECT * FROM `c170 wgu`.customer; SELECT * FROM `c170 wgu`.donut; SELECT * FROM `c170 wgu`.donutorder; SELECT * FROM `c170 wgu`.orderdetails;
Background image
2. Provide the SQL code for a complex join query to display all of the information contained in the attached “Sales Order Form” with the exception of the calculated attributes (Line Total, Subtotal, Sales Tax and Total). SELECT customer.Customer_ID, First_Name, Last_Name, Address, Apt, City, State, Zip, Home_Phone, Mobile_Phone, Other_Phone, donut.Donut_ID, Donut_Name, Donut_Description, Unit_Price, orderdetails.DonutOrder_ID, Special_Notes, Order_Date, Quantity FROM customer, donut, donutorder, orderdetails WHERE donut.Donut_ID = orderdetails.Donut_ID AND customer.Customer_ID = donutorder.Customer_ID AND donutorder.DonutOrder_ID = orderdetails.DonutOrder_ID;

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture