Our last seminar was about databases, more specifically entities and the relationships which they have with each other. An entity is can be anything which data can be collected, these are normally put into tables. The relationship between these tables (entities) there are three types of relationship which tables can be connected by, these are:
- One to One
- One to Many
- Many to man
One to One
One to one relationship is a relationship where they can only reference one other entity. For example a manager of a branch can only manage one branch and a branch can only be managed by one manager. This is how one to one works and to show this when creating them you show a solid black line.
One to Many
One to many is similar however only one of the entities can reference many other tables however the tables which they are referencing can only be joined to one other entity. An example of this is a football team can have many football players however the players can only have one football team.
Many to Many
Many to Many is where two entities can have zero to many references to other tables. An example of this is when a student can be studying zero to many subjects, and a subject can have zero to many students. To show this it will be a crow like foot at both ends of the line.