• We just launched and are currently in beta. Join us as we build and grow the community.

SQL CREATE TABLE Statement

sandoukhan

Crypto Gaming Pro
S Rep
0
0
0
Rep
0
S Vouches
0
0
0
Vouches
0
Posts
125
Likes
16
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
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

  1. CREATE

    TABLE

    TABLE_NAME
  2. (
  3. column_name1 data_type,
  4. column_name2 data_type,
  5. column_name3 data_type,
  6. ....
  7. )

Example # 1

  1. CREATE

    TABLE

    Users
  2. (
  3. Firstname text,
  4. Lastname text,
  5. Salary FLOAT

    ,
  6. DeptID INT
  7. )

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.

 

452,292

323,526

323,535

Top