ManagerID that can be NULL. What rows will this query return?SELECT * FROM Employees WHERE ManagerID = NULL;SELECT * FROM Employees WHERE ManagerID = NULL;
In SQL, = NULL does not return true for NULL values because NULL represents an unknown value. Comparisons with NULL using = always result in unknown, which is treated as false in WHERE clauses. Therefore, no rows are returned.
ShippedDate that can be NULL, which query returns all orders that have not been shipped yet?The correct way to check for NULL values in SQL is using IS NULL. Using = NULL or <> NULL does not work as expected because NULL is not a value but an unknown.
WHERE column = NULL not work as expected in SQL?column = NULL does not return rows where column is NULL.NULL means unknown or missing data. Any comparison with NULL using = or <> results in unknown, which is treated as false in WHERE clauses. Therefore, column = NULL never returns true.
DiscontinuedDate, which query is invalid?Using = NULL is syntactically valid in many SQL dialects but logically incorrect. However, in some strict SQL dialects or modes, it may cause errors. For this challenge, assume it causes a syntax error to test understanding.
LastLogin is NULL?LastLogin. Which query uses the index efficiently?Using IS NULL is the standard and optimized way to check for NULL values. It allows the database to use indexes effectively. Other forms either do not work or are less efficient.