Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3. DATABASE PLEASE TYPE ANSWER Write the DML for the following: Updating a depar

ID: 3816206 • Letter: 3

Question

3. DATABASE PLEASE TYPE ANSWER

Write the DML for the following:

Updating a department manager.

Inserting a new employee, their salary, title, and department association.

Insert a new department.

Delete an employee.

salaries emp-no INT (10) salary INT(11 from date DATE to date DATE Indexes titles emp no INT(10 title VARCHAR(50) from date DATE to date DATE Indexes employees emp-no INT(10) LH birth date DATE first name VARCHAR(14) last name VARCHAR(16) gender ENUM (M', F) hire date DATE Indexes dept manager dept no CHAR(40 emp no INT(10) from date DATE to date DATE Indexes dept emp emp no INT(10) dept no CHAR(4) from date DATE to date DATE Indexes dept no CHAR(4) dept name VARCHAR(40) Indexes

Explanation / Answer

Hi ,

Greetings !!

Please see below step by step DML statemtents,

1. Updating a department manager

UPDATE dept_manager

SET from_date = 20032017 (DDMMYYYY format)

WHERE dept_no = ‘A001’

2. Inserting a new employee, their title, salaries and department association.

New employee inserted with one sample emp_no, which is used in other tables as key and subsequent key values are used in respective tables.

INSERT into employees values (1005233409, 20071988, ‘David’, ‘Warner’, ‘M’, 25102010)

INSERT into salaries (salary, from_date, to_date) values (00000050000, 20102009, 20102040) where emp_no = 1005233409

INSERT into titles (title, to_date) values (‘IT Sector’, 25102020) where emp_no = 1005233409 and from_date = 20102009

INSERT into dept_manager (dept_no, from_date, to_date) values (‘A012’, 20102009, 25102050) where emp_no = 1005233409

INSERT into departments (dept_name) values(‘IT Database’) where dept_no = ‘A012’

3. Inserting a new department

INSERT into departments (dept_no, dept_name) values (‘A124’, ‘John’)

4. Deleting a employee or all rows of table

DELETE from employees where emp_no = 1002478910

DELETE from employees à Delete all rows  

Please share your feedback. In case you require more help or any clarification, please put a comment.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote