SQL Create Table

SQL Create Table

The SQL command CREATE TABLE is used to create a database table.
A sql table needs a name and definition of columns and their datatypes.
The main types of a column can be numeric, int, char, varchar, date, time, decimal.

Create Table syntax

CREATE TABLE table_name (
column_name1 datatype,
column_name2 datatype,
column_name3 datatype,
...);

Create Table example

CREATE TABLE coder_books
(
ID INT PRIMARY KEY,
TITLE VARCHAR(150) NOT NULL,
PRICE NUMERIC,
DESCRIPTION VARCHAR(255)
);