SQL default values

SQL default values

Today, when I was working with my teammate, I noticed, that they had some more information in the schema, than I am used to. I am used to the column names and type, but they also had the default values and whenever the column can be NULL or NOT NULL.

If I want to add new column with these values set, I could do it with the below SQL statment (based on not mine PR):

ALTER TABLE table ADD column type NOT NULL DEFAULT 'default value';

I could probably do something similar, when either changing the column or creating a table.

This was seen on the MySQL database.