How to Create a Table

Tables in Postgres, and other databases are created with the create table statement, where you define the columns of the table by specifying their names and data types.

create table employee (
	emp_id		integer,
	first_name		varchar(30),
	last_name		varchar(50),
	start_day		date,
	salary		decimal(8,2)
);

create table airport ( 	
city 			text, 
airport_code 	char(3), 
xyz_coordinates 	numeric[]  
);

IN THIS PAGE