Exercise 1: Postgres's Unified Role Concept vs. MySQL's Separate User/Privilege Grouping — Possible Solution ==================================================================== MYSQL'S APPROACH ------------------------------ Per this chapter, "in MySQL, there are USER accounts, and a separately-evolved mechanism (roles, added only in MySQL 8.0) for grouping privileges — roles are a relatively recent addition layered on top of a user-centric model." MySQL's core model is user accounts first, with role-based grouping bolted on afterward as a later addition rather than the original foundation of its access-control system. POSTGRES'S APPROACH ------------------------------ Per this chapter, "in Postgres, there has only ever been one core concept: the role. A role can behave as a login-capable user, as a pure privilege-grouping 'group,' or both at once — the distinction comes entirely from a single attribute." Rather than two separate mechanisms bolted together, Postgres has a single mechanism (the role) that can be configured, via the LOGIN attribute, to serve either purpose — or, per this chapter's own example, both purposes combined. A CONCRETE EXAMPLE OF ROLE MEMBERSHIP ------------------------------ Using this chapter's own syntax: CREATE ROLE alice LOGIN PASSWORD 'secret'; CREATE ROLE reporting_team; GRANT reporting_team TO alice; Here, alice is a login-capable role (a "user"), and reporting_team is a pure group role with no LOGIN attribute, meaning it can't connect to the database directly — it exists purely to hold a set of privileges. The final GRANT statement makes alice a MEMBER of reporting_team, which means alice automatically inherits every privilege that has been (or will be) granted to reporting_team, without those privileges needing to be granted to alice individually. If a second employee, bob, is later added the same way (GRANT reporting_team TO bob;), both alice and bob share the same set of privileges through their shared membership in reporting_team — the same underlying mechanism (roles and role membership) handles both individual login and group-based privilege organization. WHY THIS WORKS AS AN ANSWER ------------------------------ It contrasts MySQL's two-mechanism, user-first history with Postgres's single unified role concept using the chapter's own wording, and demonstrates role membership concretely using the chapter's own CREATE ROLE/GRANT example rather than describing it only abstractly.