retagged by
1,078 views
4 votes
4 votes

Consider the following three SQL queries (Assume the data in the people table) :
(a) Select Name from people where Age>25;
(b) Select Name from people where Height>195;
(c) Select Name from people where (Age>25) or (Height>195);
If the SQL queries (a) and (b) above, return 12 rows and 8 rows in the result set respectively, then what is one possible number of rows returned by the SQL query (c) ?

A.    3
B.    7
C.    10
D.    21

E.    None

retagged by

1 Answer

Best answer
6 votes
6 votes

Ans- E .None 

(a) Select Name from people where Age>25  -                                                          12 rows
(b) Select Name from people where Height>195                                                      8 rows.
(c) Select Name from people where (Age>25) or (Height>195)

                     Min - 12  rows.  ( when each people of age > 25 has height > 195)

                     Max - 12+8= 20 rows.  ( When both are disjoint ... or when each people of age >25 has height <=195).

selected by

Related questions

1 votes
1 votes
1 answer
2
Shubhanshu asked Dec 24, 2018
1,322 views
According to me it should be – “Retrieve the names of all students with a lower rank, than all students with age < 18 ”
0 votes
0 votes
1 answer
3
Na462 asked Jun 29, 2018
861 views
0 votes
0 votes
0 answers
4
Tuhin Dutta asked Dec 15, 2017
413 views
Student tableROLLNONAMEMARKS1MARKS21T50302S70993DNULL10NULLNULL78NULLNULLNULLNULLNULLa) select count(MARKS1) from student;b) select count(*) from student;