Question: DATABASE PROGRAMMING CREATE TABLE dept ( deptno NUMBER(2,0), dname VARCHAR2(14), loc VARCHAR2(13), CONSTRAINT n_pk_dept PRIMARY KEY (deptno) ); CREATE TABLE emp( empno NUMBER(4,0), ename VARCHAR2(10),
DATABASE PROGRAMMING
CREATE TABLE dept ( deptno NUMBER(2,0), dname VARCHAR2(14), loc VARCHAR2(13), CONSTRAINT n_pk_dept PRIMARY KEY (deptno) ); CREATE TABLE emp( empno NUMBER(4,0), ename VARCHAR2(10), job VARCHAR2(9), mgr NUMBER(4,0), hiredate DATE, sal NUMBER(7,2), comm NUMBER(7,2), deptno NUMBER(2,0),
Use table of Employees for this question
In an anonymous PL/SQL block, define an associative array type called ID_Name that uses the Employee_ID as its index, the values of elements will be employees full names, its format is First name, space, Last name. You need to declare a variable named List of this type.
In the program, you will retrieve the employee ID and full name
( use
SELECT employee_id, first_name || ' ' ||last_name AS full_name )
for those employees who work in the department ID = 60.
Populate this associative array first; after having built the associative array, print out the contents of this list.
Note: The maximal length of the full name is (20 + 25) bytes.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
