Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

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

Database management systems assignment-overview-for this

Database Management Systems Assignment- Overview- For this assignment you will implement and query a database from a supplied ER Diagram and Schema.  You will be required to write the SQL statements to create the databas ...

Design a relational database for a video rental store the

Design a relational database for a video rental store. The store, which rents only DVDs and has no sales other than DVD rentals, has approximately 5,000 customers and approximately 1,200 DVD titles. There are 25 supplier ...

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 ...

Design a relational database for a video rental store the

Design a relational database for a video rental store. The store, which rents only DVDs and has no sales other than DVD rentals, has approximately 5,000 customers and approximately 1,200 DVD titles. There are 25 supplier ...

Database systemretail store database Database system Retail Store Database: Relationships

Database system Retail Store Database: Relationships • Conduct an in-depth examination and analysis of the database, Week2_RetailStore.accdb . Apply the concepts of database systems that you have learned this week. For e ...

List the different types of locks used by dbms systems and

List the different types of locks used by DBMS systems and explain how they differ from each other. Additionally, suggest the suitable scenario for each of them. 400 to 500 words, at least 4 references with one website r ...

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 mining is a powerful and tool but it poses challenges

Data mining is a powerful and tool, but it poses challenges to the protection of individual privacy. Data mining can combine information from many sources to create detailed profiles about each of us. Explore the Web sit ...

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 ...

Questionwrite a 2 to 3 page essay describing the use of an

Question: Write a 2 to 3 page essay describing the use of an OLAP Data Cube. Your essay should also describe the operations of Drill Down, Roll Up, Slice, and Dice. Video: What is Business Intelligence and an OLAP Cube? ...

  • 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