SQL Session for Beginners:
In this part of SQL Series where we will cover the following topic:
Under SQL Basics we will see –
NOT NULL – This ensures that a column cannot have a NULL value
UNIQUE – This ensures that all values in a column are different
Now, when we define a PRIMARY KEY we say it is a combination of a NOT NULL and UNIQUE. Hence, uniquely identifies each row in a table
Similarly, FOREIGN KEY uniquely identifies a row/record in another table
CHECK - This ensures that all values in a column satisfy a specific condition