问题
My homework was to create a relational UML diagram about a discussion site. I used the SO schema, and I did some modifications:
- removed Age in the User Information
- added representatives, which allows users to categorise posts by their usernames (voluntary)
Otherwise, the schema is rather similar, but rudimentary. How would you improve it?
Clarification
The main idea of representatives is to categorise posts. The list contains only a handful possible names. In contrast to badges, the idea is not to funny, but organised. If you ask questions about Mathematics, you could be Steve.math
or just math
. It helps other users to see directly what you are like, and space is not wasted to you Username
. Perhaps, there is an easier way to organise things, so don't hesitate to comment.
回答1:
Votes
Add:
UserID (FK)
PostID (FK)
Users
- Get rid of Upvotes and Downvotes, that is information that can come from the votes table.
- Make it an 'integer'. Unless you have a really big site, there's no need to have a GUID as a user ID.
Posts
- ID Should be
GUID
Comments
- ID should be
GUID
If you keep Representatives
, I'd change the name of it. The name doesn't tell me anything about what it holds.
Otherwise, I don't think it's a good idea to keep that -- it's something that the 'tags
' can tell you, unless I'm completely missing why that exists.
来源:https://stackoverflow.com/questions/1179317/relational-uml-diagram-inspired-by-so