Answers for "SQL create a new table"

SQL
25

how to create table in sql

# Creates a Simple User table
# Uses an auto-incrementing primary key as userId 

CREATE TABLE user (
    userId INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(100),
    password VARCHAR(100) 
) ENGINE=InnoDB;
Posted by: Guest on March-02-2020
62

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');
Posted by: Guest on February-21-2020
3

SQL create a new table

CREATE TABLE table_name
(
column1 TYPE [COLUMN CONSTRAINTS],
column2 TYPE [COLUMN CONSTRAINTS],
column3 TYPE [COLUMN CONSTRAINTS],
[TABLE CONSTRAINTS...]
);
Posted by: Guest on January-09-2021
2

how to create a table in sql

CREATE TABLE Persons
(
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255), 
City varchar(255) 
);
Posted by: Guest on May-25-2021
3

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
)
Posted by: Guest on May-20-2020
0

create table

CREATE TABLE fact (
id SERIAL PRIMARY KEY NOT NULL,
type VARCHAR(255),
text TEXT
);
Posted by: Guest on November-17-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language