'Can I have a Table with primary Key which is a Foreign Key in more than one Table
I want to create a database for a group feature in my Flutter Application and I want the group to consist of administrators with different roles like Moderator, Secretary, etc...
| Group Table | |
|---|---|
| groupId | int not null primary key |
| roleId | int foreign key |
| firstName | string (50) |
| lastName | string (50) |
string (80) |
|
| address | string (100) |
| Role Table | |
|---|---|
| roleId | int not null primary key |
| roleType | string (20) |
| groupId | int foreign key |
| Admin Table | |
|---|---|
| adminId | int not null primary key |
| roleId | int foreing key |
| groupId | int foreign key |
Can I have groupId as a Foreign Key in Role_Table and also have groupId as foreign key in the Admin_Table?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
