Documente Academic
Documente Profesional
Documente Cultură
…...........................................................................
5.Select all orders made to "Momo"
Ans:
SELECT * FROM suppliers NATURAL JOIN ordered NATURAL JOIN orderline NATURAL
JOIN component
WHERE component.description='momo'
............................................................
13.Retrieve Order,Part,and Quantity information from the above table as mentioned in 12.
Ans:
SELECT orderno,partno,qty FROM podetail
14. Display the order numbers,dates and status for all orders completed and pending.Remember that all
orders in the pohistory table are completed.
Ans:
SELECT ordernumber,orderdate,invoiceno_status FROM poheader
WHERE invoiceno_staus='completed' OR invoiceno_status='pending'
15. All vendors located in city 'Leeds' are increasing their proces by 200.00.Apply this increase to the
database .
Ans: UPDATE podetail SET unit_price=(unit_price+200) WHERE orderno IN (SELECT orderno
FROM vendor NATURAL JOIN WHERE city='LEEDS')
16. Find the vendorno with second highest price from priceinfo.
Ans:
SELECT vendorno,price,Ranked_price FROM (SELECT vendorno,price,DENSE_RANK () over
(ORDER BY price) AS Ranked_price FROM priceinfo)
17.Create table dual as select* from dual;What happens when this statement is executed and why?
Ans: The above query was executed because it overwrites the existing virtual table.