787 views
0 0 votes
Consider the following Realtion

Borrower(borrower no , name , age)

Loan (copy no , borrower no , due date )

Retrieve the borrower name and number of books currently on loan for each of the borrower

1) Select borrower.name, count (*)

from loan where loan.borrower name= borrower.borrower name

group by borrower.borrower.no

2)

 Select borrower.name, count (*)

from loan , borrower where loan.borrower name= borrower.borrower name

group by borrower.borrower.no

3)

 Select borrower.name, count (*)

from loan, borrowe  where loan.borrower name= borrower.borrower name

group by loan .borrower.no

4) None of these

1 Answer

0 0 votes
My answer was c

Because (I used” group By loan.Borrower no “because they will give me exactly only those borrowers who have taken loan . If I opt to take “Group By Borrower.Borrower No “then I will get tuples who have taken loan as well as who didn’t take any loan )

Am i right ?
Position:
Show:

Related questions

2 2 votes
1 1 answer
80
80 views
GO Classes asked 20 hours ago
80 views
Relation $\mathrm{R}(\mathrm{at1},\mathrm{at2},\mathrm{at3})$ contains: $$\begin{array}{|c|c|c|} \hline \mathrm{at1} & \mathrm{at2} & \mathrm{at3} \\ \hline 12 & 15 & 510...
0 0 votes
1 1 answer
44
44 views
GO Classes asked 20 hours ago
44 views
A concert-ticket system contains $\mathrm{Sales}$ and $\mathrm{Payment}$.Relevant rules are:a row is placed in $\mathrm{Sales}$ when a purchase application is made; if pa...
2 2 votes
1 1 answer
41
41 views
GO Classes asked 20 hours ago
41 views
Consider the relation: $$\begin{array}{c}\mathbf{EmployeeQualification} \\[4pt]\begin{array}{|c|c|}\hline\mathrm{EmployeeCode} & \mathrm{Qualification} \\\hline\mathrm{S0...
1 1 vote
1 1 answer
47
47 views
GO Classes asked 23 hours ago
47 views
Consider the following tables.The following SQL query is executed:SELECT AVG(TotalSales) AS AverageSales FROM Product LEFT OUTER JOIN ProductSales ON Product.ProductCode ...