Relevant question: Android: SQLite one-to-many design
This is my first post on here, and it's also my first time dealing with databases. If there are any clarifications, or corrections I can make, please let me know.
I'm trying to set up an SQLite database to better store items collected from an RSS Feed. I'm trying to have a 3 table set-up. It looks like this:
Table 1: The Channel Table (items stay in constant order)
_id | Feed Location | Channel Title | Channel Description | ...
Table 2: The Item Table (The items should be stored in chronological order for ease of access and deletion)
_id | Item Title |...| Channel ID | ...
Where Channel ID has the row number that the Channel the item is part of is located.
That part is pretty simple, but here's my problem. I want to be able to query items by the categories that are relevant to them. They're included in the XML that'll be parsed, and it'd be great to sort by those values. So I started to set up another table, and implement the same one-to-many relationship described above, but then I ran into a problem. Because the id's of those items are likely to change when more items are parsed, the id's aren't static, and I can't have the categories link the way I did earlier. Also, another challenge I found was the fact that each category might've ideally needed to point to many different items because the Items' could've been relevant to the same Category.
And that's where I'm stuck.