Search code examples
databaserelationalserver

First timers database schema for a MySQL database


I'm looking for some critical feedback on a relational database design I made for a project. The database is needed for a 2nd year CS project at my school but we have not yet had any teachings on this subject so help is much appreciated.

The database needs to consist of tables such as shopping lists, Users, wares etc. which needs to be shared and updated between units.

As can be seen in the design every user is related to many shoppinglists and likewise mealplans and both of those are also related to groups. Users must also be related to groups and each row in UserGroup linking table has a role as Users must have a role in their group relations.

  1. Is this a structurally sound design?
  2. Is it inadvisable to have columns besides foreign keys in a linking table?

Thanks for your time and help! https://i.sstatic.net/XqHf6.png Full size picture of design schema Design schema


Solution

  • it's looks good.

    Q> Is this a structurally sound design?
    A> Yes
    Q> Is it inadvisable to have columns besides foreign keys in a linking table?
    A> It's common to have additional columns
    

    Be careful, don't over-normalize. Sometimes it's wise to have 1 table with duplicates records, than 10 tables join.

    best regards