Вы находитесь на странице: 1из 6

1) a. Display Deptno & Name of Department for all Departments. b.

Extract 3 characters from 5th Position of the string MUFFAKHAM JAH c. Add the following constraints to employee table empno- primary key ename- should not be null comm- should be set to default value of o deptno- is a foreign key referencing deptno of department table. mgr- is a foreign key referencing empno of emp table. d. Demonstrate all TCL commands. e. Display your Age in i. Days. ii.Months. iii.Year. f. Write a PL/SQL block to generate the Fibonacci series.

2)

a) Display Names of Employees working in Department 10,(or) 20,(or) 40 b) Display various jobs & total no of employees in each job group c) Insert values for all the attributes for emp table and values for empno must be inserted using the emp_seq.
d) Display employee names along with their manager names. e) create a view on emp and dept table with the fields ename,dname,job for employees of department 30. f) f. Write a PL/SQL block to generate the Fibonacci series. (or)Employees working as Clerk,Analyst.

3) a. Find all jobs of Employees & remove duplicates. b. Find names of all employees whose salary is greater than atleast one employee working in department 10. c. Increase salary by 5% of those employees whose sal>2500 and increase by 6% of all others. d. Write a query in such a way that scott can grant select privileges on student table to some other user e. Display the date 6 months i. Before the current date. ii.After current date. f. Write PL/SQL block for Increasing salary of an employee by 5% for a given employee no.

4) a. Update salary of those employees with an increase of 5% of those whose salary is greater than average salary of organization. b. Display names of employees along with their annual salary,employee earning highest salary should come First. c. add the constraint on Loc column of dept table that restricts the Loc column to have only unique values. d. Create a view of emp table with the fields ename,sal, comm for the employees of department 20. e. Display jobs found in dept no 10 &20 by eliminating duplicates f. Write a PL/SQL block for addition of 3 numbers.

5) a. Display Names of Employees working in Department 10,(or) 20,(or) 40 (or) Employees working as Clerk,Analyst. b. Get the department ID,the Average ,maximum & minimum, pay of all departments. c. Add a constraint which checks that the salary of the employees does not fall below zero. d. create a view on emp and dept table with the fields ename,dname,job for employees of department 30. e. create a table Department with the following constraints : Deptno-primary key Dname- should not be null. Loc should be unique. f. Write a PL/SQL block to generate the Fibonacci series.

6) a. Update dept table and assign the location New York to the department Marketing. b. c. Display names of employees whose salary is more than 3000 after giving 20% raise. d. Find the deptno for all departments having more than 1 employee. e. Display the date 6 months i. Before the current date. ii.After current date. f. Write a PL/SQL block to check whether a number is Armstrong or not.

7) a. Display the names of employees who are working in the company since 6 years. b. Find names of all employees whose salary is greater than that of each employee working in department Research. c. Pay salary of 3000 to those employees whose salary is >=1000. d. Display Those employee names whose name has second alphabet as o. e. Display Department No. of Those Departments with Salary between. 3000 and 7000 f Write a PL/SQL block to check whether a number is Armstrong or not.

8) a. Display Names of Employees who are working as Clerk, analyst or manager & drawing salary more than 3000 b. Grant all privileges on student table to scott such that he should also be able to grant those privileges to others. c. Create a table Cust_dtls such that the content of the column Cust_no is unique and not null, Cust_name shoud be in Upper case, Cust_city starts with alphabet H. d. Display the following output for each row from emp table: Smith working as clerk joined company on 11th January 1995 and has a salary of 3500 display this information as Employee details. e. Display your Age in i. Days. ii.Months. iii.Year. f. Write a PL/SQL block to check that number is even or odd.

9) a. Display Names of Employees working in Department 10 and 30. b. Display name and annual salary for all employees c. Drop the constraint on job column of emp table that restricts the job column to have only unique values. d. Display names of those managers whose salary is greater than or equal to average salary of the Company. e. Display information from employee table ,where job Manager is found it shoud be displayed as BOSS. f.Write a procedure to calculate sum of digits of a no.

10)

a. Display Names of Employees working as Clerk & Drawing Salary of more than 2000. b. Display Names of Employees who do not earn Commission c. Add the following constraints to employee table empno- primary key ename- should not be null comm- should be set to default value of o deptno- is a foreign key referencing deptno of department table. mgr- is a foreign key referencing empno of emp table. d. Increase salaries of all employees by 5%. e. Display those employee who are working in the same department where his manager works. f. Write PL/SQL block for Increasing salary of an employee by 5% for a given employee no and display it.

11) a. Update the deptno and dname of dept table with values 70 and Distribution where dname is Marketing. b. Display Names of Employees whose salary is an odd number. c. Find the date of the last day of the month & name the column as LAST DAY in your output. d. Find names of all departments which have employees whose salary is greater than 4000. e. Display Deptno & Name of Department for all Departments. f. Create a PL/SQL block to check whether a number is Armstrong or not

12) a. Display names of employees who have joined before 30-june-90 (or) after 31dec-90. b. Find average pay of an employee in department 20. c. Display Names of employees along with their annual salaries and the employee earning highest salary should come first. d. Add the unique integrity Constraint on job column of emp table. e. Display information from employee table ,where job Manager is found it shoud be displayed as BOSS. f. Write PL/SQL block for Factorial of a number.

13)

a. Display names of employees whose Names start with alphabet J & ends withS. b. Display employees who joined the company before 20th of this month. c. Add a new column to the dept table called Budget of size 7. d. Modify the size of the Budget field to size 9 and a default value of 10.000. e. Display employee details along with their department details using full outer join,Left outer join and Right outer join. f. Write a PL/SQL block to check that number is even or odd.

14) a. Display employees who were recruited before 1-1-90 or who are working in Department 10 (or) 20. b. Find total pay for all employees in the organization c. Get the empno, name, deptno and department names of all employees. d. Delete the records of all employees whose salary is below the average sal at the organization. e. Display various jobs along with total salary for each job group where total salary is greater than 50,000. f. Write PL/SQL block for Factorial of a number.

15) a. Display common jobs between Department 10 & 20. b. Display employees who joined the company in the month of January. c. Disable the check constraint on cust_name column from cust_dtls table. d. Display all records from student table belonging to other user(scott). e. Display Deptno. & total Salary from each Department f. write a PL/SQL block to check whether a number is Armstrong or not

16) a. Display names of employees whose name contains the alphabeta. b. Extract 3 characters from 5th Position of the string MUFFAKHAM JAH c. Find names of all employees whose pay is Greater than the average pay. d. Rename the department table as dept_details. e. Give No. of Departments after eliminating duplicates. f. write a PL/SQL block to check whether a number is Armstrong or not. 17) a. Display Employee name ,Deptno & Dept Names of all employees b. Display the Length of all employee names.

c. show all the constraints on the dept and emp table (default tables) d. Display various jobs along with total salary for each job group where total salary is greater than 50,000. e. Revoke select privilege on student table from user scott. f. write a PL/SQL block to generate a Fibonacci series.

18) a. Display Names of Employees with employees No. of those who earn Commission. b. Display those employees who are not working under any Manager. c. Change the max value of the emp_seq to 99 and interval to 2. d. Display those departments where there are atleast 2 employees e. Delete the department with location chicago. f. Write PL/SQL block for Increasing salary of an employee by 5% for a given employee no.

19) a. Display Those names whose name has minimum 4 characters in it. b. Display names of employees in Upper case. c. Display various jobs along with total salary for each job group where total salary is greater than 50,000. d. Display those employee who are working in sales Department e. Display Those employees who r not working in deptno.20 f. Write PL/SQL block for Increasing salary of an employee by 5% for a given employee no.

20) a. Display jobs which are unique to dept no.10. b. Find the day of nearest Friday after current day. c. delete all the tuples of department table use delete,truncate d. Display dept no. if more than 3 employees work in each dept. e. Display employees who were recruited before 1-1-90 or who are working in Department 10 (or) 20. f. Write a PL/SQL block to check that number is even or odd.

Вам также может понравиться