如果想去掉结果表中的重复行,必须指定DISTINCT短语:SELECT DISTINCT Sno FROMSC; 例47查询计算机科学系的学生与年龄不大于19岁的学生的交集,这实际上就是查询计算机科学系中年龄不大于19岁的学生。 SELECT * FROM Student WHERE Sdep护'CS'AND Sage<=19; 例48查询选修课程1的学生集合与选修课程2的学生集合的交集...
Select distinct sno From sc Where cno not in ('1', '2', '5') !!!***执行结果中有四个学号显示 !!!***打开sc表查看应该只有99002这个学号符合题意,思考为什么出错? 正确的方法(用子查询): select sno from s where sno not in (select sno from sc where cno in ('1', '2', '5'))...
具体来说,SQL语句“select count(distinct sno) from sc”可以统计学生的总人数,其中sc表示学生息表。它的作用是,从学生息表中统计不同学号的总数,这就是学生的总人数。 SQL语句可以方便、快捷地统计学生的总人数,但是要想正确使用,必须先了解语句的含义。例如,select关键字用于选择要查询的数据,count函数用于计算...
SELECT DISTINCT sno FROM SC; #取出重复行 如果没有指定DISTINCT的话,默认是ALL,重复数据也会被显示出来 条件查询 SELECT * FROM stu WHERE sage < 18; SELECT * FROM stu WHERE sage BETWEEN 20 AND 23; SELECT * FROM stu WHERE sdept IN ('CS','MA','IS'); 条件查询之模糊查询 %代表任意长度 _...
A. SELECT ALL Sno FROM SC WHERE Grade = 100; B. SELECT DISTINCT Sno FROM SC WHERE Grade = 100; C. SELECT ALL Sno FROM Student WHERE SC.Grade = 100; D. SELECT DISTINCT Sno FROM Student WHERE SC.Grade = 100;相关知识点: 试题来源: 解析 SELECT DISTINCT Sno FROM SC WHERE Grade = 10...
百度试题 题目SELECT COUNT(DISTINCT Sno) FROM SC 语句用于统计学生的总人数。 A.正确B.错误相关知识点: 试题来源: 解析 B 反馈 收藏
答案: (1) SELECT DISTINCT SNO FROM SC SCX WHERE NOT EXISTS (SELECT * FROM SC SCY WHERE SCY.SNO = ' 1042' AND NOT EXISTS (SELECT * FROM SC SCZ WHERE SCZ.SNO=SCX.SNO AND AS SELECT SNO,SNAME,SEX FROM STUDENT WHERE Sdept=’CS’ (3)UPDATE S_CS_VIEW SET SNAME= ’王慧平 ’ WHERE...
1、select distinct sno from sc where grade<60 2 select * from student where sdept in('cs','is') select * from student where sdept='cs' or sdept='is' 3 select sno,sname,sage from student where sage between 10 and 19 >=10 and <=19 ...
刷刷题APP(shuashuati.com)是专业的大学生刷题搜题拍题答疑工具,刷刷题提供SELECT COUNT(DISTINCT Sno) FROM SC 语句用于统计学生的总人数。A.正确B.错误的答案解析,刷刷题为用户提供专业的考试题库练习。一分钟将考试题Word文档/Excel文档/PDF文档
百度试题 题目此语句可以查询没有选修课程的学生姓名?SELECT Sname FROM Student WHERE Sno NOT IN (SELECT DISTINCT(Sno) FROM SC WHERE Cno IS NOT NULL) A.正确B.错误相关知识点: 试题来源: 解析 A