Which two SQL statements would execute successfully?

View the Exhibit and examine the structure and data in the INVOICE table.
Which two SQL statements would execute successfully? (Choose two.)

View the Exhibit and examine the structure and data in the INVOICE table.
Which two SQL statements would execute successfully? (Choose two.)

A.
SELECT AVG(inv_date )
FROM invoice;

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

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

D.
SELECT AVG( inv_date – SYSDATE), AVG(inv_amt)
FROM invoice;

Explanation:
Using the AVG and SUM Functions
You can use the AVG, SUM, MIN, and MAX functions against the columns that can store numeric
data. The example in the slide displays the average, highest, lowest, and sum of monthly salaries
for all sales representatives
Using the MIN and MAX Functions
You can use the MAX and MIN functions for numeric, character, and date data types. The
example in the slide displays the most junior and most senior employees.



Leave a Reply 6

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


Jason

Jason

i can not find any differece between them.

Bina

Bina

Date can’t be avg
So A is wrong

C is wrong because you can’t do avg max.

prince jain

prince jain

because query does not have group by clause.

Dipak Upwanshi

Dipak Upwanshi

in option D, avg is used for date, then how can it be right?

prince jain

prince jain

i run a sql query
select AVG(sysdate- order_date) from order_detail

Qoutput: sysdate-order_date alway returns values in number form .. its means AVG function is calculating on numeric data

Bhavin

Bhavin

in D inv_date – SYSDATE is done which will reurn number so average is possible