Why am i getting 'invalid use of null value' in sql?

Example:

INSERT INTO users (id, name) VALUES (NULL, 'John');

The column you're trying to insert a NULL value into might not allow NULL values.

Solution:

Provide a valid non-NULL value for the column or modify the table schema to allow NULL values for that column.


INSERT INTO users (id, name) VALUES (1, 'John');

Beginner's Guide to SQL