叶平专题

SQL经典50查询语句案例_7(查询学过“叶平”老师所教的所有课的同学的学号、姓名)

SQL经典50查询语句案例_7: 7、查询学过“叶平”老师所教的所有课的同学的学号、姓名: SELECT st.SId, st.StuName FROM teacher t, sc s, student st, course cWHERE t.Tname = '叶平' AND c.TId=t.TId AND c.CId=s.CId AND s.SId = st.SId 在MySQL命令行中

SQL经典50查询语句案例_5(查询没学过“叶平”老师课的同学的学号、姓名)

SQL经典50查询语句案例_5: 5、查询没学过“叶平”老师课的同学的学号、姓名: SELECTSId,StuNameFROMstudentWHERE SId NOT in(SELECT s.SId FROMteacher t,sc s, course cWHEREt.Tname = '叶平'AND c.TId = t.TIdAND c.CId = s.CId) 在MySQL命令