Database Management System - Old Questions
3. From the relation given below, answer the following questions.EMPLOYEE (Ssn, Fname, Mnit, Name, Bdate, Address, Sex, Salary, Super_ssn, Dno)
DEPARTMENT (Dname, Dnumber, Mgr_ssn, Mgr_start_date)
PROJECT (Pname, Pnumber, Plocation, Dnum)
DEPENDENT (Essn, Dependent_name, Sex, Bdate, Relationship)
DEPT_LOCATIONS (Dnumber, Dlocation)
(a) Retrieve all the attributes of employees who work for the 'Computer' department (department no 5) using SQL.
(b) For each Department, retrieve the department number, the number of employees in department, and their average salary using SQL.
(c) For each project on which more than two employees work, retrieve the project number, name, and the number of employees who work on that project using SQL.
(d) Select the EMPLOYEE tuples whose department is 10, or those whose salary is greater than Rs 50,000 using Relational Algebra.
(e) Retrieve the names of employees who have no dependents using Relational Algebra. [5 × 2]
Answer
AI is thinking...