Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help with Questions 16, 17 and 18 Modify the Product_T table by adding an attribute QtyOnHand that can be used to track the finished
please help with Questions 16, 17 and 18
- Modify the Product_T table by adding an attribute QtyOnHand that can be used to track the finished goods inventory. The field should be an integer field of five characters and should accept only positive numbers.
- Enter sample data of your own choosing into QtyOnHand in the Product_T table. Test the modification you made in Problem and Exercise 16 by attempting to update a product by changing the inventory to 10,000 units. Test it again by changing the inventory for the product to 10 units. If you do not receive error messages and are successful in making these changes, then you did not establish appropriate constraints in Problem and Exercise 16.
- Add an order to the Order_T table and include a sample value for every attribute.
First, look at the data in the Customer_T table and enter an order from any one of those customers.
Enter an order from a new customer. Unless you have also inserted information about the new customer in the Customer_T table, your entry of the order data should be rejected. Referential integrity constraints should prevent you from entering an order if there is no information about the customer.
Chapter 6. Introduction to SQL 285 FIGURE 6-12 Adult literacy program (for Problems and Exercises 10 through 15) TUTOR (TutorID, CertDate, Status) , ) STUDENT (StudentID, Read) Studenti Read TutorID CertDate Status 3000 2.3 100 1/05/2008 Active 5.6 101 1/05/2008 3001 Temp Stop 3002 1.3 102 1/05/2008 Dropped 3003 3.3 Active 3004 2.7 103 5/22/2008 104 5/22/2008 105 5/22/2008 106 5/22/2008 Active Temp Stop 3005 4.8 3006 7.8 Active 3007 1.5 MATCH HISTORY (MatchID, TutorID, Studenti, , , StartDate, EndDate) MatchID Tutori StartDate EndDate StudentID 3000 1 100 1/10/2008 2 101 3001 1/15/2008 5/15/2008 3 102 3002 2/10/2008 3/01/2008 4 106 3003 5/28/2008 5 103 6/15/2008 3004 6/01/2008 3006 6/01/2008 6 104 6/28/2008 7 104 3006 6/01/2008 25. Display the product line ID and the average standard price for all products in each product line. 26. For every product that has been ordered, display the prod- uct ID and the total quantity ordered (label this result TotalOrdered). List the most popular product first and the least popular last 27. For each customer, list the CustomerID and total number of orders placed. 28. For each salesperson, display a list of CustomerIDs. 29. Display the product ID and the number of orders placed for each product. Show the results in decreasing order by the number of times the product has been ordered and label this result column NumOrders. 30. For each customer, list the CustomerID and the total num- ber of orders placed in 2010, 31. For each salesperson, list the total number of orders. Chapter 6. Introduction to SQL 285 FIGURE 6-12 Adult literacy program (for Problems and Exercises 10 through 15) TUTOR (TutorID, CertDate, Status) , ) STUDENT (StudentID, Read) Studenti Read TutorID CertDate Status 3000 2.3 100 1/05/2008 Active 5.6 101 1/05/2008 3001 Temp Stop 3002 1.3 102 1/05/2008 Dropped 3003 3.3 Active 3004 2.7 103 5/22/2008 104 5/22/2008 105 5/22/2008 106 5/22/2008 Active Temp Stop 3005 4.8 3006 7.8 Active 3007 1.5 MATCH HISTORY (MatchID, TutorID, Studenti, , , StartDate, EndDate) MatchID Tutori StartDate EndDate StudentID 3000 1 100 1/10/2008 2 101 3001 1/15/2008 5/15/2008 3 102 3002 2/10/2008 3/01/2008 4 106 3003 5/28/2008 5 103 6/15/2008 3004 6/01/2008 3006 6/01/2008 6 104 6/28/2008 7 104 3006 6/01/2008 25. Display the product line ID and the average standard price for all products in each product line. 26. For every product that has been ordered, display the prod- uct ID and the total quantity ordered (label this result TotalOrdered). List the most popular product first and the least popular last 27. For each customer, list the CustomerID and total number of orders placed. 28. For each salesperson, display a list of CustomerIDs. 29. Display the product ID and the number of orders placed for each product. Show the results in decreasing order by the number of times the product has been ordered and label this result column NumOrders. 30. For each customer, list the CustomerID and the total num- ber of orders placed in 2010, 31. For each salesperson, list the total number of ordersStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started