We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
From my point of view, this task is not entirely correct.
First, the database structure is not normalized — we have duplicated data across different tables, as each role table stores the company_code directly.
Second, the task asks for the count of all roles related to a company, but it doesn't clarify whether those counts should be based on the reporting hierarchy (e.g., only counting managers who report to existing senior managers, etc.). In fact, based on the current schema, the counts should be based solely on the company_code, regardless of whether someone reports to another role or not.
That means the result should not depend on whether a company has a lead manager, senior manager, and so on.
Therefore, I propose the solution where each role is counted independently by company, based only on company_code.
I also suggest updating the task description to make this requirement clearer for others.
New Companies
You are viewing a single comment's thread. Return to all comments →
From my point of view, this task is not entirely correct. First, the database structure is not normalized — we have duplicated data across different tables, as each role table stores the company_code directly.
Second, the task asks for the count of all roles related to a company, but it doesn't clarify whether those counts should be based on the reporting hierarchy (e.g., only counting managers who report to existing senior managers, etc.). In fact, based on the current schema, the counts should be based solely on the company_code, regardless of whether someone reports to another role or not.
That means the result should not depend on whether a company has a lead manager, senior manager, and so on. Therefore, I propose the solution where each role is counted independently by company, based only on company_code.
I also suggest updating the task description to make this requirement clearer for others.