9951 explained code solutions for 126 technologies


postgresCreate Table


CREATE TABLE person (
	pid BIGSERIAL NOT NULL PRIMARY KEY,
	first_name VARCHAR(50) NOT NULL,
	last_name VARCHAR(50) NOT NULL,
	email VARCHAR(150),
	gender VARCHAR(15) NOT NULL,
	date_of_birth DATE NOT NULL,
	country_of_birth VARCHAR(50)
);ctrl + c
CREATE TABLE

creates specified table

person

name of the table to create

pid

name of the column

BIGSERIAL NOT NULL

type definition

PRIMARY KEY

make this column primary key