See the Exhibit and examine the structure and data in the INVOICE table:
Exhibit:
Which two sql statements would executes successfully? (Choose two.)
A. SELECT MAX(inv_date),MIN(cust_id) FROM invoice;
B. SELECT MAX(AVG(SYSDATE - inv_date)) FROM invoice;
C. SELECT AVG(inv_date) FROM invoice;
D. SELECT AVG(inv_date - SYSDATE),AVG(inv_amt) FROM invoice;
答案: A,D
Exhibit:
Which two sql statements would executes successfully? (Choose two.)
A. SELECT MAX(inv_date),MIN(cust_id) FROM invoice;
B. SELECT MAX(AVG(SYSDATE - inv_date)) FROM invoice;
C. SELECT AVG(inv_date) FROM invoice;
D. SELECT AVG(inv_date - SYSDATE),AVG(inv_amt) FROM invoice;
答案: A,D
二、题目翻译
看下面INVOICE表的结构:
哪两个sql会执行成功(选择两项)?
哪两个sql会执行成功(选择两项)?
三、题目解析
B选项不正确,SYSDATE - inv_date的结果是数字,这里AVG的结果就只有一条记录了,再求MAX,就没意义了,这句会报错。 C选面不正确,inv_date是日期类型,AVG求日期的平均值,会报错。