Contact Info

sean [at] coreitpro [dot] com gpg key

Mastodon

sc68cal on Libera

Power in verbosity

Write SQL queries to answer the following questions: a.) Which students are enrolled in Database and Networking? (Hint: Use the SECTION_ID for each class so you can determine the answer from the IS_REGISTERED table by itself.) 

SELECT student_id from Is_Registered_t JOIN Section_t ON Is_Registered_t.section_id = Section_t.section_id WHERE course_id = (SELECT course_id FROM Course_t WHERE course_name = "Database") UNION SELECT student_id from Is_Registered_t JOIN Section_t ON Is_Registered_t.section_id = Section_t.section_id WHERE course_id = (SELECT course_id FROM Course_t WHERE course_name = "Networking");

All to get:

+------------+
| student_id |
+------------+
|      54907 | 
+------------+
1 row in set (0.39 sec)