SERVICE INVOICE ServiceID Service Description UnitPrice INVOICE_ITEM InvoiceNumber ItemNumber ServiceID InvoiceNumber CustomerID CUSTOMER CustomerID FirstName...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
SERVICE INVOICE ServiceID Service Description UnitPrice INVOICE_ITEM InvoiceNumber ItemNumber ServiceID InvoiceNumber CustomerID • CUSTOMER CustomerID FirstName Subtotal Tax LastName Phone quantity UnitPrice TotalAmount EmailAddress ExtendedPrice Based on the above relations, create following tables (Question 1.1-1.4). 1.1 Create table CUSTOMER based on the following requirements: 3 points for the primary key column, (1) automatically generate integers that start from 100 and increase by 1 for each new row, and (2) add primary key constraint. Assign appropriate data type for each column. All columns are not allowed to be NULL 1.3 Create table INVOICE based on the following requirements: 3 points for the primary key column, (1) automatically generate integers that start from 2018001 and increase by 1 for each new row, and (2) add primary key constraint. Assign appropriate data type for each column. All columns are not allowed to be NULL Add foreign key constraint for all foreign keys. 1.4 Create table INVOICE_ITEM based on the following requirements: 3 points add primary key constraint. Assign appropriate data type for each column. Add foreign key constraint for all foreign keys. . . . The following questions are based on the tables you created in question 1.1-1.4. 1.5 executing the following codes. If you got errors, explain why do you get errors. [for this question, you don't need to submit your screenshot] 2 points INSERT INTO CUSTOMER VALUES( 'Nikki', Kaccaton", "723-543-1233', 'Nikki Kaccaton@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Brenda', 'Catnazaro', 723-543-2344, Brenda Catnazaro@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Bruce', 'LeCat', 723-543-3455', 'Bruce.LeCat@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Betsy', 'Miller', '723-654-3211", "Betsy Miller@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'George', 'Miller, 723-654-4322', 'George Miller@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Kathy', 'Miller', 723-514-9877, Kathy Miller@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Betsy', 'Miller'. 723-514-8766', 'Betsy Miller@elsewhere.com): INSERT INTO SERVICE VALUES(10, Mens Shirt, 1.50); INSERT INTO SERVICE VALUES(11, 'Dress Shirt', 2.50): INSERT INTO SERVICE VALUES(15, Women's Shirt, 1.50): INSERT INTO SERVICE VALUES(16, Blouse", 3.50); INSERT INTO SERVICE VALUES (20, "Slacks-Men's', 5.00): INSERT INTO SERVICE VALUES(25, Slacks-Women's", 6.00); INSERT INTO SERVICE VALUES(30, "Skirt, 5.00); INSERT INTO SERVICE VALUES(31, Dress Skirt', 6.00): INSERT INTO SERVICE VALUES(40, "Sull-Men's', 9.00): INSERT INTO SERVICE VALUES(45, "Suit-Women's', 8.50) INSERT INTO SERVICE VALUES(50, Tuxedo', 10.00); INSERT INTO SERVICE VALUES(60, Formal Gown', 11.00): INSERT INTO INVOICE VALUES( 100, 158.50, 12.52, 171.02), INSERT INTO INVOICE VALUES( 101. 25.00, 1.98, 26.98): INSERT INTO INVOICE VALUES( 100, 49.00, 3.87, 52.87); INSERT INTO INVOICE VALUES( 103, 17.50, 1.38, 18.88): INSERT INTO INVOICE VALUES( 105, 12.00, 0.95, 12.95); INSERT INTO INVOICE VALUES( 102, 152.50, 12.05, 164.55): INSERT INTO INVOICE VALUES( 102, 7.00, 0.55, 7.55): INSERT INTO INVOICE VALUES( 106, 140.50, 11.10, 151.60): INSERT INTO INVOICE VALUES( 104, 27.00, 2.13, 29.13); INSERT INTO INVOICE ITEM VALUES(2018001, 1, 16, 2, 3.50, 7.00); INSERT INTO INVOICE ITEM VALUES (2018001, 2, 11, 5, 2.50, 12.50); INSERT INTO INVOICE ITEM VALUES(2018001, 3, 50, 2, 10.00, 20.00); INSERT INTO INVOICE ITEM VALUES(2018001, 4, 20, 10, 5.00, 50.00): INSERT INTO INVOICE ITEM VALUES(2018001, 5, 25, 10, 6.00, 60.00); INSERT INTO INVOICE ITEM VALUES (2018001, 6, 40, 1, 9.00, 9.00): INSERT INTO INVOICE ITEM VALUES(2018002, 1. 11, 10, 2.50, 25.00); INSERT INTO INVOICE ITEM VALUES (2018003, 1, 20, 5, 5.00, 25.00); INSERT INTO INVOICE ITEM VALUES (2018003, 2, 25, 4, 6.00, 24.00): INSERT INTO INVOICE ITEM VALUES(2018004, 1, 11, 7, 2.50, 17.50); INSERT INTO INVOICE ITEM VALUES (2018005, 1., 16, 2, 3.50, 7.00): INSERT INTO INVOICE ITEM VALUES(2018005, 2. 11, 2, 2.50, 5.00): INSERT INTO INVOICE_ITEM VALUES(2018006, 1, 16, 5, 3.50, 17.50); INSERT INTO INVOICE_ITEM VALUES(2018006, 2, 11, 10, 2.50, 25.00); INSERT INTO INVOICE ITEM VALUES(2018006, 3, 20, 10, 5.00, 50.00): INSERT INTO INVOICE ITEM VALUES(2018006, 4, 25, 10, 6.00, 60.00): INSERT INTO INVOICE_ITEM VALUES(2018007, 1, 16, 2, 3.50, 7.00): INSERT INTO INVOICE ITEM VALUES(2018008, 1, 16, 3, 3.50, 10.50); INSERT INTO INVOICE ITEM VALUES(2018008, 2, 11, 12, 2.50, 30.00): INSERT INTO INVOICE ITEM VALUES(2018008, 3, 20, 8, 5.00, 40.00): INSERT INTO INVOICE ITEM VALUES(2018008, 4, 25, 10, 6.00, 60.00): INSERT INTO INVOICE ITEM VALUES(2018009, 1, 40, 3, 9.00, 27.00); 1.6 Executing the following codes. 6 points (1) How many errors in the following codes? Why do you get these errors? INSERT INTO CUSTOMER VALUES('Nike', "Kaccaton', 'Nikki Kaccaton@somewhere.com'); (2) How many errors in the following codes? Why do you get these errors? INSERT INTO CUSTOMER VALUES(Bread". "White', '505-543-2344"); 1.7 Add a constraint to Tax in table INVOICE, make sure that the value of tax is less than 15 (tax<15). 5 points 1.8 Execute following codes. If you get errors, please explain why do you get errors. If your codes are successful, please submit your screenshot which should show all rows of the final table. 5 points INSERT INTO INVOICE ITEM VALUES (2018001, 1, 2, 2, 3.50, 7.00); SERVICE ServiceID Service Description UnitPrice INVOICE_ITEM INVOICE InvoiceNumber ItemNumber ServiceID quantity InvoiceNumber CustomerID Subtotal Tax CUSTOMER CustomerID FirstName LastName Phone UnitPrice TotalAmount EmailAddress ExtendedPrice 1.9 Divide the INVOICE_ITEM table based on the ItemNumber. Please also calculate the average UnitPrice, minimal ExtendedPrice and maximal quantity for each group. (for this question, please submit codes and screenshot of results after executing your codes) 10 points SERVICE INVOICE ServiceID Service Description UnitPrice INVOICE_ITEM InvoiceNumber ItemNumber ServiceID InvoiceNumber CustomerID • CUSTOMER CustomerID FirstName Subtotal Tax LastName Phone quantity UnitPrice TotalAmount EmailAddress ExtendedPrice Based on the above relations, create following tables (Question 1.1-1.4). 1.1 Create table CUSTOMER based on the following requirements: 3 points for the primary key column, (1) automatically generate integers that start from 100 and increase by 1 for each new row, and (2) add primary key constraint. Assign appropriate data type for each column. All columns are not allowed to be NULL 1.3 Create table INVOICE based on the following requirements: 3 points for the primary key column, (1) automatically generate integers that start from 2018001 and increase by 1 for each new row, and (2) add primary key constraint. Assign appropriate data type for each column. All columns are not allowed to be NULL Add foreign key constraint for all foreign keys. 1.4 Create table INVOICE_ITEM based on the following requirements: 3 points add primary key constraint. Assign appropriate data type for each column. Add foreign key constraint for all foreign keys. . . . The following questions are based on the tables you created in question 1.1-1.4. 1.5 executing the following codes. If you got errors, explain why do you get errors. [for this question, you don't need to submit your screenshot] 2 points INSERT INTO CUSTOMER VALUES( 'Nikki', Kaccaton", "723-543-1233', 'Nikki Kaccaton@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Brenda', 'Catnazaro', 723-543-2344, Brenda Catnazaro@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Bruce', 'LeCat', 723-543-3455', 'Bruce.LeCat@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Betsy', 'Miller', '723-654-3211", "Betsy Miller@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'George', 'Miller, 723-654-4322', 'George Miller@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Kathy', 'Miller', 723-514-9877, Kathy Miller@somewhere.com'); INSERT INTO CUSTOMER VALUES( 'Betsy', 'Miller'. 723-514-8766', 'Betsy Miller@elsewhere.com): INSERT INTO SERVICE VALUES(10, Mens Shirt, 1.50); INSERT INTO SERVICE VALUES(11, 'Dress Shirt', 2.50): INSERT INTO SERVICE VALUES(15, Women's Shirt, 1.50): INSERT INTO SERVICE VALUES(16, Blouse", 3.50); INSERT INTO SERVICE VALUES (20, "Slacks-Men's', 5.00): INSERT INTO SERVICE VALUES(25, Slacks-Women's", 6.00); INSERT INTO SERVICE VALUES(30, "Skirt, 5.00); INSERT INTO SERVICE VALUES(31, Dress Skirt', 6.00): INSERT INTO SERVICE VALUES(40, "Sull-Men's', 9.00): INSERT INTO SERVICE VALUES(45, "Suit-Women's', 8.50) INSERT INTO SERVICE VALUES(50, Tuxedo', 10.00); INSERT INTO SERVICE VALUES(60, Formal Gown', 11.00): INSERT INTO INVOICE VALUES( 100, 158.50, 12.52, 171.02), INSERT INTO INVOICE VALUES( 101. 25.00, 1.98, 26.98): INSERT INTO INVOICE VALUES( 100, 49.00, 3.87, 52.87); INSERT INTO INVOICE VALUES( 103, 17.50, 1.38, 18.88): INSERT INTO INVOICE VALUES( 105, 12.00, 0.95, 12.95); INSERT INTO INVOICE VALUES( 102, 152.50, 12.05, 164.55): INSERT INTO INVOICE VALUES( 102, 7.00, 0.55, 7.55): INSERT INTO INVOICE VALUES( 106, 140.50, 11.10, 151.60): INSERT INTO INVOICE VALUES( 104, 27.00, 2.13, 29.13); INSERT INTO INVOICE ITEM VALUES(2018001, 1, 16, 2, 3.50, 7.00); INSERT INTO INVOICE ITEM VALUES (2018001, 2, 11, 5, 2.50, 12.50); INSERT INTO INVOICE ITEM VALUES(2018001, 3, 50, 2, 10.00, 20.00); INSERT INTO INVOICE ITEM VALUES(2018001, 4, 20, 10, 5.00, 50.00): INSERT INTO INVOICE ITEM VALUES(2018001, 5, 25, 10, 6.00, 60.00); INSERT INTO INVOICE ITEM VALUES (2018001, 6, 40, 1, 9.00, 9.00): INSERT INTO INVOICE ITEM VALUES(2018002, 1. 11, 10, 2.50, 25.00); INSERT INTO INVOICE ITEM VALUES (2018003, 1, 20, 5, 5.00, 25.00); INSERT INTO INVOICE ITEM VALUES (2018003, 2, 25, 4, 6.00, 24.00): INSERT INTO INVOICE ITEM VALUES(2018004, 1, 11, 7, 2.50, 17.50); INSERT INTO INVOICE ITEM VALUES (2018005, 1., 16, 2, 3.50, 7.00): INSERT INTO INVOICE ITEM VALUES(2018005, 2. 11, 2, 2.50, 5.00): INSERT INTO INVOICE_ITEM VALUES(2018006, 1, 16, 5, 3.50, 17.50); INSERT INTO INVOICE_ITEM VALUES(2018006, 2, 11, 10, 2.50, 25.00); INSERT INTO INVOICE ITEM VALUES(2018006, 3, 20, 10, 5.00, 50.00): INSERT INTO INVOICE ITEM VALUES(2018006, 4, 25, 10, 6.00, 60.00): INSERT INTO INVOICE_ITEM VALUES(2018007, 1, 16, 2, 3.50, 7.00): INSERT INTO INVOICE ITEM VALUES(2018008, 1, 16, 3, 3.50, 10.50); INSERT INTO INVOICE ITEM VALUES(2018008, 2, 11, 12, 2.50, 30.00): INSERT INTO INVOICE ITEM VALUES(2018008, 3, 20, 8, 5.00, 40.00): INSERT INTO INVOICE ITEM VALUES(2018008, 4, 25, 10, 6.00, 60.00): INSERT INTO INVOICE ITEM VALUES(2018009, 1, 40, 3, 9.00, 27.00); 1.6 Executing the following codes. 6 points (1) How many errors in the following codes? Why do you get these errors? INSERT INTO CUSTOMER VALUES('Nike', "Kaccaton', 'Nikki Kaccaton@somewhere.com'); (2) How many errors in the following codes? Why do you get these errors? INSERT INTO CUSTOMER VALUES(Bread". "White', '505-543-2344"); 1.7 Add a constraint to Tax in table INVOICE, make sure that the value of tax is less than 15 (tax<15). 5 points 1.8 Execute following codes. If you get errors, please explain why do you get errors. If your codes are successful, please submit your screenshot which should show all rows of the final table. 5 points INSERT INTO INVOICE ITEM VALUES (2018001, 1, 2, 2, 3.50, 7.00); SERVICE ServiceID Service Description UnitPrice INVOICE_ITEM INVOICE InvoiceNumber ItemNumber ServiceID quantity InvoiceNumber CustomerID Subtotal Tax CUSTOMER CustomerID FirstName LastName Phone UnitPrice TotalAmount EmailAddress ExtendedPrice 1.9 Divide the INVOICE_ITEM table based on the ItemNumber. Please also calculate the average UnitPrice, minimal ExtendedPrice and maximal quantity for each group. (for this question, please submit codes and screenshot of results after executing your codes) 10 points
Expert Answer:
Answer rating: 100% (QA)
To assist you here I will guide you through creating SQL table structures based on the requirements youve given and I will address the errors in the provided SQL INSERT statements 11 Creating the CUST... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Database Model Reference Essay The relational model is the current database implementation standard used today, and while some of the other models are not used, some of the concepts still are....
-
Consider a two-node network with two links and two demands between the two nodes. Suppose that c1 = 1, c2 = n and h1 = 1, h2 = n, and that demand d = 1 uses only one path P11 = {1}, and demand d = 2...
-
Your favorite algebra teachers are packing presents for the toy drive. Ms. May, Ms. Kirkland and Mr. Virgil pack 3 boxes of Barbies and 4 boxes of Kens for a total of 30 toys. Ms. Shead, Ms. Knight...
-
Pick a Nigerian brand that has been very successful competing against the bigger global brands in its product category. What are the elements of its strategy that have enabled it to achieve this...
-
Draw the shear and moment diagrams for the beam. Given: kip = 103 lb w1 = 30lb/ft w2 120lb/ft L = 12 ft L.
-
Find a comparison of FASB and IFRS. Explain one of the differences between the systems that affect one area of international corporations.
-
Use the NBA PER data introduced in Problem 8.21 and consider the model found in part $\mathrm{c}$ of that problem. There are some potential outliers in the data (the first observation is an obvious...
-
(Liberatore and Miller, 1985) A manufacturing facility uses two production lines to produce three products over the next 6 months. Backlogged demand is not allowed. However, a product may be...
-
WIP, beginning inventory 2,500 units (April 1) Started during April 7,500 Completed and TO 8200 during April WIP, ending inventory 1,800 (100% complete for DM, and 45% for conversion cost) Cost per...
-
Estimate damages for lost operation profit for years 3 through 5 from lost sales due to infringement as of June 30th, year 6, which is the estimated date of the completion of the patent infringement...
-
ALPHV/BlackCat exposes UnitedHealth hack details on leak blog. How does the event relate to issues addressed in class? How might similar situations be mitigated? What is the broader impact of the...
-
Sardars recommendation for the next step should be to: A. review results from backtesting the strategy. B. make recommendations for rebalancing the portfolio. C. forecast companies performances and...
-
The most appropriate risk attribution approach for the fixed-income manager is to: A. decompose historical returns into a top-down factor framework. B. evaluate the marginal contribution to total...
-
In managing the fund at his previous employer, Deweys investment process can be best described as: A. an activist strategy. B. a top-down strategy. C. a bottom-up strategy. Jack Dewey is managing...
-
The Barboa Fund can be best described as a fund segmented by: A. size/style. B. geography. C. economic activity. Three years ago, the Albright Investment Management Company (Albright) added four new...
-
Based on Exhibit 1, the target semideviation for the portfolio is closest to: A. 2.78%. B. 3.68%. C. 4.35%. Alexandra Jones, a senior adviser at Federalist Investors (FI), meets with Erin Bragg, a...
-
Economic Status Weak Economy Static Economy Strong Economy 6.00% 6.25% Probability Refer to the above information. What is your expected rate of return [E(Ri)] for next year? O 4.25% 7.75% .15 .60...
-
Complete problem P10-21 using ASPE. Data from P10-21 Original cost ................................................................. $7,000,000 Accumulated depreciation...
-
What is business process modeling?
-
Explain how primary keys and foreign keys are denoted in this book.
-
Create a Web page for Heather Sweeney Designs to display data in the SEMINAR,SEMINAR_CUSTOMER, and CUSTOMER tables to list the SEMINARdata and the EmailAddress, LastName, FirstName, and Phone of any...
-
What is the pro forma statement, and how important is it for a business?
-
Briefly compare replacement value to liquidation value of an asset.
-
Briefly describe what quality control is all about, and explain the three statistical types of control.
Study smarter with the SolutionInn App