1.3k views

Consider the following three SQL queries (Assume the data in the people table):

1. Select Name from people where Age>21;
2. Select Name from people where Height>180;
3. Select Name from people where (Age>21) or (Height>180);

If the SQL queries a and b above, return 10 rows and 7 rows in the result set respectively, then what is one possible number of rows returned by the SQL query c?

1. 3
2. 7
3. 10
4. 21

retagged | 1.3k views

When set a and set b all rows are distinct ans would be = 10+7 = 17

When set b is subset of set a than

10+7-7 = 10

Only these two options are preferable...
by Boss (25.4k points)
0
answer can be 17 also but since 10 is given only so choose 10 rt?
0
Ans should be between 10 to 17 both inclusive
0
if and  replace OR then 0-7

Option C

Name from people where Age>21=10

Name from people where Height>180=7

then those who have Age>21 and Height>180 will be (intersection) =7 names, which are included in query(a) output=10, then remaining names out of 10 will be 3 names that does not satisfy both condition but first condition.

therefore 7+3=10

by (457 points)

1
2