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 |
What is the physical storage length of time data type?
Hi Dude,this is Ram.could any one tell me aboue CURRENT OF clause in DB2. Thanks in advance.......
Why select is not preferred in embedded sql programs?
Can there be more than one cursor open for any program?
what is the steps followed in EXPLAIN Process or EXPLAIN command. (Explain is for identifying the optimized access path but how or what is the steps for doing the EXPLAIN)
Which component is used to execute the sql statements?
What is normalization and what are the five normal forms?
wht is d/f between union and joins ?
what is parm utility
1. what if null values retrived from database and no null indicator mentioned in query. What is sql code.
in the CURSOR declare statement, if i am using an where clause and trying to compare the value with a host-varialble. EXEC SQL DECLARE C1 CURSOR FOR SELECT DEPTNO, DEPTNAME, MGRNO FROM DEPARTMENT WHERE ADMRDEPT = :ADM-DEPT Where would i need to provide value to this host-variable in the where clause. how could i pass value to this host-variable to check it.
What is an asychronous write?