Yesterday’s Pop Quiz seemed quite popular, I got some personal responses and a couple of funny comments.
So here’s another one:
The table t is defined thusly on a MySQL server with no sql modes set:
CREATE TABLE t ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT );
You now do…
INSERT INTO t (id) VALUES (NULL); SELECT * FROM t WHERE id IS NULL
What will be the result of the SELECT?