I am in the process of setting up tables in my database for my first project. (Exciting!)
I am having a hard time deciding what types of relationships I need to set up.
I have the following basic tables planned.
products
-----
id
product_name
product_details
product_url
product_img
category_id
business_id
categories
-----
id
category_name
category_description
category_slug
businesses
----------------
id
business_name
business_phone
business_address
business_city
state_id
business_zip
state
-----
id
state_name
Where I am stuck is deciding what types of relationships to set up.
Each product can only belong to 1 category, and can only belong to 1 business
As for the business table I am wondering if its a better idea to break out the city and zip-code into separate tables.
I want to be able to retrieve products by category and city , For example: 'shoes' in 'los angeles', or just 'shoes' or all products in 'los angeles'
Can anyone offer some insight or share their experience. Since I am getting ready to set up my tables I'd rather work out those scenarios now then half way through development.