Databases and big data · A level · OCR H446 1.3.2, AQA 7517 4.10.1, Eduqas A500QS 2.5 · about 55 min
Model the data before building anything: entities, attributes, entity descriptions and the degree of each relationship, drawn as an entity relationship diagram.
[1 mark]In a data model, what is an entity?
[1 mark]A team owns many robots, and each robot belongs to exactly one team. What is the degree of the relationship from Team to Robot?
[1 mark]In an E-R diagram of that relationship, where is the crow's foot drawn?
[1 mark]How is a many-to-many relationship between Student and Robot implemented in a relational database?
[1 mark]In the entity description Robot (RobotID, Name, Colour, TeamID), which attribute should be underlined?
[1 mark]A sample of bookings shows no student has booked more than one robot. What can you conclude?
Each list below holds pairs (left, right) taken from the club's records. Write a function degree(pairs) that takes one list of 2-tuples and returns a string: "one-to-one", "one-to-many", "many-to-one" or "many-to-many".
- The right side is many if any left value appears with two or more different right values; otherwise it is one.
- The left side is many if any right value appears with two or more different left values; otherwise it is one.
- The string is the left side, then -to-, then the right side.
Call it on each list and print four lines, in this order, exactly like this (with the degree your function returns):
The robot does not move.
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
teams_robots = [("Hawks", "Ada"), ("Hawks", "Bolt"), ("Owls", "Cog"), ("Owls", "Dot")]
students_robots = [("Amir", "Ada"), ("Beth", "Ada"), ("Amir", "Cog"), ("Chen", "Bolt"), ("Beth", "Dot")]
robots_chargers = [("Ada", "C1"), ("Bolt", "C2"), ("Cog", "C3"), ("Dot", "C4")]
runs_robots = [(1, "Ada"), (2, "Ada"), (3, "Bolt"), (4, "Cog")]Plan your program here, then type it in and press Run.