473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

I m a fresher in oracle plz help me in solving these queries.. plz provide tips also

Tables
------------
Employee (EmpID, EmpName,DeptID DateOfJoin, Sal, Addr)
Finance (EmpID, Sal)
Club (Clubname, EmpID, Fee, DateOfJoin)
Leave (EmpID, Date)
Department (DeptID, DeptName, NoOfEmployees)



Queries
---------------
5. display the salary deduction details for the employees in a given department for a given month. The salary deduction is sum ( Club fees for that employee) + ( Employee.Sal / 30 * no of leaves taken for that month
6. write a PL/SQL block to display the details of a given employee. Use PL/SQL variables
7. write a PL/SQL block to insert a row into Employee table. Make use of PL/SQL variables and RowType attributes.
8. write a PL/SQL block to display the no of employees in a department.
9. write a PL/SQL block to delete a row from the Leave table for the given date for an employee. Use PL/SQL variables to pass the employee id and date





1. write a PL/SQL block to display employee details. Use cursor for getting data and make use of Loop…… End Loop to fetch each row from the cursor
2. write a PL/SQL block to display the employees joined in a given club. Make use of cursor with parameters for fetching data.
3. write a PL/SQL block to update the salary of all employees by 10 %. Make use of For Update and Where Current of Clauses in cursor.
4. write a PL/SQL block to display the employee details with department name and salary deductions. Make use of cursor for loops to fetch rows.
5. write a PL/SQL block to insert a row into department table. Try to add a duplicate row. Write corresponding exception handling section.
6. Add appropriate exception handling for all the above PL/SQL block.
7. write a PL/SQL block to increase the salary of a given employee by 15 % if the years of experience of that employee is greater than 2 years else generate an error using Raise_Application_Error.
8. write a PL/SQL block to find the no of employees in each club.

Stored Procedures and Functions
----------------------------------------------------

1. Write a stored function that receives an employee number and returns the total salary deductions for that employee.
2. write a stored function that accepts a department ID and returns the number of employees working in that department. Find the number of employees working in a given department from the Employees table.
3. write a stored procedure that deletes all the rows from the finance table and insert new values into it. Make use of the above function to find the deduction in salary. Finance.Sal = Employee.Sal – deductions.
4. write a Stored procedure to update the Department tabe. Update the department table with no of employees in each department. Make use of the function, which is already created, to find the no of employees in each department.
5. write a stored function to find the employee ID who is having highest no of memberships.
6. write a PL/SQL procedure to display the details of employee who is having the highest number of club membership. Make use of the above function to find the employee ID.
7. create a package with above functions and procedures such that all functions are private and all procedures are public. Also make use of forward declerations.
8. create a package with overloaded functions.


Triggers
------------

1. write triggers for employee table such that
a. whenever a new employee is added to the employee table one row should be added in the Finance table for that employee and update Department table such that Department.NoOfEmployees = Department.NoOfEmployees + 1.
b. Whenever a row is deleted from the employee table the reverse operation should take place.
c. Whenever the salary field is updated the difference should be updated in the finance table.
(Hint: write Insert, update and Delete triggers for Employee table.)
2. write triggers for Club table such that whenever a row is inserted into the Club table the Fee amount should be deducted from Finance table for that employee if the date of join is <= 15 of that month. When ever a row is deleted from the table the fee amount should be added to the Sal of finance table if the date of removal is less than 15 of that month.
Jul 4 '07 #1
3 2833
r035198x
13,262 8TB
Tables
------------
Employee (EmpID, EmpName,DeptID DateOfJoin, Sal, Addr)
Finance (EmpID, Sal)
Club (Clubname, EmpID, Fee, DateOfJoin)
Leave (EmpID, Date)
Department (DeptID, DeptName, NoOfEmployees)



Queries
---------------
5. display the salary deduction details for the employees in a given department for a given month. The salary deduction is sum ( Club fees for that employee) + ( Employee.Sal / 30 * no of leaves taken for that month
6. write a PL/SQL block to display the details of a given employee. Use PL/SQL variables
7. write a PL/SQL block to insert a row into Employee table. Make use of PL/SQL variables and RowType attributes.
8. write a PL/SQL block to display the no of employees in a department.
9. write a PL/SQL block to delete a row from the Leave table for the given date for an employee. Use PL/SQL variables to pass the employee id and date





1. write a PL/SQL block to display employee details. Use cursor for getting data and make use of Loop…… End Loop to fetch each row from the cursor
2. write a PL/SQL block to display the employees joined in a given club. Make use of cursor with parameters for fetching data.
3. write a PL/SQL block to update the salary of all employees by 10 %. Make use of For Update and Where Current of Clauses in cursor.
4. write a PL/SQL block to display the employee details with department name and salary deductions. Make use of cursor for loops to fetch rows.
5. write a PL/SQL block to insert a row into department table. Try to add a duplicate row. Write corresponding exception handling section.
6. Add appropriate exception handling for all the above PL/SQL block.
7. write a PL/SQL block to increase the salary of a given employee by 15 % if the years of experience of that employee is greater than 2 years else generate an error using Raise_Application_Error.
8. write a PL/SQL block to find the no of employees in each club.

Stored Procedures and Functions
----------------------------------------------------

1. Write a stored function that receives an employee number and returns the total salary deductions for that employee.
2. write a stored function that accepts a department ID and returns the number of employees working in that department. Find the number of employees working in a given department from the Employees table.
3. write a stored procedure that deletes all the rows from the finance table and insert new values into it. Make use of the above function to find the deduction in salary. Finance.Sal = Employee.Sal – deductions.
4. write a Stored procedure to update the Department tabe. Update the department table with no of employees in each department. Make use of the function, which is already created, to find the no of employees in each department.
5. write a stored function to find the employee ID who is having highest no of memberships.
6. write a PL/SQL procedure to display the details of employee who is having the highest number of club membership. Make use of the above function to find the employee ID.
7. create a package with above functions and procedures such that all functions are private and all procedures are public. Also make use of forward declerations.
8. create a package with overloaded functions.


Triggers
------------

1. write triggers for employee table such that
a. whenever a new employee is added to the employee table one row should be added in the Finance table for that employee and update Department table such that Department.NoOfEmployees = Department.NoOfEmployees + 1.
b. Whenever a row is deleted from the employee table the reverse operation should take place.
c. Whenever the salary field is updated the difference should be updated in the finance table.
(Hint: write Insert, update and Delete triggers for Employee table.)
2. write triggers for Club table such that whenever a row is inserted into the Club table the Fee amount should be deducted from Finance table for that employee if the date of join is <= 15 of that month. When ever a row is deleted from the table the fee amount should be added to the Sal of finance table if the date of removal is less than 15 of that month.
Please read the posting guidelines.
Jul 4 '07 #2
Please tell me how to insert a row in the table using %RowType attributes in PL/SQL
Jul 5 '07 #3
r035198x
13,262 8TB
Please tell me how to insert a row in the table using %RowType attributes in PL/SQL
Have you read any PL\SQL tutorials? You'll also find some nice articles here.
Jul 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: jayPLEASEtylerNOwilliamsSPAM | last post by:
Hi, I set up PHP 4.xx using Apache 1.3 on Windows XP to begin a project. The project now needs to be moved to a real test box. Admittedly, I am not quite sure how I was able to access Oracle on my...
11
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to...
5
by: madunix | last post by:
i want to implememt private area(authorized users)in the internet main page. Our Backend Database Server running Oracle 9i on AIX I am looking for a solution to pull up live data form Backend...
11
by: DFS | last post by:
Architecture: Access 2003 client, Oracle 9i repository, no Access security in place, ODBC linked tables. 100 or so users, in 3 or 4 groups (Oracle roles actually): Admins, Updaters and ReadOnly....
2
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with...
14
by: peteh | last post by:
Hi All; We have many production jobs that "load from cursor" to a UDB/AIX 8.2 (with dpf) data warehouse from source tables residing Oracle 9i. Since Oracle dates are (roughly) equivalent to DB2...
5
by: jonceramic | last post by:
Hi All, I started developing in Access, and people took notice and so we're starting to migrate into our corporate's bigger Oracle system. I'll still be using my developed Access front ends,...
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables,...
4
by: paulnamroud | last post by:
Hi guys, I need your help!!!! I have installed and configured a new server called "intranetnew" in order to replace the old server "intranet." With the new server, i'm able to connect to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.