Home > database >  Mysql weak chicken for bosses
Mysql weak chicken for bosses

Time:09-17


As shown in figure is table structure, without changing the structure of the table how to complete:
Query did not learn all class student id, name, and not studying subjects

CodePudding user response:

Through the following SQL access to the results you want to:
Select c_id, cname, s_id, sname from course c, student s
The where (c_id, cname, s_id, sname)
Not in
(select ts c_id, ts. Cname, ts, s_id, ts, sname from (
Select distinct Arthur c. _id, cname, s.s _id, sname from student s
A inner join sc on s.s _id=a.s _id
Inner join course c on a.c _id=Arthur c. _id
Inner join the teacher te on c.t _id=te. T_id) ts)

Mysql implementation or and oracle difference is bigger, if use oracle only need to use minus can be achieved
  • Related