0

When drawing DB relationship diagrams, do you usually show all the relationships? Because I seem to have lots of them and my diagram is geting very messy.
Sample Pic attached, I didnt even fill in all of them in this diagram

4
Contributors
6
Replies
8
Views
10 Years
Discussion Span
Last Post by Leonarda
0

No, Not Always. If The Diagram Is Getting Messy, Then It Points Towards The Database Design Needing A Look At.

I've Checked Out The Sample Pic & My Thought Is That There's A Lot Of Pairings Of Player_ID & Team_ID. Maybe A Seperate Table With These Two In Would Rationalise Things A Bit.

Good Luck With The Website

0

I though about that(New diagram attached), but this means that my SQL queries are going to be much more complex, becasue I cant for example look for total goals scored by a player using just the playerId value on the Goals table, I would have to join 2 or 3 different tables to do that.

Attachments FootyStatDBsimple.jpg 69.08 KB
0

I Think The New Layout Is Better.

I Wouldn't Worry Too Much About An Extra Join In The SQL Query. So Long As The PKs Are Integers & You Use Clustered Indexes (Assuming You're Using SQL Server / Oracle...)

A Couple Of Other Ideas :

The YellowCards/RedCards Could Be Made Into One Table With The Inclusion Of CardType Field.

The Player Table Is Really Just A Person Table. The Person Only Becomes A Player When Associated With A Team. If You Only Want To Include Players & Not Others Like Managers/Coaches etc, Then Why Not Put The Player Info Into The TeamPlayer Table. This Will Reduce The Table Joins By 1

I Know It's Still Eraly Days, But You Haven't Included The Score In The Matches Table.

Also, What About Own Goals In The Goals Table !

0

I Think The New Layout Is Better.

I Wouldn't Worry Too Much About An Extra Join In The SQL Query. So Long As The PKs Are Integers & You Use Clustered Indexes (Assuming You're Using SQL Server / Oracle...)

A Couple Of Other Ideas :

The YellowCards/RedCards Could Be Made Into One Table With The Inclusion Of CardType Field.

The Player Table Is Really Just A Person Table. The Person Only Becomes A Player When Associated With A Team. If You Only Want To Include Players & Not Others Like Managers/Coaches etc, Then Why Not Put The Player Info Into The TeamPlayer Table. This Will Reduce The Table Joins By 1

I Know It's Still Eraly Days, But You Haven't Included The Score In The Matches Table.

Also, What About Own Goals In The Goals Table !

Cool.
I was thinking the score would be calculated from the Goals Table, but it might be simpler to include it your right.
The own goal thing seriously never crossed my mind:-O

0

Useful commentary - I Appreciate the facts ! Does anyone know where my assistant might be able to access a blank a form form to complete ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.