Can you show the instructions to reproduce dept_manager_dup table?
In this lesson, we refere to a duplicate of dept_manager_table name dept_manager_dup.
It includes null values and some new inserted values compared to the original dept_manager table.
Not sure if this was part of a previous exercise, but I don't recall having to create and modify the dept_manager_dup table.
Can you show the instructions to re-create this duplicate table with the null values and new content if any?
Thanks.
Francois
4 answers ( 0 marked as helpful)
Hi Francois!
Thanks for reaching out.
The duplicate table should be the same. So, the code for inserting records in the duplicate table is:
INSERT INTO departments_dup
(
dept_no,
dept_name
)
SELECT
*
FROM
departments;
Hope this helps.
Best,
Tsvetelin
This is for the wrong table. He's referred to the dept_manager table not the departments table. In Section 8, the code loaded in for the dept_manager table involves Not Null constraints for all fields
The dept_manager_dup creation is in the previous "Excerise" Section. You need to scroll the on-screen text to see "Task 2"
Hi Francois you can copy the code below to produce the dept_manager_dup table.
INSERT INTO
dept_manager_dup
( emp_no,
dept_no,
from_date,
to_date )
SELECT*FROM
dept_manager;
INSERT INTO
dept_manager_dup
SELECT * FROM
dept_manager;
INSERT INTO dept_manager_dup (emp_no, from_date)
VALUES (999904, '2017-01-01'),
(999905, '2017-01-01'),
(999906, '2017-01-01'),
(999907, '2017-01-01');
DELETE FROM dept_manager_dup
WHERE
dept_no = 'd001';
INSERT INTO departments_dup (dept_name)
VALUES ('Public Relations');
DELETE FROM departments_dup
WHERE
dept_no = 'd002';