@saket you missed out something ..lets take an example...
studid |
name |
sex |
1 |
a |
f |
2 |
b |
f |
3 |
c |
m |
4 |
d |
m |
here if apply inner most query which gives studid whichhave sex =female so we get id no {1,2).,now cross product between {1,2}and course id {c1,c2} which gives four tuple
stuid |
course id |
1 |
c1 |
1 |
c2 |
2 |
c1 |
2 |
c2 |
enroll table
stdid |
course id |
1 |
c1 |
1 |
c2 |
3 |
c1 |
4 |
c2 |
2 |
c1 |
now we have to perform intermediate table which gives crosse product of female id and course id - enroll which gives {2,c2} so c2 is course id which is not enrolled by id no 2 female so we can se option b is correct...
now c is wrong becoz each course should be enrolled by atleast one m and f. and option a will be correct if we get c1 course id which is enrolled by all female but we get course id c2 from above query so only option b is correct...