I am taking a course to become a Java developer.
The course involves using databases but we never really design any, unfortunately.
Most of the time we get pre-made databases and we have to implement code on it to Insert, Update, Read or Delete data.
But when my final test comes, chances are I will be making something that involves a database and therefore I want to try designing a few smaller ones to get the hang of a designing since I noticed that a good database design makes a lot of difference when writing the code to work with it.
I hope these types of questions are allowed here and that it's not going to be too broad.
This is a small design I made for something a simple as
- There will be multiple clubs.
- Each club will have multiple members (obvious)
- A member cannot be part of multiple clubs
- A member can have multiple phonenumbers and email addresses
- A member can only have one address
- An address can belong to different members (couples or siblings)
My biggest confusions:
If I want to add a column in
Clubthat describes the owner, who will also be a member, what is the best approach without having the
same member listed twice?
Should I put all my tables on the automatic increment of an id or would this be a bad idea? (benefits/downsides?)
If I add foreign keys in the foreign keys tab, will these automatically correspond to the correct table or do I have to add
these to the columns also? (see picture 2)
And my probably noobiest question at all… Do I put the foreign keys of
linking to a person_Id or should I put phoneNumber and email Id's in
the person table?
(My apologies for the language in the pictures not being English, I hope this isn't too much of a problem)