InterviewSolution
| 1. |
Please Write A Query To Get All The Departments, And The Count Of Employee In Those Department, Which Have More Than 50 Employees And Are Based Out Of State New York. Following Are The Table Structures: |
|
Answer» Department table: Department_ID, Department_Name, STATE (Note: Department ID is Unique here and more than one department can belong to one State) Employee Table: Employee_ID, Employee_Name, Department_ID (Note: Employee ID is unique here and more than one Employee can belong to one department, but one employee does not belong to more than one department) Following should be the query SELECT DEPT.department_id, Department table: Department_ID, Department_Name, State (Note: Department ID is Unique here and more than one department can belong to one State) Employee Table: Employee_ID, Employee_Name, Department_ID (Note: Employee ID is unique here and more than one Employee can belong to one department, but one employee does not belong to more than one department) Following should be the query SELECT dept.department_id, |
|