From the quota table, bucket each membership type by its borrowing period. Return member_type, max_books, max_duration, and a computed column loan_category defined as 'Long' when max_duration is 60 or more, 'Medium' when it is at least 30 (but under 60), and 'Short' otherwise.
Database schema
primary keyforeign keyarrow points to the referenced columndrag to pan