Question: 1 . Show all columns from all 4 tables, include all records from each table in the result. 2 . Write a SQL query to
Show all columns from all tables, include all records from each table in the result.
Write a SQL query to show a table with columns Product Class, Product Line, and Color that shows all the different combinations of Product Class, Product Line and Product Color.
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.
Write a SQL query to show a table with columns Product ID and Customer ID and meets the following requirements:
a Customer ID should be included only for all customers who have ordered that product.
b Product ID for all products should be included.
c If the same product has been ordered by the same customer multiple times, the pair of Product ID and Customer ID should not be repeated.
d The columns should be named Product ID Ordered and Ordered by Customer ID
Additional Notes:
Product ID is used to uniquely identify each product and is available as ProductID in both PRODUCT and ORDERDETAILS tables.
Customer ID is used to uniquely identify each customer and is available as CustomerID in SALESORDERS table as well as CustID in CUSTOMER table.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
