Escolar Documentos
Profissional Documentos
Cultura Documentos
Set 1
Note: Consider the EMP and DEPT tables for the following queries.
1. Retrieve a list of MANAGERS.
2. Find out salary of both MILLER and SMITH.
3. Find out the names and salaries of all employees earning more than 1000 per
month.
4. Display the names and salaries of all employees except JAMES.
5. Find out the details of employees whose names begin with S.
6. Find out the names of all employees that have A anywhere in their name.
7. Find out the names of all employees that have L as their third character in
their name.
8. Find out the names of the employees whose name begin with A or M.
9. Compute yearly salary of SMITH.
10. Compute daily salary of JONES.
11. Calculate the total monthly salary of all employees.
12. Print the average annual salary.
13. Select the name, job, salary, department number of all employees except
SALESMAN from department number 30.
14. List unique departments of the EMP table.
15. List the name and salary of employees who can earn more than 1500 and are in
department 10 or 30.
16. List the name and salary for all employees whose salary is not in the range of 1500
and 2850.
17. Display the name and job of all employees who do not have a MANAGER.
18. Display the name, salary and commission for all employees whose commission
I. Create above relations using your own data types and print the structure of the
each relation.
II. Insert at least 10 records in the relation EMPLOYEE and 5 records in the relation
COMPANY. Insert appropriate records in the relations WORKS and MANAGES.
III. Print the contents of the each relation.
IV. Give an expression in SQL with output for each of the following queries:
1. Find the names of all employees who work for First Bank Corporation.
2. Find the names and cities of residence of all employees who work for the First
Bank Corporation.
3. Find the names, street, and cities of residence of all employees who work for
First Bank Corporation and earn more than Rs. 10,000/-.
4. Find the employees who live in the same cities as the companies for which they
work.
5. Find all employees who live in the same cities and on the same streets as do
their managers.
6. Find all employees who do not work for First Bank Corporation.
7. Find all employees who earn more than every employee of Small Bank
Corporation.
8. Find all companies located in every city in which Small Bank Corporation is
located.
9. Find all employees who earn more than the average salary of all employees of their
company.
10. Find the company that has the most employees.
11. Find the company that has the smallest payroll.
12. Find those companies whose employees earn a higher salary, on average, than the
average salary at First Bank Corporation.
PL/SQL PROGRAMS
1. Write a pl/sql program to check the given number is strong or not.
2. Write a pl/sql program to check the given string is palindrome or not.
3. Write a pl/sql program to swap two numbers without using third variable.
4. Write a pl/sql program to generate multiplication tables for 2,4,6.
5. Write a pl/sql program to display sum of even numbers and sum of odd numbers in the given range.