postgres=# \c shafeen; You are now connected to database "shafeen" as user "postgres". shafeen=# create table customer(cust_no varchar(5),cust_name varchar(15),age int phone varchar(10 shafeen(# )); ERROR: syntax error at or near "phone" LINE 1: ...(cust_no varchar(5),cust_name varchar(15),age int phone varc... ^ shafeen=# create table customer(cust_no varchar(5),cust_name varchar(15),age int, phone varchar(10 )); CREATE TABLE shafeen=# insert into customer values(100,'amal',18,221930); INSERT 0 1 shafeen=# insert into customer values(101,'mithilaj',21,221930); INSERT 0 1 shafeen=# insert into customer values(101,'arun',20,221930); INSERT 0 1 shafeen=# insert into customer values(101,'hanna',20,22930); INSERT 0 1 shafeen=# insert into customer values(101,'shahnaa',20,2223930); INSERT 0 1 shafeen=# select * from customer; cust_no | cust_name | age | phone ---------+-----------+-----+--------- 100 | amal | 18 | 221930 101 | mithilaj | 21 | 221930 101 | arun | 20 | 221930 101 | hanna | 20 | 22930 101 | shahnaa | 20 | 2223930 (5 rows) shafeen=# drop customer; ERROR: syntax error at or near "customer" LINE 1: drop customer; ^ shafeen=# delete customer; ERROR: syntax error at or near "customer" LINE 1: delete customer; ^ shafeen=# drop *from customer; ERROR: syntax error at or near "*" LINE 1: drop *from customer; ^ shafeen=# drop * from customer; ERROR: syntax error at or near "*" LINE 1: drop * from customer; ^ shafeen=# select * from customer; cust_no | cust_name | age | phone ---------+-----------+-----+--------- 100 | amal | 18 | 221930 101 | mithilaj | 21 | 221930 101 | arun | 20 | 221930 101 | hanna | 20 | 22930 101 | shahnaa | 20 | 2223930 (5 rows) shafeen=# alter table customer add(d_birth date); ERROR: syntax error at or near "(" LINE 1: alter table customer add(d_birth date); ^ shafeen=# alter table customer add (d_birth date); ERROR: syntax error at or near "(" LINE 1: alter table customer add (d_birth date); ^ shafeen=# alter table customer add birth date; ALTER TABLE shafeen=# select * from customer; cust_no | cust_name | age | phone | birth ---------+-----------+-----+---------+------- 100 | amal | 18 | 221930 | 101 | mithilaj | 21 | 221930 | 101 | arun | 20 | 221930 | 101 | hanna | 20 | 22930 | 101 | shahnaa | 20 | 2223930 | (5 rows) shafeen=# create table cust_phone as (select cust_name ,phone from custome); ERROR: relation "custome" does not exist LINE 1: ... table cust_phone as (select cust_name ,phone from custome); ^ shafeen=# create table cust_phone as (select cust_name ,phone from customer); SELECT 5 shafeen=# select * from cust_phone; cust_name | phone -----------+--------- amal | 221930 mithilaj | 221930 arun | 221930 hanna | 22930 shahnaa | 2223930 (5 rows) shafeen=# alter table customer drop (age); ERROR: syntax error at or near "(" LINE 1: alter table customer drop (age); ^ shafeen=# alter table customer drop age; ALTER TABLE shafeen=# select * from customer; cust_no | cust_name | phone | birth ---------+-----------+---------+------- 100 | amal | 221930 | 101 | mithilaj | 221930 | 101 | arun | 221930 | 101 | hanna | 22930 | 101 | shahnaa | 2223930 | (5 rows) shafeen=# alter table customer modify (cust_name varchar(25)); ERROR: syntax error at or near "modify" LINE 1: alter table customer modify (cust_name varchar(25)); ^ shafeen=# alter table customer modify cust_name varchar(25); ERROR: syntax error at or near "modify" LINE 1: alter table customer modify cust_name varchar(25); ^ shafeen=# alter table customer alter column cust_name type varchar(25); ALTER TABLE shafeen=# select * from customer; cust_no | cust_name | phone | birth ---------+-----------+---------+------- 100 | amal | 221930 | 101 | mithilaj | 221930 | 101 | arun | 221930 | 101 | hanna | 22930 | 101 | shahnaa | 2223930 | (5 rows) shafeen=# delete from customer; DELETE 5 shafeen=# select * from customer; cust_no | cust_name | phone | birth ---------+-----------+-------+------- (0 rows) shafeen=# alter table customer rename to cust; ALTER TABLE shafeen=# select * from customer; ERROR: relation "customer" does not exist LINE 1: select * from customer; ^ shafeen=# select * from cust; cust_no | cust_name | phone | birth ---------+-----------+-------+------- (0 rows) shafeen=# drop table cust; DROP TABLE shafeen=# select * from cust; ERROR: relation "cust" does not exist LINE 1: select * from cust;