Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Database Exercise 1. Identify primary key and foreign key for each of the following tables. Status Orders O# 1001 1002 1003 1004 Date 5/1/2015 5/3/2015
Database Exercise 1. Identify primary key and foreign key for each of the following tables. Status Orders O# 1001 1002 1003 1004 Date 5/1/2015 5/3/2015 5/3/2015 5/6/2015 Cust# 0023 0023 0018 0021 Customers Cust# CustName 0018 Sony 0019 0021 MGM 0023 Universal Disney Region NW SW SW NE AcctClass A B A OrderDetails O# P# Products P# PName Unit Price 8.99 11.99 12.49 Ord Qty 10 8 5 10 21 25 13 4 20100090 20100091 20100092 20100093 Unit Price 8.99 12.99 9.52 12.99 9.52 12.99 12.49 9.52 8.99 1001 1001 1001 1002 1002 1003 1004 1004 1004 Lord of the Ring American Beauty The Mask Animal Kingdom Shipped Qty 8 8 5 10 20 25 13 4 2 20100090 20100091 20100093 20100092 20100093 20100092 20100092 20100093 20100090 9.52 2. Linking Multiple Tables for Query For each of the following query, identify 1) which tables need to be linked or if not linked what table is used 2) which field(s) are used to link the tables (if any) 1. Display the P# and PName of products bought on order 1001. 2. How many different products were bought on order 1001? 3. How many units in total are ordered in order 1001? How many are shipped? 4. What is the total order amount of O#1001? What is the total shipped amount? 5. How many total units are purchased by Customer 0023? How many are shipped? 6. How many units of product 20100093 are purchased by customer 0023? 7. What is the total shipped amount customer 0023 paid for product 20100093? 8. Short ship happens when the shipped quantity is less than the order quantity. Display the o# of orders where there is any short ship". 9. (Continue from #8) Display the Date where the short ship happens. 10. (Continue from #8) Display the name of the customers who experienced short ship
Step 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