CREATE TABLE

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)
);
Edit this page on GitHub

Contributors

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

Learn SQL on Codecademy

Edit this page on GitHub

Contributors