Kitchen database creation
luciep
-
isotope2000 Posted messages 17 Status Membre -
isotope2000 Posted messages 17 Status Membre -
Hello,
A few years ago I learned how to create a database, but unfortunately I don't remember how to do it anymore... I'm a bit lost actually.
I'll explain my project. I have quite a few recipes and I would like to create a database to also enter the ingredients I have in my fridge so that it can suggest recipes based on the ingredients I already have or the ones I want. I would also like to classify them by type of recipe (starter, main dish, dessert...), have recipes that can be prepared quickly, or other categories...
I hope I'm being clear. If not, feel free to ask me questions.
In my opinion, I need to create a table with the following fields:
- recipe name (varchar, required input yes, length 100)
- preparation time (varchar, required input no, length 10)
- cooking time (varchar, required input no, length 10)
- resting time (varchar, required input no, length 10)
- total time (varchar, required input no, length 10)
- number of servings (numeric, required input no, length 10)
- ingredients (varchar, required input yes, length I don't know)
I save it, and it tells me no primary key, should I create one? Yes I guess (I don't remember what that is for...).
However, this is where it gets complicated for me. I would like to have a list of ingredients with quantities, how can I do that? There was a dropdown menu thing (I don't remember how to do that), but I don't think it would work well in my case since I would only be able to choose one item I imagine. Any ideas?
After that, I will need to fill my table with my recipes.
How can I handle the ingredients I have at home? I would need to be able to delete or modify them regularly as needed (and if possible set expiration dates). I think I should create a new table with:
- ingredient name (varchar, required input yes, length 50)
- available quantity (varchar (to be able to enter grams or numbers), required input yes, length 10)
- expiration date (date, required input no)
Then I fill my table with what I have (which I update regularly)
And how do I make queries?
Thank you very much for your valuable help because I'm lost!
See you soon!
Lucie
Configuration: Windows / Firefox 51.0
A few years ago I learned how to create a database, but unfortunately I don't remember how to do it anymore... I'm a bit lost actually.
I'll explain my project. I have quite a few recipes and I would like to create a database to also enter the ingredients I have in my fridge so that it can suggest recipes based on the ingredients I already have or the ones I want. I would also like to classify them by type of recipe (starter, main dish, dessert...), have recipes that can be prepared quickly, or other categories...
I hope I'm being clear. If not, feel free to ask me questions.
In my opinion, I need to create a table with the following fields:
- recipe name (varchar, required input yes, length 100)
- preparation time (varchar, required input no, length 10)
- cooking time (varchar, required input no, length 10)
- resting time (varchar, required input no, length 10)
- total time (varchar, required input no, length 10)
- number of servings (numeric, required input no, length 10)
- ingredients (varchar, required input yes, length I don't know)
I save it, and it tells me no primary key, should I create one? Yes I guess (I don't remember what that is for...).
However, this is where it gets complicated for me. I would like to have a list of ingredients with quantities, how can I do that? There was a dropdown menu thing (I don't remember how to do that), but I don't think it would work well in my case since I would only be able to choose one item I imagine. Any ideas?
After that, I will need to fill my table with my recipes.
How can I handle the ingredients I have at home? I would need to be able to delete or modify them regularly as needed (and if possible set expiration dates). I think I should create a new table with:
- ingredient name (varchar, required input yes, length 50)
- available quantity (varchar (to be able to enter grams or numbers), required input yes, length 10)
- expiration date (date, required input no)
Then I fill my table with what I have (which I update regularly)
And how do I make queries?
Thank you very much for your valuable help because I'm lost!
See you soon!
Lucie
Configuration: Windows / Firefox 51.0
2 réponses
yg_be
Posted messages
23437
Registration date
Status
Contributeur
Last intervention
Ambassadeur
1 588
Hello,
I think you need to plan these tables:
- a recipes table, with an automatic numeric field serving as the primary key (without an ingredients field)
- an ingredients table, with a name field and an automatic numeric field serving as the primary key
- a fridge table, with an id_ingredient field, a quantity field, and an expiration field
- a composition table, with an id_recipe field and an id_ingredient field. This table will allow you to record the relationship between recipes and ingredients, maybe with the quantity of the ingredient required by the recipe.
I think you need to plan these tables:
- a recipes table, with an automatic numeric field serving as the primary key (without an ingredients field)
- an ingredients table, with a name field and an automatic numeric field serving as the primary key
- a fridge table, with an id_ingredient field, a quantity field, and an expiration field
- a composition table, with an id_recipe field and an id_ingredient field. This table will allow you to record the relationship between recipes and ingredients, maybe with the quantity of the ingredient required by the recipe.