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