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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started