Which statement is true regarding the execution of the above statement?

View the Exhibit and examine the description of the ORDERS table. You need to display CUSTOMER_ID for all customers who have placed orders more than three times in the last six months. You issued the following SQL statement:
SELECT customer_id,COUNT(order_id)
FROM orders
WHERE COUNT(order_id)>3 AND
order_date BETWEEN ADD_MONTHS(SYSDATE,-6) AND SYSDATE GROUP BY customer_id;
Which statement is true regarding the execution of the above statement?

View the Exhibit and examine the description of the ORDERS table.

You need to display CUSTOMER_ID for all customers who have placed orders more than three times in the last six months. You issued the following SQL statement:
SELECT customer_id,COUNT(order_id)
FROM orders
WHERE COUNT(order_id)>3 AND
order_date BETWEEN ADD_MONTHS(SYSDATE,-6) AND SYSDATE GROUP BY customer_id;

Which statement is true regarding the execution of the above statement?

A.
It would execute successfully and provide the desired result.

B.
It would not execute because the WHERE clause cannot have an aggregate function.

C.
It would not execute because the ORDER_ID column is not included in the GROUP BY clause.

D.
It would not execute because the GROUP BY clause should be placed before the WHERE clause.



Leave a Reply 3

Your email address will not be published. Required fields are marked *


miriam

miriam

HAVING COUNT(order_id)>3 is the correct way

user

user

update empu set (ename ,sal, deptno) =
(select ‘new’, 9777, 77 from dual) where empno =1;

UPDATE employees a
SET department_id =
(SELECT department_id
FROM departments
WHERE location_id = ‘2100’),
(salary, commission_pct) =
(SELECT 1.1*AVG(salary), 1.5*AVG(commission_pct)
FROM employees b
WHERE a.department_id = b.department_id)
WHERE first_name||’ ‘||last_name = ‘Amit Banda’;

user

user

select max(sal) from emp having 100 < max(sal);