Hi,
Hi,
I have to write a query that can display records that are not present in one table. For eg. I have a course tablle, a student table and a registered course table. The course table has the list of all courses. The student table has the list of all students. The registered course table holds the student ids and the course ids corresponding to the courses registered by the particular student. I would like to write a query that can display all the courses that havent been registered by a particular student. Can anyone help me with this.
Course Table
id course name instructor
1 Database design David Mok
2 E-Commerce Anne Bradley
3 Networks Roberta Stanley
Student Table
id student name status
101 Kerri Kenney senior
201 Anderson Mason freshman
311 Calvin Stenison senior
Registration
id student id course id
1001 201 3
1002 201 1
1003 101 2
1003 101 1
1004 311 3
I would like to display all the courses that have not been registered by student id 311(which would be course id 1 and 2).
Can someone help me with this?
Thanks in advance!!!
Hi,
I have to write a query that can display records that are not present in one table. For eg. I have a course tablle, a student table and a registered course table. The course table has the list of all courses. The student table has the list of all students. The registered course table holds the student ids and the course ids corresponding to the courses registered by the particular student. I would like to write a query that can display all the courses that havent been registered by a particular student. Can anyone help me with this.
Course Table
id course name instructor
1 Database design David Mok
2 E-Commerce Anne Bradley
3 Networks Roberta Stanley
Student Table
id student name status
101 Kerri Kenney senior
201 Anderson Mason freshman
311 Calvin Stenison senior
Registration
id student id course id
1001 201 3
1002 201 1
1003 101 2
1003 101 1
1004 311 3
I would like to display all the courses that have not been registered by student id 311(which would be course id 1 and 2).
Can someone help me with this?
Thanks in advance!!!