Reference for Question 1 Sales Database: Customer(custId, lastName, firstName, a
ID: 3913214 • Letter: R
Question
Reference for Question 1
Sales Database:
Customer(custId, lastName, firstName, address, phone, creditLimit)
Order(orderNumber, date, total, custId)
LineItem(orderNumber, itemNumber, qtyOrdered)
Item(itemNumber, itemName, price)
For the Sales Database in the reference, write the relational algebra expression for the query
Find the lastName of the customer for orderNumber 12345.
Reference for Question 2
Sales Database:
Customer(custId, lastName, firstName, address, phone, creditLimit)
Order(orderNumber, date, total, custId)
LineItem(orderNumber, itemNumber, qtyOrdered)
Item(itemNumber, itemName, price)
For the Sales Database in the reference, write the relational algebra expression for the query "Find the names and quantities of all items on order 12345."
Explanation / Answer
Q1.
SELECT c.lastName
FROM Customer c, Order o
WHERE
c.CustId = o.CustId
AND
o.orderNumber = 12345;
Q2.
SELECT i.itemName, l.qtyOrdered
FROM Item i, LineItem l
WHERE
i.itemNumber = l.itemNumber
AND
l.orderNumber = 12345;
thanks and cheers, please comment if you have any problem rather than giving thumbs down.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.