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

Discussionnormalization and redundancy please respond to

Discussion "Normalization and Redundancy" Please respond to the following: • Suggest one of the problems that normalization seeks to solve within a database. Describe one example of your suggested problem, and explain th ...

Apriori analysis and cluster analysis-data analysis

ApriorI analysis and Cluster analysis-Data Analysis assignment CLUSTER ANALYSIS The purpose of this assignment is to demonstrate steps performed in a K-Means Cluster analysis. Review the "k-MEANS CLUSTERING ALGORITHM" se ...

Task - overview of business casealive amp boating aampb is

Task - Overview of business case: Alive & Boating (A&B) is a small start-up company that sells small boats in Wagga. A&B keeps its models in several showrooms across the city. At this stage customers cannot view the avai ...

Database design discusion post and assignmentdiscusion post

Database Design Discusion Post and Assignment Discusion Post: Data as a Corporate Resource and Foreign Keys Please respond to BOTH of the following questions: Question A Discuss how data can be a corporate resource and d ...

Database management assignmentyou have been hired by

Database Management Assignment You have been hired by National Bank as their new database administrator. Your first task is to upgrade the bank's outdated computer system and implement a relational database management sy ...

Hospital database determining keysdevelop a microsoft

Hospital Database: Determining Keys Develop a Microsoft Access database based upon the following business scenario. Be sure to include tables, fields, keys, relationships, and test data in your database. Your final submi ...

Organizations want information organizations need

Organizations want information. Organizations need information. However, information must be in an organized format that supports the creation of business intelligence. Otherwise, according to Rebecca Wettemann, vice pre ...

1 analyse situations andor environments for the application

1) Analyse situations and/or environments for the application of database solutions including web connectivity 2) Create, alter and remove relational tables, indexes and data using an appropriate database language. 3) Ex ...

Assignmentas the new manager of a convenience store you

Assignment As the new manager of a convenience store, you have noticed issues with the manual method of tracking sales using paper sales tickets and spreadsheets, as well as, shortages on some of the more popular items c ...

Listed the five important software components of a dbms the

Listed the five important software components of a DBMS: the DBMS engine, the data definition, data manipulation, application generation, and data administration subsystems. Which of those are most and least important to ...

  • 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

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro