Please use Pl/sql ro answer the following question, and red had been provide First create below table, INSERT INTO this table by building PL/SQL BEGIN END block   First create this table CREATE TABLE selected_emp (emp_id   number(5),  salary   number(9,2),  level    varchar2(10)  )

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

dont try to copy existing sol 

I have existing solution 

If copied solutiion wiil surely downvote

Please use Pl/sql ro answer the following question, and red had been provide

First create below table, INSERT INTO this table by building PL/SQL BEGIN END block

 

  1. First create this table

CREATE TABLE selected_emp

(emp_id   number(5),

 salary   number(9,2),

 level    varchar2(10)

 )

 

  1. Create a cursor to pull entire employee tables into it

 

Cursor  cur_emp IS

SELECT employee_id, firstname, salary FROM employees;

 

  1. In BEGIN and END block

Create Cursor FOR LOOP to fetch each record one by one.

Each time new record fetch

 Make IF THEN ELSE  block and check salary and make INSERT INTO accordingly

 If salary is in between 1 to 4000   THEN class is D

       INSERT INTO selected_emp VALUES (q.employee_id, q.salary, ‘D’);

  If salary is in between 4001 to 7000  THEN class is C

INSERT INTO selected_emp VALUES (q.employee_id, q.salary, ‘C’);

   If salary is in between 7001 to 10000 THEN class B

INSERT INTO selected_emp VALUES (q.employee_id, q.salary, ‘B’);

   everything ELSE THEN  Class A

 INSERT INTO selected_emp VALUES (q.employee_id, q.salary, ‘A);

    END IF;

END LOOP;

 

END;

DEPARTMENTS
LOCATIONS
* DEPARTMENT_ID
* DEPARTMENT_NAME
MANAGER_ID
LOCATION_ID
P
* LOCATION_ID
STREET_ADDRESS
POSTAL_CODE
* CITY
JOB_HISTORY
F
F
PF * EMPLOYEE_ID
P
START_DATE
* END_DATE
F * JOB_ID
STATE_PROVINCE
IF
COUNTRY_ID
F
DEPARTMENT_ID
EMPLOYEES
P
ΕMPLOYEEID
FIRST_NAME
LAST_NAME
U * EMAIL
COUNTRIES
P
COUNTRY_ID
COUNTRY_NAME
REGION_ID
PHONE_NUMBER
HIRE_DATE
F
F
JOBS
JOB_ID
* JOB_TITLE
MIN_SALARY
MAX_SALARY
* JOB_ID
SALARY
COMMISSION_PCT
REGIONS
F
MANAGER_ID
F
IP
REGION_ID
REGION_NAME
DEPARTMENT_ID
Transcribed Image Text:DEPARTMENTS LOCATIONS * DEPARTMENT_ID * DEPARTMENT_NAME MANAGER_ID LOCATION_ID P * LOCATION_ID STREET_ADDRESS POSTAL_CODE * CITY JOB_HISTORY F F PF * EMPLOYEE_ID P START_DATE * END_DATE F * JOB_ID STATE_PROVINCE IF COUNTRY_ID F DEPARTMENT_ID EMPLOYEES P ΕMPLOYEEID FIRST_NAME LAST_NAME U * EMAIL COUNTRIES P COUNTRY_ID COUNTRY_NAME REGION_ID PHONE_NUMBER HIRE_DATE F F JOBS JOB_ID * JOB_TITLE MIN_SALARY MAX_SALARY * JOB_ID SALARY COMMISSION_PCT REGIONS F MANAGER_ID F IP REGION_ID REGION_NAME DEPARTMENT_ID
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY