Q. Which SQL statement allows you to find the total sales amount for Store ID 25 and the total sales amount for Store ID 45?
(a) SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES WHERE STORE_ID IN (25,45) GROUP BY STORE_ID;
(b) SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES GROUP BY STORE_ID HAVING STORE_ID IN (25,45);
(c) SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES WHERE STORE_ID IN (25,45);
(d) SELECT STORE_ID, SUM(SALES_AMOUNT) FROM
SALES WHERE STORE_ID = 25 AND STORE_ID = 45 GROUP BY STORE_ID;
TABLE:- SALES
Column Name |
STORE_ID |
SALES_DATE |
SALES_AMOUNT |
Answer =
(b) SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES GROUP BY STORE_ID HAVING STORE_ID IN (25,45);
Nice 👍
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )