数据库SQL语句练习题5--9

时间:2022-11-17 00:16:26

5、 查询Score表中成绩为85,86或88的记录。

select * from SCORE t where degree in (85,86,88)

数据库SQL语句练习题5--9

6、 查询Student表中“95031”班或性别为“女”的同学记录。

select * from STUDENT t where class='95031' or ssex = ''

数据库SQL语句练习题5--9

7、 以Class降序查询Student表的所有记录。

select * from STUDENT t order by class desc

数据库SQL语句练习题5--9

8、 以Cno升序、Degree降序查询Score表的所有记录。

select * from SCORE t order by t.cno , t.degree desc

数据库SQL语句练习题5--9

9、 查询“95031”班的学生人数。

select count(class) 人数 from STUDENT t where class='95031'

数据库SQL语句练习题5--9