CREATE TABLE IF NOT EXISTS countries (
COUNTRY_ID varchar(2) NOT NULL,
COUNTRY_NAME varchar(40) NOT NULL,
REGION_ID decimal(10,0) NOT NULL
);
Output:
postgres=# CREATE TABLE IF NOT EXISTS countries (
postgres(# COUNTRY_ID varchar(2) NOT NULL,
postgres(# COUNTRY_NAME varchar(40) NOT NULL,
postgres(# REGION_ID decimal(10,0) NOT NULL
postgres(# );
CREATE TABLE
Here is the command to see the structure of the table, just created :
postgres=# \d countries;
Table "public.countries"
Column | Type | Modifiers
--------------+-----------------------+-----------
country_id | character varying(2) | not null
country_name | character varying(40) | not null
region_id | numeric(10,0) | not null
Output:
Here is the command to see the structure of the table, just created :