0

I am relatively new to db design, so any help here would be appreciated. I am working on developing an iPhone app, and keep getting stuck, so I'm thinking my database design is junk. In my app, I have basically three items I need to pull from a db. A book title value, a chapter number value, and a segment content value(comprised of a number of different records) . The app simply displays a number of different short books. Inside each short book, they choose from which chapter they want, and then clicking on the chapter will load a detailview with a batch of related segments creating the readable content. So a chapter has many segments exclusively related to that chapter. A book has many chapters related related to that book, and there are several different books. For my db design, should each book be its own separate table? With columns for book_title, chapter_number, and segment_content? I'm basically just running into issues trying to output my data because it may not be organized all that well. Any thoughts or insights would be appreciated! Thanks

asked Mar 2, 2010 at 16:47

2 Answers 2

1

I know you are asking about Database design, but I would really recommend using Core Data for something as small was what you are trying to model. Then you don't have to worry about all the sqllite details you just deal with objects and that is it. The book is a good reference for all things iPhone, there are more Core Data articles at that link.

answered Mar 2, 2010 at 16:53
Sign up to request clarification or add additional context in comments.

4 Comments

Hey thanks for the insight. I have contemplated the core data route, but my only hangup is about the data source, where does the data come from? Right now, I have web content I put into a spreadsheet, that then went into an sql db that I am reading from my app. How does it work with core data? I understand how the object models work that they are more conveniently accessible, but my only question is about where I am going to get my content from, because there are thousands and thousands of lines :)
You face the same conundrum whether you're using Core Data or SQLite. At some point, you still need to import the data.
Ok, so a core data using app still retrieves its info from say an sqlite database? Its just a more convenient way to manage the importing?
he means you still need to import the data into "something" whether it is a database or an object model you still need to do the same loading either way. you could easily make a webservice call to get the data and create / update the objects, that is what I am doing.
1

Usually you have to create a table for each entity in your application. Your entities are Book, Chapter, Segment. So you have three tables, where row in Chapter references row in Book and row in Segment references Chapter and may be Book.

answered Mar 2, 2010 at 16:53

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.