Write a postgre SQL statement to create a duplicate copy of countries table, including structure and data by name dup_countries.
CREATE TABLE dup_countries AS SELECT * FROM countries;
Output:
postgres=# CREATE TABLE dup_countries postgres-# AS SELECT * postgres-# FROM countries; SELECT 0
Here is the command to see the structure of the created table :
postgres=# \d dup_countries Table "public.dup_countries" Column | Type | Modifiers --------------+-----------------------+----------- country_id | character varying(3) | country_name | character varying(45) | region_id | numeric(10,0) |
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Output:
Here is the command to see the structure of the created table :