Sql create a table

This article is tagged with: Sql create a table and mysql

SQL CREATE A TABLE

CREATE TABLE TestTable AS
SELECT customername, contactname
FROM
customers;

SQL CREATE A TABLE

CREATE TABLE new_table_name AS
   
SELECT column1, column2,...
    FROM
existing_table_name
    WHERE ....;

create table sql

# Simple table describing a vehicle
CREATE TABLE vehicle(
# vehicleId: Unique ID for Primary Key.
# This is how we will reference a record
vehicleId INT NOT NULL,
make VARCHAR(64), # String 64 chars max
model VARCHAR(128),
derivative VARCHAR(255),
PRIMARY KEY(vehicleId)
);
# Add a record
INSERT INTO vehicle VALUES(1000,'Volkswagen','Golf','1.5 TSI EVO Match Edition 5dr');

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
)

SQL CREATE A TABLE

CREATE TABLE Persons
(
   
PersonID int,
   
LastName varchar(255),
   
FirstName varchar(255),
   
Address varchar(255),
   
City varchar(255)
);

SQL CREATE A TABLE

CREATE TABLE table_name (
    column1 datatype,
    column2 datatype,
    column3 datatype,
  
....
);

This article is tagged with: Sql create a table and mysql