Create Table in Postgres

To create table in PostgreSQL “CREATE TABLE” command is used :

SYNTAX:

CREATE TABLE table_name(
   column1 datatype,
   column2 datatype,
   .....
   columnN datatype,
   PRIMARY KEY( one or more columns )
);

EX :

create table student
(id integer primary key,
name character varying(25) ,
age integer ,
gender character(1)
);

Leave a Reply

Your email address will not be published. Required fields are marked *