设有学生表student(sno,sname,sage,smajor),各字段含义分别为学号、姓名、年龄、专业;学生选课表score(sno, cname,grade),各字段含义分别为学生学号、课程名、成绩。若要检索“信息管理”专业、选修课程DB的学生学号、姓名及成绩,如下能实现该检索要求的语句是( )
A. SELECT s.sno,sname,gradeFROM student s ,score scWHERE s.sno=sc.sno AND s.smajor="信息管理" AND cname="DB" ;
B. SELECT s.sno,sname, gradeFROM student s,score scWHERE s.smajor="信息管理" AND cname="DB";
C. SELECT sno,sname, gradeFROM studentWHERE sno=sc.sno AND s.smajor="信息管理" AND cname="DB";
D. SELECT s.sno,sname, gradeFROM student sWHERE smajor="信息管理"AND cname="DB";
查看答案
下列JOIN连接关键字中,不正确的是( )
A. LEFT OUT JOIN
B. NATURAL JOIN
CROSS JOIN
D. INNER JOIN
学生关系模式tb_student包含学号sno、学生姓名sname、性别sex、年龄age、所在院系dept等字段,要求查询各个院系的男生人数、女生人数,下列查询语句中正确的是( )
A. SELECT dept, sex, COUNT(*) FROM tb_student GROUP BY dept, sex;
B. SELECT sex, COUNT(*) FROM tb_student GROUP BY sex;
C. SELECT dept, COUNT(*) FROM tb_student GROUP BY dept;
D. SELECT dept, sex,SUM(*) FROM tb_student GROUP BY dept, sex;
给定员工表tb_emp包含字段eno(职工号)、name(姓名)、age(年龄)、salary(工资)和dept(所在部门),要统计“市场部”的员工人数,正确的语句是( )
A. SELECT dept, COUNT(*) FROM tb_emp GROUP BY dept HAVING dept='市场部';
B. SELECT dept, TOTAL(*)FROM tb_emp GROUP BY dept='市场部';
C. SELECT dept, COUNT(*) FROM tb_emp GROUP BY dept ='市场部';
D. SELECT dept, SUM(*) FROM tb_emp GROUP BY dept HAVING dept='市场部';
多表查询需要设定表间的联接条件。
A. 对
B. 错