Write a postgre sql statement to create the structure of a table dup_countries similar to countries.
CREATE TABLE dup_countries AS (SELECT * FROM countries) WITH NO DATA;
Output:
postgres=# CREATE TABLE dup_countries AS ( postgres(# SELECT * postgres(# FROM countries) postgres-# WITH NO DATA; 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 :