109.Examine the structure of the MARKS table:
来源:互联网 发布:加速度测试软件 编辑:程序博客网 时间:2024/06/01 10:12
109.Examine the structure of the MARKS table:
name Null Type
STUDENT_ID NOT NULL VARCHAR2(4)
STUDENT_NAME VARCHAR2(25)
SUBJECT1 NUMBER(3)
SUBJECT2 NUMBER(3)
SUBJECT3 NUMBER(3)
Which two statements would execute successfully? (Choose two.)
A.SELECT student_name,subject1 FROM marks WHERE subject1 > AVG(subject1);
B.SELECT student_name,SUM(subject1) FROM marks WHERE student_name LIKE 'R%';
C.SELECT SUM(subject1+subject2+subject3) FROM marks WHERE student_name IS NULL;
D.SELECT SUM(DISTINCT NVL(subject1,0)), MAX(subject1) FROM marks WHERE subject1 > subject2;
答案:CD
解析:
A.错误,首先,avg不能直接使用在where中,除非一个完整的select语句,或者改成having,那么就需要group by
B.错误,sum是聚合函数,通过条件可知,是满足student_name LIKE 'R%'这个条件的所有的行总数,
但是select中student_name可能并不一定是一样的,即使一样,也不能这样用,这里要么使用group by,
要么去掉select中的student_name
C:正确
D:正确
name Null Type
STUDENT_ID NOT NULL VARCHAR2(4)
STUDENT_NAME VARCHAR2(25)
SUBJECT1 NUMBER(3)
SUBJECT2 NUMBER(3)
SUBJECT3 NUMBER(3)
Which two statements would execute successfully? (Choose two.)
A.SELECT student_name,subject1 FROM marks WHERE subject1 > AVG(subject1);
B.SELECT student_name,SUM(subject1) FROM marks WHERE student_name LIKE 'R%';
C.SELECT SUM(subject1+subject2+subject3) FROM marks WHERE student_name IS NULL;
D.SELECT SUM(DISTINCT NVL(subject1,0)), MAX(subject1) FROM marks WHERE subject1 > subject2;
答案:CD
解析:
A.错误,首先,avg不能直接使用在where中,除非一个完整的select语句,或者改成having,那么就需要group by
B.错误,sum是聚合函数,通过条件可知,是满足student_name LIKE 'R%'这个条件的所有的行总数,
但是select中student_name可能并不一定是一样的,即使一样,也不能这样用,这里要么使用group by,
要么去掉select中的student_name
C:正确
D:正确
0 0
- 109.Examine the structure of the MARKS table:
- 94.Examine the structure of the PROGRAMS table:
- 6.Examine the structure of the SHIPMENTS table:
- 18.Examine the structure of the PROMOTIONS table:
- 86.Examine the structure and data of the CUST_TRANS table:
- 96.Examine the structure of the INVOICE table.
- 102.Examine the structure of the TRANSACTIONS table:
- 103.Examine the structure of the TRANSACTIONS table:
- 104.Examine the structure of the PROMOS table:
- 105.Examine the structure of the PROMOS table:
- 113.Examine the structure of the ORDERS table:
- 125.Examine the structure of the CUSTOMERS table:
- 140.Examine the structure of the PRODUCTS table:
- 8.View the Exhibit and examine the structure of the CUSTOMERS table.
- 10.View the Exhibit;examine the structure of the PROMOTIONS table.
- 11.View the Exhibit and examine the structure of the PRODUCTS table.
- 13.View the Exhibit and examine the structure of the PRODUCTS table.
- 44.View the Exhibit and examine the structure of the ORD table.
- (转)关于FPGA器件的工作频率
- eclipse中JNI开发
- 在C#的类库中添加web service引用
- 读者与写者的问题 (
- Activity的生命周期总结
- 109.Examine the structure of the MARKS table:
- ubuntu技巧--minimal bash-like line editing
- 整理自己所学java基础内容,有错误的请大家指出,相互进步
- 开发中碰到的问题:Android应用程序打包时,出现错误:"XXX" is not translated in "af" (Afrikaans), "am" (Amharic), "ar" (Arab
- program g++ not found in path
- 数据库设计不求人(机房收费系统)
- R语言与非参数统计(核密度估计)
- Java WebService 简单实例
- 一个关于static的题目