几道sql题求答案

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了几道sql题求答案相关的知识,希望对你有一定的参考价值。

1、查询所有学生的详细信息,并按姓名升序(降序)排序。
2、查询所有选修了《数据结构》课程的李姓同学的信息。
3、查询每门课程的最高分、最低分和平均分。
4、将Student表中男学生的数据存为一个新表,命名为“男学生表”。
5、查询所有年龄大于20岁的女学生的信息。
6、为Student表的s_name字段建立唯一索引,索引名为i_name,并降序排序。
7、为Score表的score字段建立非聚焦索引,索引名为i_score,并降序排序。
8、创建视图v_nopass,查询所有不及格学生的学号,姓名,科目和成绩。

1,select * from 表名 order by 姓名
2,select * from 表面 where 课程=“数据结构” and 姓名 like “%李%”
3,select max(成绩),min(成绩),avg(成绩) from 表名 group by 成绩
4,select into 男学生表 from 表名 where 性别=“男”
5,select * from 表名 where 性别=“女” and 年龄>20
6,create uniwue clustered index i_name on 表名(s_name)
7,create nonclustered index i_score on 表名(score)
8,create view v_nopass as select 学号,姓名,科目,成绩 where 成绩<60
参考技术A 1、select * from student order by sname desc;
2、select * from student a,course b where a.sid=b.sid and b.name='数据结构' and a.sname like '李%';
3、select max(score) from score group by name
4、create table 男学生表 as select * from student where sex='m';
5、select * from student where age>'20' and sex='w';
6、create unique index i_name on Student(s_name desc);
7、create index i_score on score(score asc);
8、create view v_nopass select * from student a,score b wehre a.id=b.id and b.score<60;
参考技术B 你好

以上是关于几道sql题求答案的主要内容,如果未能解决你的问题,请参考以下文章

大厂面试常见的几道SQL题,看你能答吗?

C语言入门题求答案:设所有变量均为int类型,则表达式(a=5,b=6,++a,b--,a+b)的

交换棋子

10道腾讯C++/Java笔试真题你能做对几道?3道就赢了80%的竞争者(含答案)

Linux基础面试题分享,看看你能答对几道(附带答案)?

面试疑点:几道题答了一个小时,应该是等答案