面试题 -- sql 查询分数不低于80 的学生
create table marklist
(
Name varchar(10),
Course varchar(10),
Mark float
)
insert into marklist(name,course,mark) values('张三','数学',75);
insert into marklist(name,course,mark) values('李四','语文',76);
insert into marklist(name,course,mark) values('李四','数学',75);
insert into marklist(name,course,mark) values('王五','英语',100);
insert into marklist(name,course,mark) values('王五','语文',81);
1 中: select distinct name from marklist where name not in(select name from marklist where mark < 80)
2: select name from marklist group by name having min(mark) > 80
不积跬步,无以至千里,不积小流,无以成江河