Database Tutorial

Connecting to Server

  hostname =
  username = group1/group2
  port = 22

Connecting to Database

psql -U username -d database_name

Postgres Commands

SQL Cheat Sheet


SQL Commands

create table your_first_name (key int, attr varchar(20),value float);
 insert into your_first_name values(1, 'attr0', 100);
 insert into your_first_name values(2, 'attr2', 101);
update your_first_name set attr='attr1' where key=1;
select * from your_first_name;
select * from your_first_name where attr='attr1';
select * from your_first_name where attr='attr0';
delete from your_first_name where key=1;