Column constraints - NOT NULL and UNIQUE

Combining constraints

Let’s say we want to create a new table books, and want the names of books to be both unique and not-null.

In this case, we need to combine constraints on the name column.

To combine constraints, we just need to mention them one next to another, against the column name and data type.

Try the two different set of SQL statements to check if both constraints work.