Hey guys these days i found some good questions but i couldn't solve them. is there anyone who could solve these?
the schema of this database is available at the end. the database and data is downloadable from below link : http://ift.tt/1SeJkjl
1) Write a query to find the managers who manage the department with largest budget. Your query should display just “ManagerID”, “EmpName”.
2) Write a query to find the departments with more than 10 employees (full-‐ and part-‐time employees). Your query results should contain the fields DeptID and DeptName from Department table. Remember this is an assignment about Nested Queries. You are expected to write your query applying this concept.
3) You would like to know number of employees who earn less than average salary. Your query should return the NumOfEmployees.
4) Find the managers who are older than average age of all employees. Your query should return the name and age of those managers.
5) Find the youngest manager who manages more than one department. Your query should return the name and age of the manager.
6) You would like to know the departments with more than 5 full-‐time young employees (Age <25) each department has. Calculate the average salary of the employees who work for those departments. This newly calculated field should be named as “AvgSalary and be returned by your query.
7) Calculate the number of full-‐time employees each department has. In your query, report the minimum, maximum, and average number of employees in the departments. Do not forget to appropriately name the newly calculated columns.
8) Calculate the max salary values for youngest and eldest employees who work for Department with DeptID=4. Your query should display the age and associated salary value.
Schema: The schema for this DB is as follows: Employee(EmployeeID:Integer, EmpName: String, Age: Integer, Salary: Real) Department(DeptID: Integer, DeptName:String, Budget: Real, ManagerID: Integer) Works(EmployeeID:Integer, DeptID: Integer, Percent_Time: Integer) In this company an employee can work in more than one department and the “Percent_Time” column of the “Works” table indicates the percentage of time that a given employee works in a given department.
Cheers.
Aucun commentaire:
Enregistrer un commentaire