Question
For the below `store' schema: product(productid,description,) customer(customerid,username,fname,lname,street1,street2,city,state,zip) purchase(purchaseid,purchasetimestamp,customerid,productid,quantity,price) Using SQL, answer these questions (write a SQL query that answers these questions): 1) What is the
For the below `store' schema:
product(productid,description,)
customer(customerid,username,fname,lname,street1,street2,city,state,zip)
purchase(purchaseid,purchasetimestamp,customerid,productid,quantity,price)
Using SQL, answer these questions (write a SQL query that answers these questions):
1) What is the description of productid=42?
2)What's the name and address of customerid=42?
3) What products did customerid=42 purchase?
4) List customer names who have never puchased anything.
5)List product descriptions who have never been purchased by anyone.
6)What products were purchased by customers with zip code 10001?
7)What percentage of customers have ever purchased productid=42?
8)Of customers who purchased productid=42, what percentage also purchased productid=24?
9) What is the most popular (purchased most often) product in NY state?
10)What is the most popular (purchased most often) product in North East?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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