Elle owns "eNZ Bikez" and operates a Retail and Repair eBike shop.
Elle has several staff and keeps a roster to make sure someone is in the shop at all times.
Staff are allocated RosteredTimes they are expected to be in the shop, and each Staff member will be allocated 0, 1 or many RosteredTimes. Each RosteredTime MUST be for one Staff member only (i.e. if they are on at the same time a separate record is made for each) and cannot be created unless it is allocated to a staff member.
Elle created a simple spreadsheet to manage this:
Elle has a limited number of car parks reserved for the staff and the company vehicle as well.
Staff may drive different cars to work so it is important that she knows if it is a staff car using one of the allocated spaces. Some staff do not own cars.
So the rules are
Staff can have 0,1 or many vehicles. Each Vehicle can belong to 0 (if it is owned by the business) or 1 staff.
We could create a SpreadSheet to show this
Staff Vehicle
Tui Ford JJ1234 Tui can come in one of 2 cars
Tui Mazda XYZ4321
Rose Suziki ABC1234 Rose has 1 car
Ford Transit QWE1234 This is the company vehicle so has no staff attached. This is an example of the 0 in the O| relationship
Sammy Sammy does not use a vehicle to get to work (e.g. may use a bus) this is an example of the 0 in the O< relationship.
So looking at it from a Database perspective, creating an ERD would look like
[Staff] -O| ----- O< [Vehicle]
Elle places her orders with suppliers of eBikes, and these are then assembled and sold to customers.
Suppliers receive Orders for Products. Information to be stored includes the Supplier’s name, description and price. She also keeps track of the Supplier name, phone number and email, as well as the supplier address for the order and any special notes.
KEY: Entity, Attribute, Relationship between Entities
The following relationships apply:
Each Order is placed with one Supplier, but each Supplier can have many Orders placed with them over time. For each Order there can be one or more Products (Different types of eBikes) bought, and each Product can be on many Orders.