Auto commit
This commit is contained in:
parent
c57e611d42
commit
02b5667ffc
@ -274,7 +274,7 @@ FROM teachers t
|
||||
WHERE t.`name` LIKE '李%';
|
||||
|
||||
#6.查询学过「张三」老师授课的同学的信息
|
||||
SELECT st.*
|
||||
SELECT DISTINCT st.*
|
||||
FROM students st, scores sc
|
||||
WHERE st.id = sc.student_id AND sc.course_id = (
|
||||
SELECT c.id
|
||||
@ -293,10 +293,10 @@ HAVING COUNT(*) < 3;
|
||||
#8.查询至少有一门课与学号为" 01 "的同学所学相同的同学的信息
|
||||
SELECT st.*
|
||||
FROM students st, scores sc
|
||||
WHERE st.id = sc.student_id AND sc.course_id IN(
|
||||
SELECT
|
||||
FROM courses
|
||||
WHERE student_id = '01'
|
||||
WHERE st.id = sc.student_id AND st.id <> '01' AND sc.course_id IN(
|
||||
SELECT course_id
|
||||
FROM scores s
|
||||
WHERE s.student_id = '01'
|
||||
);
|
||||
|
||||
#9.查询和" 01 "号的同学学习的课程完全相同的其他同学的信息
|
||||
|
Loading…
x
Reference in New Issue
Block a user