Define a rowid-backed table with primary key and timestamps.
Section: Create tables and constraints
Create a basic table
sql
sql
CREATE TABLE users (
id INTEGER PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
display_name TEXT,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);Explanation
`INTEGER PRIMARY KEY` aliases the rowid and is a common pattern for app tables.
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 tables and constraints