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

Databases Programming Challenges 3, Personnel Database Creator Write an applicat

ID: 3548846 • Letter: D

Question


Databases



Programming Challenges



3, Personnel Database Creator

Write an application that creates a database named Personnel. The database should have a table named Employee, with columns for employee ID, named position, and hourly pay rate. The employee ID should be the primary key.Insert at least five sample rows of data into the Employee table.



4, Employee Inserter

Write a GUI application that allows the user to add new employee to the Personnel database you created in Programming Challenges 3.




pls add comments

Explanation / Answer

reate or replace PROCEDURE get_employee_info_by_employee_id (p_employee_id NUMBER DEFAULT NULL) AS BEGIN -- This cursor will return -- - a single row if p_employee_id is specified and exists in the table -- - all rows in the table if p_employee_id is NULL (default value, or -- passed in as NULL) -- - all rows in the table if p_employee_id is specified but does not -- exist in the table FOR aRow IN (SELECT EMPLOYEE_ID, Name, Email_Address, Hire_Date, Update_Date FROM Employee WHERE Employee_ID = p_employee_id OR p_employee_id IS NULL OR 0 = (SELECT COUNT(*) FROM EMPLOYEE WHERE EMPLOYEE_ID = p_employee_id) LOOP DBMS_OUTPUT.PUT_LINE('Employee ID: ' || aRow.EMPLOYEE_ID); DBMS_OUTPUT.PUT_LINE('NAME: ' || aRow.NAME); DBMS_OUTPUT.PUT_LINE('EMAIL_ADDRESS: ' || aRow.EMAIL_ADDRESS); DBMS_OUTPUT.PUT_LINE('HIRE_DATE: ' || aRow.HIRE_DATE); DBMS_OUTPUT.PUT_LINE('UPDATE_DATE: ' || aRow.UPDATE_DATE); END LOOP; END get_employee_info_by_employee_id;