Working with NOT NULL, UNIQUE, and DEFAULT

Published July 26, 2025 By Sai Sree Ram Gundepudi

NOT NULL

CREATE TABLE books (title VARCHAR(255) NOT NULL);

UNIQUE

CREATE TABLE employees (email VARCHAR(255) UNIQUE);

DEFAULT

CREATE TABLE users (status VARCHAR(10) DEFAULT 'active');

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article