NOT NULL is a fundamental integrity constraint defined at either column level or table level. When a column is declared NOT NULL, the database rejects any INSERT or UPDATE that attempts to put a NULL into the column. The constraint is enforced immediately unless the transaction is rolled back. Because PRIMARY KEY implicitly includes NOT NULL, adding NOT NULL to a primary-key column is redundant but harmless. Dropping or adding NOT NULL on an existing column requires that existing data already satisfy (or be cleaned to satisfy) the rule, otherwise the DDL fails. Some engines let you defer enforcement until commit, but most enforce it row-by-row. NOT NULL does not prevent empty strings in text columns, and does not auto-fill a default value unless DEFAULT is separately specified.
NULL, IS NULL, UNIQUE, PRIMARY KEY, CHECK, DEFAULT, FOREIGN KEY
SQL-86 (first ANSI SQL standard)
NOT NULL is a rule that forbids NULLs in a column, while NULL is simply a marker meaning “no value.”
Not until the NULLs are removed or replaced. Otherwise the ALTER TABLE statement errors out.
No. You must explicitly add a PRIMARY KEY or UNIQUE constraint or create an index if you need one.
Use `ALTER TABLE table_name ALTER COLUMN column_name DROP NOT NULL;` (syntax varies slightly by dialect).