Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using the below University schema, write a SQL query that returns the LastName o

ID: 3757133 • Letter: U

Question

Using the below University schema, write a SQL query that returns the LastName of inactive students and faculty members. A student is inactive if he/she is not enrolled in any courses. A faculty member is inactive if he/she is not instructing any courses and is not serving as a department head Hint: Use CONCAT( FirstName, '",LastName) to get the full name of a faculty member Input Format The Students, Enrollments, Courses,Departments and Faculty table are defined as follows: Students Column Name Type VARCHAR(10) Firstame VARCHAR(255) VARCHAR(255) Department VARCHAR100) Netld LastName

Explanation / Answer

If you have any doubts, please give me comment...

SELECT LastName

FROM Students

WHERE NetId NOT IN(

SELECT NetId

FROM Enrollments

)

UNION

SELECT LastName

FROM Instructor

WHERE CONCAT(FirstName, ' ', LastName) NOT IN(

SELECT Instructor

FROM Courses

) AND CONCAT(FirstName, ' ', LastName) NOT IN(

SELECT DepartmentHead

FROM Department

);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote