473,624 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

14 New Member
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_Applicati on_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.NoOf Employees = Department.NoOf Employees + 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 2847
r035198x
13,262 MVP
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_Applicati on_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.NoOf Employees = Department.NoOf Employees + 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
jenipriya
14 New Member
Please tell me how to insert a row in the table using %RowType attributes in PL/SQL
Jul 5 '07 #3
r035198x
13,262 MVP
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
3703
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 machine, but I know I have the Oracle client installed, have two odbc DSNs (CAI/PT Oracle 8) installed and uncommented php_oci8.dll and php_oracle.dll. Other than that, I kind of just played around until it worked. Now my code needs to be...
11
12694
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 read the new date. So process B starts "select ..." but does not get the previously inserted row. The timespan between commit and select is very short. (NOTE: two different sessions are used) Questions: 1.) Does commit when returning from call...
5
1996
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 Database Server to the web server. What would be best approach for connecting to the Oracle Database? would php a good integration tools to retrieve data in flexible and secure way?
11
3557
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. Each group sees a different set of menu options when they open the client and login to Oracle. For the sake of speed I use pass-through queries here and there for updates and deletes. I update their SQL property in code and execute them.
2
4225
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 this. Also - the citrix folks do not want us to keep the FE in Access as the queries and other activities consume a lot of power. The users will be in 3 different offices across the globe all accessing the 1 Oracle DB in Citrix. Does anyone have...
14
4427
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 timestamps, we frequently use the date() function to "convert" from the Oracle date datatype to the DB2 date datatype. We have used this technique on over 20 Oracle tables for several months with no problem. One table in particular fails with a...
5
7225
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, but will be migrating my back ends to Oracle ODBC. 1. Does anyone have recommendations for books or web resources for general rules/guidelines/help on doing this? I haven't found a good
7
20315
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, if they do not already exist. In terms of ASP/ADO, that would be fine in a SQL Server Sense by a simply ASP/Server-Side JavaScript as such: var cnTemp = Server.CreateObject("ADODB.Connection");
4
8407
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 Oracle and do SQL queries using the SQL-Plus. However, when i try to connect to Oracle via a test page written in ASP, the following error message appears on the screen "2147467259: ."
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.