78. Binary Skill Presence Matrix
A presence matrix shows 1/0 for whether each entity has each attribute. Use MAX(CASE WHEN attr='X' THEN 1 ELSE 0 END) per attribute: MAX returns 1 if any matching row exists in the group and 0 otherwise — a boolean OR across the group.
Task: the person_skill table lists which skills each person has (zero or more rows each). Build a matrix with one row per person and a 1/0 column for each skill 'sql', 'python', 'excel'. Return person, sql, python, excel. Every person in people must appear, even with no skills (all zeros), so start from people and LEFT JOIN. Order by person.
Output columns, in order: person, sql, python, excel.
This is the result for the example data above. On Submit your query is graded against this example plus 4 hidden edge cases — 5test cases in all. A sloppy query that only fits the example won't pass.