Snippets / SQL / Create Table

CREATE TABLE

By Marcelo Fernandes Aug 8, 2017


CREATE TABLE customer
(
 customer_id serial,
 title char(4),
 fname varchar(32),
 lname varchar(32) not null,
 addressline varchar(64),
 town varchar(32),
 zipcode char(10) not null,
 phone varchar(16)
 CONSTRAINT customer_pk PRIMARY KEY(customer_id)
);

INSERT INTO customer(title, fname, lname, addressline, town, zipcode, phone)
 VALUES('Mr','Neil','Matthew','5 Pasture Lane','Nicetown','NT3 7RT','267 1232');

INSERT INTO customer(title, fname, lname, addressline, town, zipcode, phone)
 VALUES('Mr','Richard','Stones','34 Holly Way','Bingham','BG4 2WE','342 5982');



Notes