📖
Theory
Understand the concept step by step
NOT NULL requires a column to have a value when a row is inserted or when the column is otherwise assigned a value subject to the database rules.
It is useful for fields that should not be missing.
💻
Example
See how the concept works in SQL
SQL
CREATE TABLE users (
id INT,
name VARCHAR(100) NOT NULL
);📤
Output
Understand what the query produces
The name column cannot be assigned NULL.
📝
Practice
Test your understanding
Create a table where name and email are required fields.
❓
MCQs
Check your SQL knowledge
What is the main concept covered in NOT NULL?
A.Prevents NULL values
B.Prevents duplicate values
C.Creates relationships
D.Sorts values
💼
Interview Questions
Prepare for SQL interviews
1
Interview Question
What does NOT NULL do?
2
Interview Question
Why is NOT NULL useful?
3
Interview Question
Can a NOT NULL column be left without a value during insertion?