just answer this 1 Given the description of the ORDERS table below, write a SQL
ID: 3596291 • Letter: J
Question
just answer this
1 Given the description of the ORDERS table below, write a SQL query that will return the ORDER_ID, ORDER_DATE and CUSTOMER_ID, but include only the orders where the ORDER_TOTAL is greater than 20000. GROUP BY customer ID.
Name Null? Type
----------------------------------------- -------- ------------------
ORDER_ID NOT NULL NUMBER(13)
ORDER_DATE NOT NULL TIMESTAMP(6) WITH LOCAL TIME
ZONE
ORDER_MODE VARCHAR2(8)
CUSTOMER_ID NOT NULL NUMBER(6)
ORDER_STATUS NUMBER(2)
ORDER_TOTAL NUMBER(8,2)
SALES_REP_ID NUMBER(6)
PROMOTION_ID NUMBER(4)
Explanation / Answer
Hi, your question isn't very clear. As per the literal meaning, it seems that you want to find those orders where ORDER_TOTAL is greater than 20000, and then group these by CUSTOMER_ID. For it, the below query will work.
SELECT ORDER_ID, ORDER_DATE, CUSTOMER_ID FROM ORDERS WHERE ORDER_TOTAL > 20000 GROUP BY CUSTOMER_ID;
If it was meant to ask something else, kindly let me know! I'm here to solve your doubts!!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.