LeetCode 184. Department Highest Salary
Tutd Schema: employee :: {id Integer, name Text, salary Integer, departmentId Integer}; employee := relation{tuple{id 1, name "Joe", salary 70000, departmentId 1}, tuple{id 2, name "Jim", salary 90000, departmentId 1}, tuple{id 3, name "Henry", salary 80000, departmentId 2}, tuple{id 4, name "Sam", salary 60000, departmentId 2}, tuple{id 5, name "Max", salary 90000, departmentId 1}}; key employee_pkey {id} employee; department :: {id Integer, name Text}; department := relation{tuple{id 1, name "IT"}, tuple{id 2, name "Sales"}} key department_pkey {id} department; Thinking Process: TutorialD (master/main): grouped := employee group ({all but departmentId} as byDepartment) TutorialD (master/main): :showexpr grouped ┌───────────────────────────────────────────────────────────────┬─────────────────────┐