422 views
0 0 votes

For the following relational tables,
Grocery(Grocery_ID, Name, Category,Exp_date,Mfg_date)
Sale_Grocery(SaleID,Grocery_ID)
Sale(SaleID, Price)


What is the total money made by selling “Tomato_Sauce” by December 2017? 
Choose correct SQL query from below for above question : )

  1.   a) SELECT Sum(Sale.Price)
    FROM Sale INNER JOIN Sale_Grocery ON Sale.SaleID = Sale_Grocery.SaleID
    WHERE ((Exp_date < '2017-31-12') AND Grocery.Name = ‘Tomato_Sauce’);
  2.   SELECT Sum(Sale.Price)
    FROM Sale LEFT JOIN Sale_Grocery ON Sale.SaleID = Sale_Grocery.SaleID
    WHERE ((Exp_date < '2017-31-12') AND Grocery.Name = ‘Tomato_Sauce’);
  3.   SELECT Sum(Sale.Price)
    FROM Sale FULL JOIN Sale_Grocery ON Sale.SaleID = Sale_Grocery.SaleID
    WHERE ((Exp_date < '2017-31-12') AND Grocery.Name = ‘Tomato_Sauce’);
  4.   None of these

Please log in or register to answer this question.

Position:
Show:

No related questions found