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. Dract b. Create the ADD_EMPLOYEE procedure to add an employee to the EMPLOYEES 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 employee named Joe Harris in department 80, leaving remaining parameters with their default values. What is the result? my

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter12: Database Queries With Sql
Section: Chapter Questions
Problem 1E
icon
Related questions
Question
100%

please use sql to answer the following question as the question shown below

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_DEEPTID to validate a specified department ID and
a BOOLEAN value of TRUE if the department exists.
Dract
b. Create the ADD_EMPLOYEE procedure to add an employee to the EMPLOYEES table.
The row should be added to the EMPLOYEES table if the VALID_DEPTID function
returms 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 employee named Joe Harris in department 80, leaving remainin
parameters with their default values. What is the result?
edem
Transcribed Image 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_DEEPTID to validate a specified department ID and a BOOLEAN value of TRUE if the department exists. Dract b. Create the ADD_EMPLOYEE procedure to add an employee to the EMPLOYEES table. The row should be added to the EMPLOYEES table if the VALID_DEPTID function returms 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 employee named Joe Harris in department 80, leaving remainin parameters with their default values. What is the result? edem
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 8 steps with 4 images

Blurred answer
Knowledge Booster
Multiple table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage