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

Lab assignment working with additional database objectslab

Lab Assignment: Working with Additional Database Objects LAB OVERVIEW Scenario and Summary There is a lot more to a database than just tables and the data in them. A very important part of database security has to do wit ...

Question - databasesuse database software such as microsoft

Question - Databases Use database software such as Microsoft Access or LibreOffice Base to perform the following actions. (Refer to Workshops 9 & 10 for help.) A. Create a new database. Add tables based on the design of ...

Assignmentthis must be your own unique work you cannot have

Assignment THIS MUST BE YOUR OWN UNIQUE WORK: you cannot have the exact same table as another student and you cannot turn in something you find online!Your work will be checked against a plagiarism database. The format m ...

Assignment - data mining and machine learning in the real

Assignment - Data Mining and Machine Learning in the Real World OBJECTIVE: Learn about some of the things going on in the real-world with Machine Learning and Data Mining. Your answers to the questions in the cells right ...

The discussion questionbased on your research and readings

The discussion question Based on your research and readings for the week, respond to the following discussion topics. • Often, systems have only one level of security when it comes to databases. Imagine that someone is t ...

Capstone project purpose of the assessmentthe purpose of

Capstone Project Purpose of the assessment: The purpose of this assignment is to identify new learning, self realisation and plan for improvement. Students will have an opportunity to explore the use of the online tools ...

Relational database systems comp 1005objective this is an

Relational Database Systems (COMP 1005) Objective: This is an individual assignment aimed to give the student exposure in understanding, designing, building and analyzing database systems for a given real-time based scen ...

Tasks objectives1 manage client-server connections using

Tasks Objectives: 1. Manage client-server connections using RDBMS Net Services 2. Evaluate requirements and select appropriate parameters to ensure effective storage management in a database system 3. Manage Redo log inf ...

1 draw and explain erm diagram andnbsp explain what is

1. Draw and explain ERM diagram and  explain what is REM 2. Explain what is Normalization . what is 0NF,1NF, 2NFand ,3NF and explain what is in the tables Entity Relationship Modeling and Normalization: 1 System Analysis ...

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

  • 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

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

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen