CREATE TABLE

Anonymous contributor's avatar
Anonymous contributor
Published May 7, 2021Updated Jun 25, 2022
Contribute to Docs

The CREATE TABLE command creates a new table within a database.

Syntax

CREATE TABLE table_name (
  column_name column_definition,
  column_name column_definition,
  ...
);

Example

CREATE TABLE students (
student_id int,
last_name varchar(255),
first_name varchar(255),
local_address varchar(255),
home_of_record varchar(255),
major varchar(255),
overall_gpa decimal(3,2)
);

All contributors

Contribute to Docs

Learn SQL on Codecademy