For each of the following SQL queries, what is the number of rows of the result
ID: 3738876 • Letter: F
Question
For each of the following SQL queries, what is the number of rows of the result obtained when applied to these instances? (12 Pts)
a) SELECT *
FROM Customer C, Reserves R
WHERE C.cid = R.cid;
b) SELECT *
FROM Customer C, Reserves R
WHERE C.cid = R.cid AND C.city = Oakland;
c) SELECT DISTINCT title
FROM Customer C, Reserves R
WHERE C.cid = R.cid AND C.city = Oakland;
d) SELECT title, COUNT(*)
FROM Customer C, Reserves R
WHERE C.cid = R.cid
GROUP BY title;
Explanation / Answer
Ans a) 7
Ans b) 4
Ans c) 4
Ans d) output is:
TITLE COUNT(*)
-------------------- ----------
Interiors 1
Sleeper 4
Annie Hall 1
Bananas 1
So number of rows of the result obtained: 4
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.