You are on page 1of 2

* Try to create the following Queries:

1. Display the Department id, name and id and the name of its manager.
2. Display the name of the departments and the name of the projects under its
control.
3. Display the full data about all the dependence associated with the name of the
employee they depend on him/her.
4. Display the Id, name and location of the projects in Cairo or Alex city.
5. Display the Projects full data of the projects with a name starts with "a" letter.
6. display all the employees in department 30 whose salary from 1000 to 2000 LE
monthly
7. Retrieve the names of all employees in department 10 who works more than or
equal10 hours per week on "AL Rabwah" project.
8. Find the names of the employees who directly supervised with Kamel Mohamed.
9. Retrieve the names of all employees and the names of the projects they are
working on, sorted by the project name.

m
10. For each project located in Cairo City , find the project number, the controlling

er as
department name ,the department manager last name ,address and birthdate.

co
11. Display All Data of the mangers

eH w
12. Display All Employees data and the data of their dependents even if they have no

o.
dependents
DML
rs e
ou urc
Data Manipulating Language:
o

1. Insert your personal data to the employee table as a new employee in department
aC s

number 30, SSN = 102672, Superssn = 112233, salary=3000.


vi y re

2. Insert another employee with personal data your friend as new employee in
department number 30, SSN = 102660, but don’t enter any value for salary or
manager number to him.
ed d
ar stu

3. Upgrade your salary by 20 % of its last value.

4. In the department table insert new department called "DEPT IT" , with id 100,
is

employee with SSN = 112233 as a manager for this department. The start date for this
Th

manager is '1-11-2006'

5. Do what is required if you know that : Mrs.Noha Mohamed(SSN=968574) moved to


be the manager of the new department (id = 100), and they give you(your SSN
sh

=102672) her position (Dept. 20 manager)

a. First try to update her record in the department table


b. Update your record to be department 20 manager.
c. Update the data of employee number=102660 to be in your teamwork (he will
be supervised by you) (your SSN =102672)

This study source was downloaded by 100000804352682 from CourseHero.com on 12-07-2021 05:28:48 GMT -06:00

https://www.coursehero.com/file/46831877/Lab3-Part1doc/
6. Unfortunately the company ended the contract with Mr. Kamel Mohamed
(SSN=223344) so try to delete his data from your database in case you know that you
will be temporarily in his position.
Hint: (Check if Mr. Kamel has dependents, works as a department manager,
supervises any employees or works in any projects and handle these cases).

m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th
sh

This study source was downloaded by 100000804352682 from CourseHero.com on 12-07-2021 05:28:48 GMT -06:00

https://www.coursehero.com/file/46831877/Lab3-Part1doc/
Powered by TCPDF (www.tcpdf.org)

You might also like