This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Murach's Java Programming and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Lists inside SQLite  RSS feed

 
Sunny Rodriguez
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am creating an application that allows you to log the days you do a particular exercise. I am using SQLite to store each Exercise in a table that has attributes such as Sets, Reps, Weight. What I am confused about is how to store the dates. I want to store the dates so that when you click View Summary of an Exercise, you will see a list of all the days that you did the exercise and how many sets, reps, and weight. To store the dates I figured I would have to add a new column to the table using ALTER command and make the date the name of the column but then that would be inefficient.

I thought about storing objects, tables, and arrays inside of SQLite but I haven't seen any finite examples, if that. I thought about storing all the attributes inside of a custom Exercise object that would then be store in internal memory but I like the idea of a database to store the info.

What is the best way to store the dates?

Thanks

Edit:
After doing some research I realized I could create a new table and just make a column that stores an ID of the exercise and then another column that has the dates. Then I could just perform a SELECT to get only certain exercise.
 
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!