3. Create a procedure, ADD_EMPLOYEE, to insert a new employee into the EMPLOYEES table. The procedure should call a VALID_DEPTID function to check whether the department ID specified for the new...


please use sql to answer the following question



3. Create a procedure, ADD_EMPLOYEE, to insert a new employee into the EMPLOYEES<br>table. The procedure should call a VALID_DEPTID function to check whether the<br>department ID specified for the new employee exists in the DEPARTMENTS table.<br>a. Create a function called VALID_DEPTID to validate a specified department ID and<br>a BOOLEAN value of TRUE if the department exists.<br>Oract<br>b. Create the ADD_EMPLOYEE procedure to add an employee to the EMPLOYEESS table.<br>The row should be added to the EMPLOYEES table if the VALID_DEPTID function<br>returns TRUE; otherwise, alert the user with an appropriate message. Provide the<br>following parameters:<br>- first_name<br>- last_name<br>- email<br>job: Use 'SA_REP' as the default<br>mgr: Use 145 as the default<br>sal: Use 1000 as the default<br>comm: Use o as the default<br>deptid: Use 30 as the default<br>- Use the EMPLOYEES_SEQ sequence to set the employee_id column<br>- Set the hire_date column to TRUNC (SYSDATE)<br>c. Call ADD_EMPLOYEE for the name Jane Harris in department 15, leaving other<br>parameters with their default values. What is the result?<br>d. Add another enmployee named Joe Harris in department 80, leaving remaining<br>parameters with their default values. What is the result?<br>ademy<br>

Extracted text: 3. Create a procedure, ADD_EMPLOYEE, to insert a new employee into the EMPLOYEES table. The procedure should call a VALID_DEPTID function to check whether the department ID specified for the new employee exists in the DEPARTMENTS table. a. Create a function called VALID_DEPTID to validate a specified department ID and a BOOLEAN value of TRUE if the department exists. Oract b. Create the ADD_EMPLOYEE procedure to add an employee to the EMPLOYEESS table. The row should be added to the EMPLOYEES table if the VALID_DEPTID function returns TRUE; otherwise, alert the user with an appropriate message. Provide the following parameters: - first_name - last_name - email job: Use 'SA_REP' as the default mgr: Use 145 as the default sal: Use 1000 as the default comm: Use o as the default deptid: Use 30 as the default - Use the EMPLOYEES_SEQ sequence to set the employee_id column - Set the hire_date column to TRUNC (SYSDATE) c. Call ADD_EMPLOYEE for the name Jane Harris in department 15, leaving other parameters with their default values. What is the result? d. Add another enmployee named Joe Harris in department 80, leaving remaining parameters with their default values. What is the result? ademy

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here