I'm quite new to relational databases and have been having a lot of trouble recently trying to understand an entity relationship diagram I've been given.
Here it is: Solicitor ERD (ERD is for a made up solicitor company)Image may be NSFW.
Clik here to view.
Basically my task is to take this ERD and write an SQL script to create the database, obviously filling in the tables with data I can make up. The SQL syntax isn't the thing I'm having a hard time with, it's simply understanding the cardinality in the diagram.
To me the terms '1 to 1', '1 to many', 'many to many' just don't click, I have no idea what they mean and how they affect where primary and foreign keys go.
I can take these tables and easily create relevant columns, for example I know the 'client' table will include something like 'client_name'. However, when it comes to, say, linking the 'client' table with the 'case' table, how do I know where foreign keys go?
Would the 'client' table contain 'caseID' from the 'case' table as well as the 'case' table containing 'clientID' from the 'client' table? or would only one table have a foreign key? It's things like this I just don't understand.
Sorry for the long post, if anyone could explain in plain english how I go about developing this ERD it would be most appreciated! I've been puzzled for two days now :(