Consider the following tables (relations):
Students:
|
Roll-No |
Name |
|
18CS101 |
Ramesh |
|
18CS102 |
Mukesh |
|
18CS103 |
Ramesh |
Performance:
|
Roll-No |
Course |
Marks |
|
18CS101 |
DBMS |
60 |
|
18CS101 |
Compiler Design |
65 |
|
18CS102 |
DBMS |
80 |
|
18CS103 |
DBMS |
85 |
|
18CS102 |
Compiler Design |
75 |
|
18CS103 |
Operating System |
70 |
Primary keys in the tables are shown using Underline. Now, Consider the following query:
SELECT S.Name, Sum (P.Marks)
FROM Students S, Performance P
WHERE S.Roll-No = P.Roll-No
GROUP BY S.Name
The number of rows returned by the above query is
1
3
2
2
3
0
4
1