Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8738823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:48:48+00:00 2026-06-13T10:48:48+00:00

I am designing a database which relates products and the stores which carry them.

  • 0

I am designing a database which relates products and the stores which carry them.

Many of the stores will carry the same products as each other.
As well, obviously, there will be many types of products per store.

I tried to do some research on the best way to make the table but all the resources i read online are so technically exhausting and logically formalized that it takes away from ability to intuitively understand what they’re saying.

I keep hearing people say that you should use a junction table, but I dont understand how that would be applicable in my case.

What i wanted to do was create one row for “Store” category, and then have separate rows “product_1”, “product_2” “product_x” etc. where i would list each of the products the store sells, but i’m not sure if that’s good form.

Furthermore, some stores might have 50 products, meaning i would need 50 rows. I’m not sure if there’s a way around this or not.

Ultimately, my question is, by standard conventions, what is the ideal database structure for this kind of relationship?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:48:49+00:00Added an answer on June 13, 2026 at 10:48 am

    I would have three tables. One for stores [name, id & info]. One for items [name, id & info]. One to link the two [relation id, store id & item id].

    This would enable you to change store and item data without having to update your relationships table.

    Thus if you want items in a store you search the relation table for items that match the store id. Vice versa if you want stores that have an item, you search the relation table for the item id and return the store id’s that carry that item.

    Bare necessities Example:

    STORE:
    *********************
    storeID    storeName
    *********************
    1          store1
    2          store2
    3          store3
    
    ITEMS:
    *********************
    itemID    itemName
    *********************
    1          item1
    2          item2
    3          item3
    
    RELATIONS:
    *********************
    storeID    itemID
    *********************
    1          1
    1          2
    2          1
    2          3
    3          2
    3          3
    

    Thus to find which items store1 has you would get the storeID which is 1, and search the relations table to find which rows have a store ID = 1, which would return rows one and two, which tells you that store1 has items 1 and 2. Similarly to find which stores cary item2 you would get the ID of item2, which is 2, search the relations table for itemID = 2, which would return rows two and five, which tells you that stores 1 and 3 have item2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am designing database for jewellery website in which a lot of products will
I'm designing a database which will store information about some artists. These artists can
i am designing a database which will be used for a website used to
I am designing a table in the database which will store log entries from
I'm just designing the schema for a database table which will hold details of
I am designing a database in Mysql which will be filled with quite large
I am designing a database for a site which will be heavily datadriven with
I'm designing a database application which stores simple contact information (First/Last Name etc.) and
I am designing a database to store golf scores and other statistics about each
I'm designing a database table which will hold filenames of uploaded files. What is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.