1

I've got a Problem with the structure/SQL technique I am currently using (SQLite with Java).

enter image description here

I got my Client table and Project table running and working with all its keys blabla. But now I am trying to setup the table for the Pit objects. And the Problem is that I don't know how many x and y values the Pit objects has got. Maybe the next few Objects just got 5 and then soon there's coming another with 10 (and I don't want to keep changing the tables meta data). I thought about different ways to solve it. Like an extra table for each Pit and so on. But I guess there's a smarter way. I just don't get or a better technique I can use to get rid of this problem. So I hope someone can tell me some Keywords that I've to look up or a way I just don't get so far.

msrd0
  • 7,816
  • 9
  • 47
  • 82
Max Wolf
  • 11
  • 3
  • Welcome to SO! If you need to post a picture, upload it somewhere and put the link to it in the question, someone with higher rep will include it for you ;) – BackSlash Oct 06 '14 at 13:25
  • 2
    One way is to store the x and y values in a separate table with a unique identifier. Then you can create a many-to-many relationship (http://en.wikipedia.org/wiki/Many-to-many_%28data_model%29) between the individual x and y value records and the Pit records. – Zibadian Oct 06 '14 at 13:36
  • 1
    sqlfiddle is fun too – Strawberry Oct 06 '14 at 13:37
  • If you know that you never need to handle individual x/y coordinates in the database, it might be appropriate to store the coordinate arrays as a blob. – CL. Oct 06 '14 at 15:17
  • Thanks cl that was the only good solution that came in my mind too. but several ppl told me that this is very bad style to do such things. But i ll definatly do this if theres no "better" way to do this. – Max Wolf Oct 06 '14 at 15:59

0 Answers0