sqlserver advanced must know - sub query typical case student table and grade table

--5.42  选修了课程号为205课程的学生情况  
--数据来源+ 条件
-- 1 数据来源为学生表  和成绩表
-- 成绩表里面才有课程号 信息 
--select  * from st where 


-- score 里面有学号,课程号 
select  * from st where stno in(
select stno from score  where cno='205')




select * from st 

select * from score 
select stno from score



alter table score add stno int null;

Effect

  

 

Guess you like

Origin blog.csdn.net/chenggong9527/article/details/123941175