Q:

Write a postgre SQL statement to rename the table countries to country_new

0

. Write a  postgre SQL statement to rename the table countries to country_new.

Here is the list of tables.

   tablename   | tableowner
---------------+------------
 orders        | postgres
 employees     | postgres
 job_history   | postgres
 jobs          | postgres
 locations     | postgres
 regions       | postgres
 countries     | postgres
(7 rows)

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

ALTER TABLE countries RENAME TO country_new;

Output:

Now, after execute the command see the list of tables.

   tablename   | tableowner
---------------+------------
 orders        | postgres
 employees     | postgres
 job_history   | postgres
 jobs          | postgres
 locations     | postgres
 regions       | postgres
 country_new   | postgres
(7 rows)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now