Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please write the queries base on the above database 2. List ID for all products,

ID: 3573867 • Letter: P

Question

Please write the queries base on the above database

2. List ID for all products, which have NOT been ordered since 28-OCT-2008. Sort your results by
product_id in ascending order. Use Minus for this query

3. List ID for all Arizona customers, who have placed order(s) since 28-OCT-2008. Sort your
results by cust_id in ascending order. Use Intersect for this query

hwquery New customer Columns New CITY CUST ID a CUST NAME STATE I STREET LI ZIPCODE Indexes T- orderline Columns New order id product id quantity Indexes ordertable -Il Columns New cust id order date order id Indexes product Column New product id product name product price Indexes

Explanation / Answer

2)

SELECT PRODUCT_ID FROM product
MINUS
SELECT PRODUCT_ID FROM orderline
NATURAL JOIN
ordertable
WHERE
ORDER_DATE > '24-OCT-08'
ORDER BY PRODUCT_ID DESC;

3)

SELECT cust_id FROM customer
WHERE state = ‘AZ’
INTERSECT
SELECT cust_id FROM ordertable WHERE order_date >’28-OCT=2008’
ORDER BY cust_id;