Ask Question, Ask an Expert


Ask DBMS Expert

Home >> DBMS

1. prepare a pl/sql block which declares and uses cursors with the parameters.

In a loop, use a cursor to retrieve the department number and department name from the departments table for a department whose department_id is less than 100. Pass the department number to the another cursor as a parameter to retrieve from the  employees table the information of employee last name, job, hire date, and salary of those employees whose employee_id is less than 120 and who work in that department.

a) In the declarative section, declare a cursor dept_cursor to retrieve department_id and department_name for those departments with the department_id less than 100.  Order by department_id.

b) Declare another cursor emp_cursor that takes the deparment number as parameter and retrieves last_name, job_id, hire_date, and salary of those employees whose employee_id is less than 120 and who work in that department.

c) Declare variables to contain the values retrieved from each cursor. Use the % type attribute while declaring variables.

d) Open the dept_cursor, use a simple loop, and fetch values in variables declared. Display the department number and department name.

e) For each department, open emp_cursor by passing the current department number as a parameter. Begin another loop and fetch the values of emp_cursor in variables and print all the details retrieved from employees table.

Note: You might desire to print a line after you have displayed the details of each department. Use proper attributes for the exit condition. As well, determine whether a cursor is already open before opening the cursor.

f) Close all the loops and cursors, and then end the executable section. Execute the script.

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M91082

Have any Question? 

Related Questions in DBMS

A quick guide to pivot tables is found at the end of this

A "Quick Guide to Pivot Tables" is found at the end of this document. Review it BEFORE beginning the questions. The data for this exercise (structured as a flat file) can be found in an Excel workbook located on Blackboa ...

1 objective named entity recognitionin this project you

1. Objective: Named Entity Recognition In this project, you will use scikit-learn and python 3 to engineer an effective clas- sifier for an important Information Extraction task called Named Entity Recognition. 2. Gettin ...

Database design continueduse the attached database to

Database Design Continued Use the attached database to complete the following assignment: You will be modifying the frmMainMenu to call the caption of each button from the table MainMenu and form or the report. 1) Create ...

Database relationsusing the invoice table structure shown

Database Relations Using the INVOICE table structure shown in Table, do the following: ATTRIBUTE NAME SAMPLE VALUE SAMPLE VALUE SAMPLE VALUE SAMPLE VALUE SAMPLE VALUE INV_NUM 211347 211347 211347 211348 211349 PROD_NUM A ...

Database individual assignmentdesign a database entity and

Database: Individual Assignment Design a database (entity and relationship tables in Access) for a small college department library. You should have the entities and relationships you need to support: Purchase books Sell ...

Data base 1 hypertensionobjective to determine whether or

Data Base 1: Hypertension Objective: To determine whether or not the community self-management program is effective to promote health and reduce blood pressure level in patients with hypertension Rationale In low-to-midd ...

Coit20247 database design and development assignmentyou

COIT20247 Database Design and Development Assignment You must use that sample solution of assignment only for the following tasks: Assessment task- 1. Normalization a) Map the ERD, from the sample solution, into a set of ...

Database worksheetuse the attached database to complete the

Database Worksheet Use the attached database to complete the following: Create a simple excel spreadsheet with data to update the database. >>> This can hold any type of data to be used in this database In MS Access 1. C ...

Database design and use group assignmentassignment

Database Design and Use Group Assignment Assignment Description - In this assignment you will use your normalized "City Jail" database you have created in your assignment one. You will form a group (2-3 students) and imp ...

Physical database design assignment query optimisationthis

Physical Database Design Assignment: Query Optimisation This assignment aims to develop your skills optimizing query. It involves identifying the suitable methods for structuring the data and writing the query. First, yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate