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, 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;

a) b) c) d) Customer Reserves CID Title CID.| Name | Age | City | State 1Joe 27BerkeleyCA 2 Betty 23Oakland CA 3 Sally 49Albany CA 4Hamy 38Berkeley CA 1 Sleeper Bananas 2 Sleeper Date 01/01/01 01/01/01 01/01/01 2Annie Hall 0201/01 2 Sleeper Interiors 4 Sleeper 02/01/01 02/01/01 03/01/01

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

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