You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(employee_id, department_id) is the primary key (combination of columns with unique values) for this table.
12
+
employee_id is the id of the employee.
13
+
department_id is the id of the department to which the employee belongs.
14
+
primary_flag is an ENUM (category) of type ('Y', 'N'). If the flag is 'Y', the department is the primary department for the employee. If the flag is 'N', the department is not the primary.
15
+
16
+
17
+
Employees can belong to multiple departments. When the employee joins other departments, they need to decide which department is their primary department. Note that when an employee belongs to only one department, their primary column is 'N'.
18
+
19
+
Write a solution to report all the employees with their primary department. For employees who belong to one department, report their only department.
0 commit comments