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 .
Answer Posted / 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 |
Post New Answer View All Answers
How can the firstname and the lastname from the emp table be concatenated to generate complete names?
When do you specify the isolation level?
What is the physical storage length of date data type?
What is the result of open cursor statement?
What is db2 connect?
What is the use of value function?
Comment whether dclgen is mandatorily used. If not, then what is the point of using it?
What is coalesce in db2?
List out the three types of page locks that can be held.
List down the types of triggers in the db2 database?
Which are the db2 tools to protect integrity of the database?
Are views updateable?
Explain dclgen.
Explain what are the various isolation levels possible?
While unloading huge amount of data from table. Suddenly job failed some error. Imagine 1M data unloading, In that 90% data unloaded only 10% left, So if want to unload the rest 10% what needs to be done? Whether do i need to start from top or anything ?