Question
QUESTION 2 (25 MARKS) The following tables form part of a database held in a relational DBMS (Primary Key, Foreign Key): Product (P_ID, P_Description, Price)
QUESTION 2 (25 MARKS)
The following tables form part of a database held in a relational DBMS (Primary Key, Foreign
Key):
Product (P_ID, P_Description, Price)
Customer (Cust_ID, FirstName, LastName, Type)
ProductCustomer (P_ID,Cust_ID, Date_Purchased)
Staff (Staff_ID, FirstName, LastName, Role)
Provide the
SQL
for the following queries (5 marks each):
a)
List the numbers of Products purchased by Online Customers
b)
Show the Customers who have purchased more than three Products
c)
List the maximum number of Products purchased by any Customer
d)
Show the In-store Customers who have purchased any Product in year 2022
e)
List the full details of the most expensive as well as the cheapest Product
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