Professional Documents
Culture Documents
Example:
Create Table:
create table orders(orderno serial, flightname varchar(100),boarding varchar(100),status
varchar(100),source varchar(100));
Insert Records:
---------+------------+----------+--------+-----------
(5 rows)
Update Parent:
UPDATE 5
---------+------------+----------+-----------+-----------
(5 rows)
nano=# rollback;
ROLLBACK
---------+------------+----------+--------+-----------
(5 rows)
nano=# update only orders set status='Cancelled';
UPDATE 1
---------+------------+----------+-----------+-----------
(5 rows)
Delete:
nano=# delete from orders;
DELETE 5
---------+------------+----------+--------+--------
(0 rows)
nano=# rollback;
ROLLBACK
---------+------------+----------+--------+--------
(0 rows)
Drop Table:
nano=# drop table orders;
HINT: Use DROP ... CASCADE to drop the dependent objects too.
DROP TABLE
DELETE 5
---------+------------+----------+--------+--------
(0 rows)
nano=# rollback;
ROLLBACK
---------+------------+----------+--------+--------
(0 rows)
nano=# drop table orders;
HINT: Use DROP ... CASCADE to drop the dependent objects too.
DROP TABLE