create a new table code example
Example 1: SQL create a new table
CREATE TABLE table_name
(
column1 TYPE [COLUMN CONSTRAINTS],
column2 TYPE [COLUMN CONSTRAINTS],
column3 TYPE [COLUMN CONSTRAINTS],
[TABLE CONSTRAINTS...]
);
Example 2: sql table
CREATE TABLE utilisateur
(
id INT PRIMARY KEY NOT NULL,
nom VARCHAR(100),
prenom VARCHAR(100),
email VARCHAR(255),
date_naissance DATE,
pays VARCHAR(255),
ville VARCHAR(255),
code_postal VARCHAR(5),
nombre_achat INT
)
Example 3: create table
CREATE TABLE fact (
id SERIAL PRIMARY KEY NOT NULL,
type VARCHAR(255),
text TEXT
);