Java & Database android app

Thread Starter

geoffers

Joined Oct 25, 2010
500
Thanks chaps,

Advice shall be taken! The text file idea was more in ignorance than any thing else, I thought I could use it to hold lists of things to be added to ie milk yields.

I'm going to read up more on databases tonight, but would I use one table to hold a list of my animals and unchanging data , then have another table for each animal with yields , feed consumption etc ?

My database usage to date has been very basic :)

Cheers Geoff
 

wayneh

Joined Sep 9, 2010
18,111
Or is it have a table called yields, a row for each cow and add a column each day?
Cheers Geoff
You'll have several tables linked together by relationships (ie. relational database). For instance, each cow will have an identifier. Your table of milkings will have tons of records - all cows at all milkings over time - but each one of these records will contain the identifier for the individual cow appropriate to that record. The database software makes it trivially easy to pull up the complete milking history for each cow, drawing on the dataset that includes data for all the cows. As @joeyd999 described earlier, data that are specific to the cow would probably all reside in a table containing the similar data for all cows. Like a cow directory with addresses and birthdays, and so on.

Database design is a little like playing checkers. It's not hard to get started but becoming an expert takes a lot of experience. There's more than one way to accomplish things and it can be confusing which to choose. I think beginners tend to want to put too much into each table and keep down the number of tables. An expert is more likely to have lots of tables that are very easy to understand on their own. For instance in a genealogy database you might create a table of weddings, with all the details of time and place and participants, instead of trying to include all this wedding-specific data into the records of the individuals involved. It's much cleaner and easier to figure out in the future.
 
Last edited:
Top