lundi 29 décembre 2014

How should I structure my SQLite for a Public Transport API?

I'm making an Android App to get the times of a public transport network.


I first get the lines list, where each line contains some directions (not always 2).


For each line, then for each direction, I get the stops list.


So I don't really know how to structure my SQL database.


My first thought is to do



  • a Table containing the Lines

  • a Table containing all the Directions, and to get a Line's direction I would do a SELECT with the Line Id.

  • a Table containing all the Stops, and to get the Stops I want I would do a SELECT with the Line and Direction Id.


Is it a good idea ? I really don't know SQL(ite), so I don't know the good ways to do a database. I know we can "link" rows between tables but can I link a Line to more than one Direction ? (don't read a boy'sband name here…)


Thanks. BTW, i'm not english so I hope you'll understand all of this.


Aucun commentaire:

Enregistrer un commentaire