Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



SI Stud name Subject Marks Pass/Fail 1 Sham Maths 40 P 1 Sham Physics 50 P 1 Sham Bio 20 F 2 R..

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

SI Stud name Subject Marks Pass/Fail 1 Sham Maths 40 P 1 Sham Physics 50 P 1 Sham Bio 20 F 2 R..

Answer / guest

Select Stud_name
From Student_Table
Where Pass_Fail = P
Group by SI

Is This Answer Correct ?    6 Yes 19 No

Post New Answer

More DB2 Interview Questions

How are write I/Os from the buffer pool executed?

1 Answers  


What is the use of value function?

0 Answers  


Write a query to extract first 5 characters of a name in the column Stud_Name?

1 Answers   RBS,


how to resolve -818 error. how to see timestamp token in load module and plan

4 Answers   IBM,


Where besides the DB2 catalog is database object information stored by DB2?

1 Answers  


What is the use of runstats in db2?

0 Answers  


What are foreign keys?

1 Answers  


What is cloudant database?

0 Answers  


What is sqlca’s maximum length?

0 Answers  


What is the function of buffer manager?

1 Answers  


What are the levels of isolation available with DB2V4

2 Answers   IBM,


What is a page?

2 Answers  


Categories