(Microsoft Access SQL) I am trying find the UNum for users who played the same g
ID: 3756923 • Letter: #
Question
(Microsoft Access SQL) I am trying find the UNum for users who played the same game on all consoles. I have most of my query but am not sure how get the correct output. Based on what the question is asking I belive the output should be U20 because that us the only one that has played the same games on concols, but I am not sure how to get there.
SELECT UNum
FROM Users AS U
WHERE EXISTS
(SELECT*
FROM Games AS G
WHERE G.GNum
AND EXISTS
(SELECT *
FROM Plays AS P
WHERE P.UNum = U.UNum
AND P.GNum = G.GNum));
Explanation / Answer
If you have any doubts, please give me comment...
SELECT UNum
FROM Users AS U
WHERE NOT EXISTS(
SELECT *
FROM Consoles AS C
WHERE NOT EXISTS(
SELECT *
FROM Plays AS P
WHERE P.UNum = U.UNum AND C.CNum = P.CNum
)
);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.