705 Assignment 1
705 Assignment 1
Table 2: Dependent
Table 3: Employee
Table 4: Projects
Table 5: Works_On:
Table 6: Dept_location:
Q1) Display all employees (Fname, Lname) whose salary is in between 20K and 30K.
Sql Query: SELECT FNAME, LNAME FROM EMPLOYEE WHERE Salary BETWEEN 20000
AND 30000
Output:
Q2) Display all employees (Fname, Lname) whose salary is in between 20K and 30K and
works in the department “Research”.
Output:
Q2) Display all employee names who are from DELHI and their department locaƟon is
KOLKATA
Output:
Q4) Which employees are working in department “Research” and project number “P-01”.
Output:
Q5) Display list of employees who are either from DELHI or working in a department
located at DELHI.
Output:
SQL QUERY: SELECT FNAME, LNAME FROM EMPLOYEE WHERE NOT EXISTS (SELECT *
FROM DEPENDENT WHERE SSN = ESSN)
Output:
Q8) Display all employee names from department “Research” who have no dependent or
have all dependents born after 01/01/2010
Output:
Q9) What is the average salary of employees in “Research” department
Output:
Q10) How many employees are there in the organizaƟon who are working as managers
and have started the managerial job after 01/01/2016.
SQL QUERY: : SELECT COUNT(*) AS "No. of Emp in Managerial Role" FROM EMPLOYEE,
DEPARTMENT WHERE (DNUMBER = DNO) AND (SUPER_SSN = MGR_SSN) AND
(MGR_START_DATE > "2016-01-01");
Output: