Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Express each of the following queries in SQL against the relational schema defined above. Each query should be expressed using a single SQL statement. 1.
Express each of the following queries in SQL against the relational schema defined above. Each query should be expressed using a single SQL statement.
1. For each customer who has done at least one purchase transaction, list his/her member id, name and contact information. There should not be duplicates in the result.
2. For each purchase transaction done in January 1st, 2020 or later, list its transaction time, name of the member who made the purchase and the name of each product purchased in the transaction.
3. List the barcode, name and price of each product that has never being returned.
4. List the name and contact information of each member who has purchased at least one product but has never returned any purchased product.
5. For each (purchase or return) transaction assisted by the employee with the employee id 'K00236', list the transaction's (purchase or return respectively) store name and the (purchase or return) time.
6. List the name and price of each product that has NEVER purchased by the customer with the member id 300790013328.
7. List the barcode, the name and the price of each product that has been purchased by EVERY customer at least once.
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