• 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

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

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


https://imgur.com/a/JCeRrZG

Thanks for your help.
 
Evil is afoot. But this tiny ad is just an ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!