PostgreSQL Insert Record: Insert one row into a table against the specific column country_name

2. Write a SQL statement to insert one row into the table countries against the column country_id and country_name.

Here in the following is the structure of the table countries.

    Column    |         Type          | Modifiers
 country_id   | character varying(2)  |
 country_name | character varying(40) |
 region_id    | numeric(10,0)         |

Sample Solution:


INSERT INTO countries (country_id,country_name) VALUES('C2','USA');

Here is the command to see the list of the inserting rows :

postgres=# SELECT * FROM countries;
 country_id | country_name | region_id
 C1         | India        |      1002
 C2         | USA          |

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

What is the difficulty level of this exercise?

New Content: Composer: Dependency manager for PHP, R Programming