CREATE TABLE

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)
);

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn SQL on Codecademy