Alter table add multiple columns to existing table

PostreSQL tutorial – Add multiple columns

Add multiple columns to existing table

How to add multiple columns to existing table. Alter syntax and example.

Syntax

ALTER TABLE table_name 
ADD COLUMN column_name data_type,
ADD COLUMN column_name data_type;

Create table

CREATE TABLE users(
userid numeric not null 
default nextval('seq_users'::regclass),
username varchar(100),
userpass varchar(250),
usermail varchar(50),
address varchar(1000)  
);    

Example Add multiple columns

ALTER TABLE users 
ADD COLUMN first_name varchar(100), 
ADD COLUMN last_name varchar(100);

Alter table |
Drop table