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 |
Can you access the DB2 Directory table using SQL?
What does db2 blu stand for?
What is db2 stogroup?
In case if at some point of time db2 is down, would that impact the pre-compilation process of a db2-cobol program?
Which isolation level provides maximum concurrency?
Give the COBOL definition of a VARCHAR field.
What if , we failed to mentioed null indicator in sql select query , that may retrieve null value ?
On which levels locks can be applied?
What techniques will be used to avoid deadlock??
in my project..TEST is db2 8.1 version In PROD it is 7.1 if i do REORG in TEST.. can I use the same REORG jcl with out modification in PROD region (this is DB2 8.1 )? if not, what modification i need to do in my REORG control card?
When one binds a PACKAGE ( of a plan ) what package information is stored and where it is stored?
what is the sqlcode -501