Consider the following database Note that the complete Enrol

Consider the following database. Note that the complete Enrollments table is not given. Describe in English what the following SQL query returns SELECT Student_Names FROM Enrollments, Courses, Students WHERE Course_Name = Discrete Math Construe! a SQL query that returns a list of all of the names of Poppy\'s instructors.

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

 Consider the following database. Note that the complete Enrollments table is not given. Describe in English what the following SQL query returns SELECT Student

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site