You are on page 1of 1

1.

Consider the following schema definitions


Sailors (sid, sname, rating, age)
Boats (bid, bname, colour)
Reserves (sid, bid, day)
a. Find all sailors who are whose age is between 25 and 35.
b. Find the names of sailors who have reserved at least one boat.
c. Find the colors of boats reserved by dustin.
d. Find the names of the boats that was reserved on Monday.
2. Write a simple PL/SQL block to swap 2 numbers.
1. Consider the following relations:
EMP:
EMPNO
7369
7521
7566
7654
7698

ENAME
SMITH
WARD
JONES
MARTIN
BLAKE

JOB
CLERK
SALESMAN
MANAGER
SALESMAN
MANAGER

MGR
7902
7698
7839
7698
7839

HIREDATE
SAL
COMM DEPTNO
17-Dec-80
800
20
22-Feb-81
1250
500
30
02-Apr-81
2975
20
28-Sep-81
1250
1400
30
01-May-82
2850
30

DEPT:
DEPTN
O
10
20
30
40
1.
2.
3.
4.
5.
6.

DNAME
ACCOUNTING
RESEARCH
SALES
OPERATIONS

LOC
NEW YORK
DALLAS
CHICAGO
BOSTON

Display all the details of all managers.


List the Empno, Ename, Sal, Exp of all employees working for Mgr 7369.
List the employees who are joined in the year 81.
List the details of most recently hired employee of dept 30.
List the dept 10 employees whose salary>ALLENs salary.
List the employees whose job is same as SMITH.
2. Write a function to find the factorial of a given number.

You might also like