用SQL语句查计算机系、数学系、信息系的学生姓名、性别?

2025-03-06 22:13:03
推荐回答(2个)
回答1:

select st.姓名,st.性别 from Student st,Sclass sc,Class c where st.学号=sc.学号 and sc.课程编号=c.课程编号 and c.课程名字="计算机系";

select st.姓名,st.性别 from Student st,Sclass sc,Class c where st.学号=sc.学号 and sc.课程编号=c.课程编号 and c.课程名字="数学系";

select st.姓名,st.性别 from Student st,Sclass sc,Class c where st.学号=sc.学号 and sc.课程编号=c.课程编号 and c.课程名字="信息系";

回答2:

你的表设计都有问题。学生表里面没有系别的字段怎么能查出计算机系的学生呢。