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

For each of the following SQL queries, for each relation involved, list the attr

ID: 3926578 • Letter: F

Question

For each of the following SQL queries, for each relation involved, list the attributes that must be examined to compute the answer. All queries refer to the following relations: Emp(eid: integer, did: integer, sal: integer, hobby: char(20)) Dept(did: integer, dname: char(20), floor: integer, budget: real) a. SELECT COUNT(*) FROM Emp E, Dept D WHERE E.did = D.did b. SELECT MAX(E.sal) FROM Emp E, Dept D WHERE E.did = D.did c. SELECT MAX(E.sal) FROM Emp E, Dept D WHERE E.did = D.did AND D.floor = 5 d. SELECT E.did, COUNT(*) FROM Emp E, Dept D WHERE E.did = D.did GROUP BY D.did

Explanation / Answer

a. The attributes that must be examined to compute SELECT COUNT(*) FROM Emp E, Dept D WHERE E.did = D.did is E.did, D.did

b. The attributes that must be examined to compute SELECT MAX(E.sal) FROM Emp E, Dept D WHERE E.did = D.did is E.sal, E.did, D.did

c. The attributes that must be examined to compute SELECT MAX(E.sal) FROM Emp E, Dept D WHERE E.did = D.did AND D.floor = 5 is E.sal, E.did, D.did, D.floor

d. The attributes that must be examined to compute SELECT E.did, COUNT(*) FROM Emp E, Dept D WHERE E.did = D.did GROUP BY D.did is E.did, D.did

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