IN THIS POST, I have explained how to write NOT NULL column “constraint” correctly. Before that, a NULL value means you have not supplied any value or un-known.
NOT NULL is a column constraint. So that you can control the value writes to a column in a Table.
Create Table Artist (artist_id int not null, dob date not null, salary int);
So the artist table does not allow null values for artist_id and dob. You must enter values.
Audio Post of SQL NOT NULL
The salary column is different, where it allows null values when you do not enter any amount.
Table Data of Artist
- NOT NULL is a column constraint
- Without values in the columns where NOT NULL defines, the SQL gives errors.
- By default, all the columns accept NULL values