cherlapalli_jailer Posted May 21, 2013 Report Posted May 21, 2013 CREATE PROCEDURE GETJOBCOUNT int EMP_Id BEGIN cursor c1 is select employee_name,salary,hire_date from employees BEGIN total_cnt := 0; FOR emp_rec in c1 LOOP if emp_rec.salary >1000 and emp_rec.salary<5000 update employee set salary = emp_res.salary + emp_res.salary*0.1 where employee_id - emp_rec.employee_id if emp_rec.salary >5000 and emp_rec.salary<10000 update employee set salary = emp_res.salary + emp_res.salary*0.05 where employee_id - emp_rec.employee_id END LOOP; END
cherlapalli_jailer Posted May 21, 2013 Report Posted May 21, 2013 play around those solution is very close to them only thing u may face issue is syntax issues other than that the logic pretty much works if u use Pl/SQL tool it will help with syntax
bujjulu Posted May 21, 2013 Report Posted May 21, 2013 [quote name='NOJOB' timestamp='1369134117' post='1303778749'] actually night varaki vallaki pampinchalanta.kani dantlo oka diagram.i dont know why adhi ikkada post kavatledhu 1. Create tables for below components based on the screenshot given below. 1. EMPLOYEES 2. DEPARTMENTS 3. LOCATIONS 4. JOBS 5. COUNTRIES 6. JOB_HISTORY 7. JOBS [img]file:///C:/Users/homr/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg[/img] 2. Create a Package with specific inset procedure for each table to insert records into above tables. Use sequences for primary key columns for each table while inserting the records into the tables. 3. Understand the table relationships shown in above screen and use the insert procedures to insert the records into each table. Additionally insert the records in each table in a logical order to ensure that any foreign key values that are to be populated should be exist in their respective table. For ex. If the record is being inserted into EMPLOYEE table, values for manger_id, department_id,job_id should be already exists in EMPLOYEES,DEPARTMENTS,JOBS tables respectively. [right]Contd..2[/right] [center]:2:[/center] 4. Create a stored function called GET_JOB_COUNT to retrieve the total number of different jobs on which an employee worked. [indent=1]a. The function should accept one parameter to hold the employee ID. The function will return the number of different jobs that employee worked until now.[/indent] [indent=1]b. Also Add exception handling to for invalid employee ID.[/indent] 5. Create a stored function called GET_SERVICE_YRS to retrieve the total number of years of a service for a specific employee. [indent=1]a. The Function should accept employee ID as a parameter and return the number of years of a service.[/indent] 6. Create a stored procedure called UPD_SAL to update the minimum and maximum salaries for a specific job ID in the JOBS table. [indent=1]a. Pass three parameters to the procedure, Job ID, Minimum salary and Maximum salary[/indent] 7. Create a PL/SQL stored procedure with a cursor to select employee name, salary, hire date from EMPLOYEE table. Read each row from the cursor and if the salary is between 1000 to 5000 then give an increment of 10% and if the salary is between 5000 to 10000 and if he was hired after the 31-DEC-2012 and give an increment of 5 %. Additionally update EMPLOYEE table back with new salary. [/quote] first one oracle lo HR schema bhaa adhi esi padeyyu
JAPAN Posted May 21, 2013 Report Posted May 21, 2013 rendu files pampinchanu........answers for 4 and 5 .........andhulo second file tesuko...corrections chesaru andulo
cherlapalli_jailer Posted May 21, 2013 Report Posted May 21, 2013 any use from japan or me?? did u get what u want? if u need any thing else or if u r done pl let us know
krishnareddy218 Posted May 21, 2013 Author Report Posted May 21, 2013 bhayyas thanks very much.naaku meeru chala help ayyaru.i dont know how to thank you.u really helped me a lot.JAI AFDB
bujjulu Posted May 21, 2013 Report Posted May 21, 2013 [url="http://www.oracle.com/technetwork/developer-tools/datamodeler/sample-models-scripts-224531.html"]http://www.oracle.com/technetwork/developer-tools/datamodeler/sample-models-scripts-224531.html[/url]
Recommended Posts