Relationships Extended
Activity - Relationship Practice
In order to recognize relationships I have created some tables and exercises to complete
Resolve the relationships by downloading the one to many examples sheet and then uploading it into draw.io. Try to also fix the typos :-) |
Answers at bottom of page
|
Problems Many to Many
Recently we looked at a Patient Database and the borrowers database.
Each Patient could have two ethnicities (ethnicityID1, ethnicityID2) This is fine, but what if the situation demands that a patient can have more then 3 ethnicities? What if the situation demands that Pokemon could have more then one type? What could we do? How would we display this? Should we add more ID fields? |
Resolving Many to Many Relationships
Consider this Library
Books can be hired out by many customers. Customers can also hire out many books. How should we resolve this? Well the answer is to create a new table... <-----------Check this out. A Customer may have many Issues. An Issue may only have one Customer. A Book may have many Issues. An Issue may only have one Book. This resolves the Library situation. :-) |
Activities 2 - Resolve the Many to Many
For the assessment you will have to resolve a many to many relationship.
Although it will be quite easy to recognize and possibly pointed out you still will do well to learn how they work. Complete and resolve the tables in draw.io activity sheet. |
Answers at the bottom.
|
Friends borrowing Items
Your friends constantly always want to borrow your stuff.
We are going to create another table for the Items people borrow. We should Item Name, Worth, Type, brand/creator, condition, date brought We also need to record down how long people are borrowing items for. Date borrowed, Date Returned, Has it been returned, Due Date Remember a friend can borrow multiple items, and a item can be borrowed multiple times. Make sure you have 6 items, and that 4 friends have borrowed them. |
|
|