SQL CREATE TABLE — Basic UsageIT technician command center
Database · SQL and Database Administration

SQL CREATE TABLE — Basic Usage

Use SQL CREATE TABLE for a standard administrative task.

Copy-ready commandSQL CREATE TABLE — Basic Usage
CREATE TABLE audit_log (id BIGINT PRIMARY KEY AUTO_INCREMENT, event VARCHAR(255), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
Production warning

INSERT, UPDATE, DELETE, ALTER, and restore operations can modify or remove data.

Requirements and permissions

Requirements
Appropriate database client and connection
Permissions
Database privileges vary
Last reviewed
2026-07-31

Examples

Basic Usage

Use SQL CREATE TABLE for a standard administrative task.

CREATE TABLE audit_log (id BIGINT PRIMARY KEY AUTO_INCREMENT, event VARCHAR(255), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);

Original command

Create a table.

CREATE TABLE audit_log (id BIGINT PRIMARY KEY AUTO_INCREMENT, event VARCHAR(255), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);

Common errors

Command not found

Confirm Appropriate database client and connection is installed and available in your current shell.