![]() |
Database structure
I have never done a database before and have no idea where to start reading for these questions but I think the documentation at trolltech is enough if I just get up a layout of the database.
So the problem is that I want to make a database wich stores recipes that have a name, a category and x ingredients. I can do it by having like 20 fields for each recipe but I have a feeling you can do it much easier if you link it to another field or so! Any ideas? Yours, |
Re: Database structure
Maybe you can use three tables:
RECIPE(id, name, category) INGREDIENT(id, name) RECIPE_INGREDIENT(recipe_id, ingredient_id, amount etc...) |
Re: Database structure
i think that two tables will be enough
RECIPE(uniq d, name, category) INGREDIENT(id, name) where id will be id of recipe(not uniq) |
Re: Database structure
You should definitely study a bit about databases and database design before you start. It might first sound easy to work with just one or two tables but going with a properly normalized table design is the way to go.
The net is full of information about database basics, google is your friend. But here are some pointers to start with: http://en.wikipedia.org/wiki/Database_normalization http://dev.mysql.com/tech-resources/...alization.html |
Re: Database structure
I'll start reading, thanks for the links!
|
All times are GMT. The time now is 10:42. |
vBulletin® Version 3.8.8