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

Recommended Answers

All 6 Replies

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

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.

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 !

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.