sqlquery5.sql
来自「经典的SOL面试题,涵盖了数据库各个层面的问题和答案。」· SQL 代码 · 共 37 行
SQL
37 行
/*
create table student (name varchar(10),curricula varchar(10),mark int)
insert into student select 'xuu','math',100
insert into student select 'xuu','phy',100
insert into student select 'xuu','science',100
insert into student select 'xuu','chinese',100
insert into student select 'xuu','english',100
insert into student select 'wang','math',110
insert into student select 'wang','phy',110
insert into student select 'wang','science',110
insert into student select 'wang','chinese',110
insert into student select 'wang','english',110
*/
/*
Student表有三列,分别是姓名、课程、成绩
Name Curricula Mark
张三 语文 70
李四 数学 80
王朝 英语 59
城南 马哲 70
王朝 语文 90
. . .
. . .
查询每门学科成绩及格(Mark > 60)的学生的名字?
查询出总分排名前三的学员名字?
*/
/*
select name from student group by name having min(mark)>60
select top 3 name, sum(mark) from student
group by name
order by sum(mark)
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?