One user, several roles — a junction without a synthetic id
Build a junction table for the relationship «one user can have many roles, and one role can have many users».
The same pair (user_id, role_id) must not appear twice, and a separate surrogate id isn't needed — the pair itself is the natural identifier. Create user_roles with two integer columns user_id and role_id, and a composite primary key spanning both of them.
Just CREATE/ALTER/DROP — no trailing SELECT needed.
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inNo starting schema
This task starts with no tables — you'll create them via CREATE TABLE.