Im having difficulty trying to design a database structure for the following scenario:
My database should contain general user information UserID, FirstName,
LastName, JoiningDate.Each User can be part of a group.
Each group has “tags” attached to it and can have multiple tags. Users
should also be able to return a list of available groups (filtered by
tags).Be able to search for a group (by tags attached to the group), and
searching for particular users (by last name, or unique ID). ). It should also be able
to return a list of available groups (filtered by tags), and the
members of a particular group (filtered by last name and filtered by
joining date).There should also be a means of discovering which
groups of users belong to a number of groups (a query on
“who are the members of “Bravo group” and the “Delta”
group), and keeping track of messages sent in the group (like a
forum).
Is this just two tables? Or should it be three tables… Users, Groups and Tags? Its been almost a year since ive did any relational database stuff and I was wondering if anyone could show a visual representation of this database design?
I suggest five tables: Users, Groups, Tags and link tables UserGroups and GroupTags.
This is because there appears to be a many-to-many relationship between Users and Groups, and between Groups and Tags – a link entity is required in relational design to join entities with many-to-many relationships between them.