Home›Learn›SQL›DEFAULT Constraint
SQL Master CourseBeginner Friendly

DEFAULT Constraint

Learn how DEFAULT provides a value when one is not supplied.

📘 Chapter 41 / 51⏱️ 8–10 Min Read🎯 Beginner Friendly
Course Progress80%

Course Progress

80%

41 / 51 chapters

📖

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?