• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

How to create a good ER diagram about a Bike Component Life Viewer scenario

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to build my app database and I'm new to the DB world, so I have doubts about my ER model and it's relationships.

This is an app that connects to an API from Strava to check your bike workouts and track the life (durability) of your bike components depending on the Kilometers you have traveled.

The information I want to save is the Users and their Bikes (Only one, but maybe I'll permit more than 1 bike).

From Users, I want to store:
> ID
> Name
> Surname

And from Bikes, I need to know if the bike is a Mountain Bike, if it has tubeless tires and if it's single chainring.
> ID
> isSingleChainRing
> isTubeless
> isMTB

Also, the bike have diferent components, so I created a table for them (Chain, tyres, etc...). I need to know when was the last time the user set that component value to 0 (imagine the user replaces the chain, so he can reset to 0KM again.)
> ID
> component name
> last_reset

So I've thought in this ER diagram, but I don't know if the relationship between the tables Bike and Components should be n:m instead of 1:N. As I understand it, a Bike, can have a lot of components, but a component can only be of 1 bike. Or if the components tables has fixed values, each component can be assigned to a lot of bikes as well?

If the correct relationship is n:m should I create a linking table? I heared you need an extra table to link that n:m relationships.


Thanks for your help.
Well THAT's new! Comfort me, reliable tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic