1,804 views
3 votes
3 votes

Consider the following relation instance myTable

num1 num2
100 100
100 NULL
NULL 100
NULL NULL


 



Query 1:

SELECT *

FROM myTable

WHERE num1 = 100;


Query 2:

SELECT *

FROM myTable

WHERE num1 <> 100;



If Query 1 returns p tuples and Query 2 returns q tuples, then 10p+q will be  _____________

4 Answers

1 votes
1 votes
20??
0 votes
0 votes
The first query returns 2 tuples so p = 2 and the second query returns 0 tuples because num1 <> 100 doesn’t return the row which has num1 value as NULL because we can’t compare the NULL values like this it results in  unknown so q = 0,

so final answer we get is 20.

Related questions

2 votes
2 votes
0 answers
2
iita asked Feb 5, 2017
1,086 views
A) 3B) 2C) 1D) 0
0 votes
0 votes
2 answers
3
shikharV asked Dec 8, 2015
564 views
ABC52110NULL21523In the above relation T the output of query:select * from T group by B;ABC10NULL2521Can anyone explain why this is the output?
1 votes
1 votes
3 answers
4
sh!va asked Feb 8, 2017
1,192 views
Consider the following relation instance myTablenum1num2100100100NULLNULL100NULLNULL Query 1:SELECT *FROM myTableWHERE num1 != NULL;Query 2:SELECT *FROM myTableWHERE num1...