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

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+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

- All categories
- General Aptitude 1.8k
- Engineering Mathematics 7.3k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.6k
- Others 1.8k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,362 questions

55,786 answers

192,410 comments

90,919 users