A relational database contains two tables Student and Performance as shown below:
$$\overset{\text{Table: student}}{\begin{array}{|l|l|} \hline \text{Roll_no} & \text{Student_name}\\\hline 1 & \text{Amit} \\\hline 2 & \text{Priya} \\\hline 3 & \text{Vinit} \\\hline 4 & \text{Rohan} \\\hline 5 & \text{Smita} \\\hline \end{array}} \qquad\overset{\text{Table: Performance}}{\begin{array}{|l|l|l|} \hline \text{Roll_no} & \text{Subject_code} & \text{Marks}\\\hline 1 & \text{A} & 86 \\\hline 1 & \text{B} & 95 \\\hline 1 & \text{C} & 90 \\\hline 2 & \text{A} & 89 \\\hline 2 & \text{C} & 92 \\\hline 3 & \text{C} & 80 \\\hline \end{array}}$$
The primary key of the Student table is Roll_no. For the performance table, the columns Roll_no. and Subject_code together form the primary key. Consider the SQL query given below:
SELECT S.Student_name, sum(P.Marks) FROM Student S, Performance P WHERE P.Marks >84 GROUP BY S.Student_name;
The number of rows returned by the above SQL query is ________
SELECT s.student_name, sum(p.marks) FROM student s, performance P WHERE p.marks>84 GROUP BY s.student.name
@Sharad Shukla 5 can you tell me what am I missing here?
@Ahabnnc @Deepanshu
What is answer for inherited sttribute ques ?? Q 53 And what is answer for GA question on directions ?? Q7
now group by
Reenakhanna That is on natural join, here cross product is considered as join condition is not given.
@Shaik Masthan sir,
SELECT S.Student_name, sum(P.Marks) -----> 4.Display
FROM Student S, Performance P ------> 1. Cross product
WHERE P.Marks >84 ------> 2. Conditon check
GROUP BY S.Student_name; -----> 3.group By
@Manoj Kumar Pandey
select * from (A join B on C1=C2) -------> means projection on naturnal join (selection on cross product)
select * from A, B ---> means projection on cross product then projection on that
64.3k questions
77.9k answers
244k comments
80.0k users