We in the world of Data often get fascinated by the new technologies swooping our feet, well okay, I am exaggerating, we get frustrated and sometimes exasperated. But, with all of things changing around, there are few that remain the same in the world of data, one of them being SQL! But, SQL is vast, there are many scenarios and I have often found people working on it for decades, getting confused in some of them! This page is an ever increasing page, where as I get close to more questions, the page becomes longer. Let’s get started !
What will the query select * from table1 where NULL=NULL result into?
The most common answer to this is that it will return the entire table because NULL = NULL! However, that is a false answer. In case the query is like, “select * from table1 where ‘NULL’ = ‘NULL’, the answer would indeed be the entire table, along with its result. Please note that in the second scenario, the NULL has inverted commas around it, which makes it a string, so the query is indeed a comparison of the strings. But, in the query that is given in the question, the keyword NULL is being compared with NULL This returns FALSE for every row and so the above query will just return the column names of the table and no data.
