This question might be very basic, but I have watched some database design videos and still confused, so thought I would ask you guys for direction related to design.
Hypothetical example:
A database holding details of all the apartments in an apartment block, resident details and the food contents of each apartment.
To be able achieve various search results. For example:
What apartments have vegetables, what vegetables? and how many of each?
My initial thought path is to have the following tables:
Table: Apartment_block: Fields: ID, block_name
Table: Apartment_number: Fields: ID, apartment_number, name_of_resident
Table: Food_item: Fields: ID, product_category, product_name, qty
But am struggling in my head with the relationships.
For example: Would I be able to create a record by Adding an apartment and then in the same action, add what foods and quantity are in that apartment?
Or would I need to add the foods first, and then select the Apartment and add quantity of each food item in the Apartment?
Do I actually need more tables?
table design and relationship question
-
- Veteran Member
- Posts: 90
- Joined: 2015-11-23 01:02
Re: table design and relationship question
You should add first your main table and later on you should then start with the children tables. After you create the children tables then you should incorporate those foreign fields into the main table. After you do that Appgini will create "The Relationship" for you.
Does it makes sense to you?
Does it makes sense to you?