DBMS-5
DBMS-5
Name - Anas
Roll no - 23bcs083
CSE - B
Aim: Use Company details (from Lab 4) and write
appropriate query for the following
Exercises:
1. Write a SELECT query to display a list of all project numbers for projects
that
involve an employee whose last name is ‘Smith’, either as a worker or as a
manager
of the department that controls the project.
SOLUTION :-
Output -
2. Write a SELECT query to retrieve all employees
whose address is in Houston,Texas.
SELECT *
FROM EMPLOYEE
WHERE Address LIKE '%Houston, Texas%';
SELECT *
FROM EMPLOYEE
WHERE Bdate BETWEEN '1950-01-01' AND '1959-12-31';
4. Write a SELECT query to raise 10% salary of
employees who are working on the
‘ProductX’ project and list the resulting salary along with
their names.
SELECT *
FROM EMPLOYEE
WHERE Dno = 5 AND Salary BETWEEN 30000 AND 40000;
6. Write a SELECT query to find the names of all employees
who are directly
supervised by ‘Franklin Wong’.
SELECT E.*
FROM EMPLOYEE E
JOIN EMPLOYEE Supervisor ON E.Super_ssn =
Supervisor.Ssn
WHERE Supervisor.Fname = 'Franklin' AND
Supervisor.Lname = 'Wong';