简体   繁体   中英

Consolidation of two entities in one table

I am making a thesis repository, and I came across another situation. I have 3 user levels, admin, staff and guest. I have this ERD diagram below. Situation: A user can be a student, admin or staff. However, one feature of this web app is to search theses by authors. Also, a user with admin / staff privilege upload thesis. Question: Can I consolidate student and other user privilege information in one table? Say like, all info will be stored in one table called users? Thanks in advance

InitialERD

A. If a user can have multiple privileges for an instance both a student & staff. Then you should have a user table with a one to many relationship with a user privilege table. User privilege table will contain the user privileges like student, guest, admin etc.

B. If a user will have exactly one privilege then you can include that within the user table as a field/column String privilegeKind;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM