33.4k views
2 votes
(6-7) Question 1: Use a create table statement to create a new copy of the 1_employees table, with a new name of course. Then use an insert statement with a select clause to copy all the data from the 1_employees table to your new copy of the table. create table copy_of_employees as select EMPLOYEE_ID, FIRST_NAME, LAST_NAME, DEPT_CODE, HIRE_DATE, CREDIT_LIMIT, PHONE_NUMBER, MANAGER_ID from l_employees; INSERT INTO copy_of_employees SELECT * FROM l_employees; SELECT * FROM copy_of_employees;

1 Answer

2 votes

Answer:

The SQL query is used to create a copy of a table like the 1_employee table in the SQL database.

Step-by-step explanation:

create table copy_of_employees as select EMPLOYEE_ID, FIRST_NAME, LAST_NAME, DEPT_CODE, HIRE_DATE, CREDIT_LIMIT, PHONE_NUMBER, MANAGER_ID from l_employees;

INSERT INTO copy_of_employees SELECT * FROM l_employees;

SELECT * FROM copy_of_employees;

This SQL creates a table called copy_of_employees and copies the selected query of the 1_employees table and inserts it to the newly created table.

User Igino Boffa
by
4.9k points