Question
Consider three tables defined as follows: Product(prod-id,description,category,unit-price) Customer(cust-id,address,limit-of-credit) Orders(prod-id,cust-id,order-date,number-ordered) These tables describe the operation of a wholesale supplier of products who satisfies orders placed by
Consider three tables defined as follows:
Product(prod-id,description,category,unit-price)
Customer(cust-id,address,limit-of-credit)
Orders(prod-id,cust-id,order-date,number-ordered)
These tables describe the operation of a wholesale supplier of products who satisfies orders placed by customers. Write relational algebra expressions to answer the following queries and use Join (), Selection (), Projection (), Union (), Intersection () is Rename (), Assignment (), and Subscripts in the expressions.
(a) Find the ids of products not ordered by any customer.
(b) Find the product-ids of all products for which there is at least one order costing less than $500. (The cost is the quantity times the unit price.)
(c) Show all attributes of orders for which satisfying that order alone would exceed the customer's credit limit.
(d) Find the categories of all products ordered on 1/1/2023.
(e) Find the ids of products that either cost less than $30, or have been ordered prior to 1/1/2021.
(f) Find pairs of customers who ordered the same product on the same date. (Do not include both a pair and its reverse.)
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