Define a new table with columns and constraints.
Section: CREATE, ALTER, and DROP
Create table
sql
sql
CREATE TABLE users (
user_id INTEGER PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
created_at TIMESTAMP NOT NULL
);Explanation
Use explicit types and constraints to enforce data quality.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing CREATE, ALTER, and DROP