So I was making an app storing a small amount of data. To store this data I'm using Core Data. As I learned about relational databases once upon a time I lied everything out in relationships. Now I'm considering to kick the relationships and extra tables out.
Say for instance you have cars belonging to brands. These brands ought to be put in a separate table. Then you would go putting an 1 to n relationship between Brand and Car. Adding cars to a brand would need an NSSet. It would be possible to look up all the cars of that brand with that NSSet.
Then again if I put everything in one table things would be easier to code. Using an NSPredicate I could easily look up all cars belonging to a peculiar brand. I'm asking this question because it gets more complicated introducing for instance makes. A brand has makes having cars.
The more levels you add the more interesting it gets in theory to use relationships. The code gets more complicated too. Then I start to wonder if that's so interesting if you have a small database. Imagine adding a make. You must first look up if the make already exists etc.
Say for instance you have cars belonging to brands. These brands ought to be put in a separate table. Then you would go putting an 1 to n relationship between Brand and Car. Adding cars to a brand would need an NSSet. It would be possible to look up all the cars of that brand with that NSSet.
Then again if I put everything in one table things would be easier to code. Using an NSPredicate I could easily look up all cars belonging to a peculiar brand. I'm asking this question because it gets more complicated introducing for instance makes. A brand has makes having cars.
The more levels you add the more interesting it gets in theory to use relationships. The code gets more complicated too. Then I start to wonder if that's so interesting if you have a small database. Imagine adding a make. You must first look up if the make already exists etc.