Project method suggestion

Hi to all
i need your suggestion about one project i want to make and will use database / Sql

Lets say that i have 5 racks and i want to place in each rack some products.
i want to store in the database the product code and the number of the rack that is stored so i can make a search based on the product code and find the Rack that is stored.
also i want to remove it quite often from the rack

should i make a Database with one Table and add each rack number in columns
or
make a Database with tables for each rack ?

i will add and delete many entries each day (if that has something to do for the best method i should follow)

thanks in advance

Ps : Sorry but later i read that this forum is dedicate for Microsoft sql server only.

One option would be to have 3 tables.

  • Products
  • Racks
  • One for storing product mapping with Rack.

you may get better options by experts here.

1 Like

hi

hope this helps

in my opinion

it is better to have one table

Becomes easier to query and maintain

1 Like

No and NO.

You will need a "racks" table and a "products" table.

(I tried to use /asterisk and asterisk/ for comments but didn't work, forced to use #.)

"racks" table will have columns like:
rack_id #unique identifier for a rack
name #if applicable
description
status #active/inative/etc
capacity #if applicable
etc.

"products" table will have columns like:
product_id #unique identifier for a product
name #product name
status
description #product description
etc.

Then you will need an "intersections" table named whatever you prefer: racks_products, etc., that will store what product is stored in what rack.

intersections:
rack_id
product_id
primary key is {rack_id, product_id} or {product_id, rack_id} whichever is best for your lookups
date_added
quantity /* if applicable */
etc.