Postgres DBA · Lesson 19

Rename Table in Postgresql

-> To rename already existing table Syntax: ALTER TABLE table_name RENAME to new_table_name; Eg: Alter table attribute rename to attribute1; -> To rename a column in table ALTER TABLE attribute RENAME COLUMN attribute_id TO attr_id;

connected · blinksql_demo

-> To rename already existing table
Syntax:
ALTER TABLE table_name RENAME to new_table_name;
Eg:
Alter table attribute rename to attribute1;
-> To rename a column in table
ALTER TABLE attribute RENAME COLUMN attribute_id TO attr_id;

Practice — AI-generated for this lesson

Write a query that shows each order status and how many orders have it — but only statuses with more than 1 order.