📖
Theory
Understand the concept step by step
The DEFAULT constraint specifies a value that can be used when an INSERT statement does not provide a value for the column.
💻
Example
See how the concept works in SQL
SQL
CREATE TABLE users (
id INT,
status VARCHAR(20) DEFAULT 'active'
);📤
Output
Understand what the query produces
If status is not supplied, the default value active can be used.
📝
Practice
Test your understanding
Create a table with a default status value.
❓
MCQs
Check your SQL knowledge
What is the main concept covered in DEFAULT Constraint?
A.Provides a value when one is not supplied
B.Prevents duplicate values
C.Creates a relationship
D.Deletes NULL values
💼
Interview Questions
Prepare for SQL interviews
1
Interview Question
What is DEFAULT?
2
Interview Question
When is a default value used?
3
Interview Question
Can a DEFAULT value be changed later?