YEAR 12 DIGITAL TECHNOLOGY
  • Home
  • Website
    • Learn Basic HTML
    • Learn Basic CSS
    • HTML/CSS Advanced
    • Photoshop Level 2
    • Recap and Review
    • Conventions of Web Design
  • Programming
    • JavaScript Recap
    • JavaScript and HTML
    • Functions, Parameters and Returns
    • Learn Arrays
    • AS91896 - Brief
  • Databases
    • Intro to Access
    • Relationships and lookups
    • Relationships Extended
    • Queries and Reports
    • Mail Merge
    • Car Sales
    • Documentation x5
    • Importing Data
    • AS91892 - Develop a Database
  • External
    • Computer Science External
    • 2025 Exam Update
    • Machine Learning
    • Natural Language Processing
    • Neural Networks
    • A.I. Contexts
    • AI content Creation
  • Freyberg Digital

Relationships Extended

For this lesson you should be able to:

  • Revise Unique ID's and relationships between tables
  • Resolve Many to Many Relationships
  • Practice database design


A Book may have many Authors...

An Author may have many books.
Picture

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 :-)
one_to_many_examples.xml
File Size: 3 kb
File Type: xml
Download File

Hint: You will need to right click and then click save link as
​Then you will need to drag it into draw.io


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?
Picture

Resolving Many to Many Relationships

Picture
Picture
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.

many_to_many_activities.xml
File Size: 3 kb
File Type: xml
Download File

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.
Picture

many_to_many_answers.jpg
File Size: 146 kb
File Type: jpg
Download File

one_to_many_examples_answers.jpg
File Size: 227 kb
File Type: jpg
Download File

Powered by Create your own unique website with customizable templates.
  • Home
  • Website
    • Learn Basic HTML
    • Learn Basic CSS
    • HTML/CSS Advanced
    • Photoshop Level 2
    • Recap and Review
    • Conventions of Web Design
  • Programming
    • JavaScript Recap
    • JavaScript and HTML
    • Functions, Parameters and Returns
    • Learn Arrays
    • AS91896 - Brief
  • Databases
    • Intro to Access
    • Relationships and lookups
    • Relationships Extended
    • Queries and Reports
    • Mail Merge
    • Car Sales
    • Documentation x5
    • Importing Data
    • AS91892 - Develop a Database
  • External
    • Computer Science External
    • 2025 Exam Update
    • Machine Learning
    • Natural Language Processing
    • Neural Networks
    • A.I. Contexts
    • AI content Creation
  • Freyberg Digital