求解select查询语句

来源:百度知道 编辑:UC知道 时间:2024/06/01 22:58:50
写出在class表中查找满足如下条件的记录的sql语句:1、返回字段c_name,c_stu 2、返回记录数:前5位 3、查询条件:c_stu值 大于30,并且c_type值为真,并且c_name字段值中有“二班”两字 4、查询结果按c_stu正排序,按c_type倒排序(注:在正排序时请不要省略排序关键字)

select top 5 c_name,c_stu from class where c_stu>30 and c_type = '真'
and c_name like '%二班%' order by c_stu asc, c_type desc

1.
select c_name , c_stu from class

2.
select count(*) from class

3.
select * from class where c_stu>30 and c_type=true and c_name like '%二班%'

4.
select * from class order by s_std,c_type desc