A GRANT statement assigns database privileges to a role or user. Use it to control who can view, add, change, or delete data. In a role-based access control design, create a role, grant privileges to it, then assign the role to users. section 7.4
Match each privilege to the job a role must perform:
- GRANT SELECT lets a role view table records. section 7.4
- GRANT INSERT lets a role add records, such as purchases or reviews. section 7.4
- GRANT SELECT, INSERT, UPDATE, DELETE gives an administrator broad control over selected tables. section 7.4
Assign a purchasing role
Create standard_user, grant it SELECT on product and INSERT on purchase, purchase_product, and review, then assign it to a user: GRANT SELECT ON database_name.product TO standard_user; GRANT INSERT ON database_name.purchase TO standard_user; GRANT standard_user TO 'morpheus'@'%';


