试编写一个存储过程proc1,要求实现以下两个功能。
- 查询前面Student表中的年龄最小的两名女生信息;
- 查询统计前面没有选课的学生人数。
drop procedure if exists proc1;
create procedure proc1()
begin
select * from student order by Sdate desc limit 0,2;
select count(*) from student where (student.Sno not in (select distinct Sno from sc));
end;
call proc1();
运行截图: