Skip to main content

SQL CREATE TABLE Statement

Body

After you create a database using the CREATE Database statement, you can now create a table. Table is where you store your data in your database.

SQL CREATE TABLE Syntax

CREATE TABLE table_name ( column_name1 data_type, column_name2 data_type, column_name3 data_type, .... )

Example # 1

CREATE TABLE Users ( Firstname text, Lastname text, Salary float, DeptID int )

Users

Firstname Lastname Salary DeptID

This command will create an empty table with named "Users" and the data types for each column. Now we can populate the table by using SQL INSERT statements.

Add new comment