I’m designing a database for a franchiser. My skill level is intermediate at best (I just work in the franchiser’s office). This database must define store locations and franchisees. So I know I will need a “store” table and a “franchisee” table. The “store number” will be the primary key in the store table. One franchisee can own multiple stores. I figured I could just assign a “Franchisee ID” as a primary key in the franchisee table to like franchisees to stores. Here’s my issue: Each store can be owned by up to 4 franchisees. So I’m stuck on how to define all that. I’m not sure I can do multiple franchisee ID’s and even if I could, often, stores are only owned by 1 or 2 people. That means many blank fields. Also, I’m unsure of how it will all come together when I need to pull queries. Any suggestions on the most logical way to do this?
I’m designing a database for a franchiser. My skill level is intermediate at best
Share
Okay, so for the stores, you same to have a valid primary key already – the StoreNumber. So you “Store” table will be something like
Then you have another table Franchisee which will hold the franchisees and their info – primary key will be the FranchiseeID
To join those two, since you can have more than a single owner, you need a StoreOwner table, something like this:
The combination of both fields
(StoreNumber, FranchiseeID)will be your primary key in StoreOwner.That way, you can have any number of owners for a given store.