1 votes 1 votes Consider the following relation instance myTable num1 num2 100 100 100 NULL NULL 100 NULL NULL Query 1: SELECT * FROM myTable WHERE num1 != NULL; Query 2: SELECT * FROM myTable WHERE num1 = NULL; If Query 1 returns m tuples and Query 2 returns n tuples, then 10m+n will be _____________ Databases databases sql + – sh!va asked Feb 8, 2017 sh!va 1.2k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply vishwa ratna commented Feb 8, 2017 reply Follow Share query 2 should throw error as we cant use simply null , we have keyword for it , i.e isnull. SELECT * FROM myTable WHERE Address IS NULL The above is correct query. Edit: How can we test for NULL values? It is not possible to test for NULL values with comparison operators, such as =, <, or <>. so probbly your question is wrong. References: http://www.w3schools.com/sql/sql_null_values.asp 0 votes 0 votes sh!va commented Feb 8, 2017 reply Follow Share Tried this query in mySQL: create table gate2017 (id int, id2 int); INSERT INTO gate2017 VALUES (null,null); select * from gate2 where id=null; Working fine.. Please refer this also: https://en.wikipedia.org/wiki/Null_(SQL)#Controversy 0 votes 0 votes rohan mishra commented Jul 8, 2017 reply Follow Share Answer is 20 ?. 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes num1 != null and num1 = null are always false . So no rows will be selected by executing both the queries. 10*m+ n =0 Arnab Bhadra answered May 25, 2017 Arnab Bhadra comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes SQL allows queries that check whether an attribute value is NULL. Rather than using = or <> to compare an attribute value to NULL, SQL uses the comparison operators IS or IS NOT. This is because SQL considers each NULL value as being distinct from every other NULL value, so equality comparison is not appropriate. It follows that when a join condition is specified, tuples with NULL values for the join attributes are not included in the result (unless it is an OUTER JOIN). -From Navathe (7th edition, chapter 7). the.brahmin.guy answered May 25, 2017 the.brahmin.guy comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes NULL is not a value, and therefore cannot be compared to another value. where x is null checks whether x is a null value. where x = null is checking whether x equals NULL, which will never be true vishwa ratna answered Feb 8, 2017 vishwa ratna comment Share Follow See 1 comment See all 1 1 comment reply student2018 commented Sep 2, 2017 reply Follow Share what about query 1 x!=null Can m=4 ?? 0 votes 0 votes Please log in or register to add a comment.