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),
In this question, you will write an anonymous PL/SQL block, based on table employees. The program will print out the employee ID, full name (using concatenate operator to merge the last and first name), and the salary of those employees whose are in a certain department ID.
The program will define a cursor with one parameter that has the data type same as department_ID which is number (4) in employees table. Your program will run two times to print out the above info for these employees working in a certain department ID. First time, the department ID is 60; second time, the ID is 20.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
