If there is a many-to-many relationship between user and role:
CREATE TABLE user_role (
user_id INTEGER NOT NULL,
role_id INTEGER NOT NULL,
PRIMARY KEY (user_id, role_id),
KEY (role_id)
);
In this way, you can not only check all permissions of a certain user, but also check all users with certain permissions (such as super administrator).
No need.
But you can index both fields to speed up queries.
Every table should have a primary key, preferably an auto-incremented primary key
As far as the paradigm of database design is concerned, I think if these two IDs can form a primary key, there is no need to add another ID.
If there is a many-to-many relationship between user and role:
In this way, you can not only check all permissions of a certain user, but also check all users with certain permissions (such as super administrator).