Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

EMP

EMPNO ENAME JOB MGR HIREDATE SAL DEPTNO


7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 30
...........................................................
7698 BLAKE MANAGER 01-MAY-81 3850 30
7902 FORD ANALYST 7566 03-DEC-81 3000 10

1.List the job title and the salary of those employees whose manager
has the
number 7698 or 7566 and who earn more than 1500.

2.a) How many tuples are stored in the relation EMP?


b)How many different job titles are stored in the relation EMP?

3. The employee JONES is transfered to the department 20 as a


manager and his salary is increased by 1000:

4. All salesmen working in the department 20 get the same salary as


the manager who has the lowest salary among all managers.

5. List the names of all employees together with the name of their
manager.

6. Retrieve the minimum and maximum salary of clerks for each


department having more than three clerks.

E_ID E_Name
01 Hansen, Ola
02 Svendson, Tove
03 Svendson, Stephen
04 Pettersen, Kari

"Employees_USA":

E_ID E_Name
01 Turner, Sally
02 Kent, Clark
03 Svendson, Stephen
04 Scott, Stephen

7. list all the different employees in Norway and USA.


The "Persons" table:

P_Id LastName FirstName Address City


1 Hansen Ola Timoteivn 10 Sandnes
2 Svendson Tove Borgvn 23 Sandnes
3 Pettersen Kari Storgt 20 Stavanger

The "Orders" table:

O_Id OrderNo P_Id


1 77895 3
2 44678 3
3 22456 1
4 24562 1
5 34764 15

8. list all the persons having any order.


9. select the persons living in a city that ends with an "s" from the "Persons"
table.
10.Query to find if the customers "Hansen" or "Jensen" have a total
orderprice of more than 1500.
O_Id OrderDate OrderPrice Customer
1 2008/11/12 1000 Hansen
2 2008/10/23 1600 Nilsen
3 2008/09/02 700 Hansen
4 2008/09/03 300 Hansen
5 2008/08/30 2000 Jensen
6 2008/10/04 100 Nilsen

You might also like