SQL Interview: 2: NULL and NOT NULL when defining Columns in Tables
This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.
Section: Development Level: Medium
Question:
When you are writing a CREATE TABLE statement to define a new table, after each column, you can write NULL or NOT NULL, but doing that is optional.
Why is it a good practice to include it, and what happens if you leave it out?
2021-03-25