CBSE Class 12 Computer Science Question 59 of 79

Table Creation and Data Manipulation Commands — Question 5

Back to all questions
5
Question

Question 5

Given the following tables :

Orders (OrdNo, Ord_date, ProdNo#, Qty) 
Product (ProdNo, Descp, Price)
Payment (OrdNo, Pment)

Write a query to delete all those records from table Orders whose complete payment has been made.

Answer
DELETE FROM Orders
WHERE OrdNo IN (
    SELECT Payment.OrdNo
    FROM Payment
    WHERE Payment.Pment = 'COMPLETE');