What does the final query return?
-- SQLite / PostgreSQL CREATE TABLE u (email TEXT UNIQUE); INSERT INTO u VALUES (NULL); INSERT INTO u VALUES (NULL); SELECT COUNT(*) FROM u;
- Error on insert
- 2
- 0
- 1
NULLs are not equal to each other, so a standard
Play SQL & Databases ▸
UNIQUE constraint accepts any number of them.