Consider the following database Note that the complete Enrol
Solution
a) SQL query:
SELECT Student_Names
FROM Enrollments, Courses, Students
WHERE Course_Name=DiscreteMath;
The above SQL query returns the result is:
(SELECT statement is used to select particular data from database.
WHERE statement is used to filter records.)
Student Name
Poppy
Jean
Expelnation:
From the given Enrolment table, Student ID:01 has two Course ID\'s: 21 and 25,
Student ID:02 has two Course ID\'s: 21 and 24.
From the given Courses table, Course ID: 21 have the Course Name: Discrete Math.
From the given Students table, Student ID: 01 & 02 have the Student Names: Poppy and Jean
b) SQL quey:
SELECT Instructor_Names
FROM Enrollments, courses, Instructors
WHERE Student_ID=01;
The above SQL query returns the result is:
Instructor_Name
David
Derrick
Expelnation:
From the given Enrolment table, Student ID:01 has two Course ID\'s: 21 and 25,
From the given Courses table, Course ID: 21 & 25 have the Instructor ID: 15 & 13.
From the given Instructors table, Instructor ID: 15 & 13 have the Instructor Names: Derrick and David
