Which two SQL statements would execute successfully?

See the Exhibit and examine the structure and data in the INVOICE table:

Which two SQL statements would execute successfully? (Choose two.)

See the Exhibit and examine the structure and data in the INVOICE table:

Which two SQL statements would execute successfully? (Choose two.)

A.
SELECT MAX(inv_date),MIN(cust_id)
FROM invoice;

B.
SELECT AVG(inv_date-SYSDATE),AVG(inv_amt)
FROM invoice;

C.
SELECT MAX(AVG(SYSDATE-inv_date))
FROM invoice;

D.
SELECT AVG(inv_date)
FROM invoice;



Leave a Reply 2

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


bina

bina

C is wrong, its needs group by function.
D is wrong date datatype is not avg.

deepak

deepak

SELECT MAX(AVG(SYSDATE-inv_date))
FROM invoice;

ORA-00978: nested group function without GROUP BY

Also AVG expects Number not date.
select avg(hire_date) from employees
ORA-00932: inconsistent datatypes: expected NUMBER got DATE