SI Stud name Subject Marks Pass/Fail
1 Sham Maths 40 P
1 Sham Physics 50 P
1 Sham Bio 20 F
2 Ram Maths 40 P
2 Ram Physics 50 P
2 Ram Bio 60 P
For the above data , write the SQL query for the student who passed in all the subjects . For eg : I want the data of only Ram coz he passed all subjects .
Answers were Sorted based on User's Feedback
Answer / ajmal
SELECT *
FROM STUDENT_TABLE
WHERE SI NOT IN
(SELECT DISTINCT SI
FROM STUDENT_TABLE
WHERE PASS_FAIL = 'F'
)
The inner query will retrieve all the SI numbers for who is failed in at least 1 subject(eg: Sham). The outer query will retrieve the other student's details(eg: Ram).
| Is This Answer Correct ? | 19 Yes | 0 No |
Answer / guest
Select Stud_name
From Student_Table
Where Pass_Fail = P
Group by SI
| Is This Answer Correct ? | 6 Yes | 19 No |
How to design maps
What is the maximum number of tables that can be stored on a Partitioned Table Space ?
where can we use index and subscript ? with example ?
PLAN IS EXECUTABLE AND PACKAGE IS NOT EXECUTABLE . THEN WHAT IS THE USE OF PACKAGE?
2 Answers Tech Mahindra, Wipro,
How to run db2 command in windows?
I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?
What is a Cartesian product?
what is the soft code for deadlock ?
What are union and union all?
how to resolve -811 error. give clear explination
Explain dclgen.
What is the difference between static and dynamic SQL?