Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a SQL query to show a table with columns Customer ID and Product ID of only products ordered by the customer and meets the
Write a SQL query to show a table with columns Customer ID and Product ID of only products ordered by the customer and meets the following requirements:
a Customer ID should be included for all customers.
b Product ID included are only for products ordered by the customer with Customer ID in the first column.
c If the same customer has purchased the same product multiple times, the pair of Customer ID and Product ID should not be repeated.
Additional Notes:
Customer ID is used to uniquely identify each customer and is available as CustomerID in SALESORDERS table as well as CustID in CUSTOMER table.
Product ID is used to uniquely identify each product and is available as ProductID in both PRODUCT and ORDERDETAILS tables.
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