answer can be 17 also but since 10 is given only so choose 10 rt?

The Gateway to Computer Science Excellence

+2 votes

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

- Select Name from people where Age>21;
- Select Name from people where Height>180;
- 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?

- 3
- 7
- 10
- 21

+3 votes

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...

When set b is subset of set a than

10+7-7 = 10

Only these two options are preferable...

0 votes

**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

52,218 questions

59,890 answers

201,084 comments

118,128 users