I have an odd relationship and I would like to get some opinions on the best way to handle it.
3 tables:
1. WAREHOUSES.
2. PROD_CATEGORIES (One in One-to-many with PRODUCTS)
3. PRODUCTS (Many in One-to-many with PROD_CATEGORIES )
Usually, about 100 products are assigned to each category.
There are over 1000 warehouses. When allocating products to warehouses, typically you would assign the product category to the warehouse and all the products in that category would be stored in the assigned warehouse. Occasionally, there are exceptions: A product category will be assigned to a warehouse, and 3 or 4 individual products will be excluded and not stored in the warehouse.
When designing the database, is it better to create the Many-to-many relationship between Warehouse-Products, or is it better to make it between Warehouse-Prod_Categories and maintain another Many-to-many relationship between Warehouse-Product_Excepti ons.
The former will be simpler to store and easier to make queries, but will bloat the database. The later will be more complicated to store and query, but it will require much less storage.
Only one guy maintains this database and he is fair at writing queries.
What do you think is the best way to set up these tables?
Thanks,
Adam
3 tables:
1. WAREHOUSES.
2. PROD_CATEGORIES (One in One-to-many with PRODUCTS)
3. PRODUCTS (Many in One-to-many with PROD_CATEGORIES )
Usually, about 100 products are assigned to each category.
There are over 1000 warehouses. When allocating products to warehouses, typically you would assign the product category to the warehouse and all the products in that category would be stored in the assigned warehouse. Occasionally, there are exceptions: A product category will be assigned to a warehouse, and 3 or 4 individual products will be excluded and not stored in the warehouse.
When designing the database, is it better to create the Many-to-many relationship between Warehouse-Products, or is it better to make it between Warehouse-Prod_Categories and maintain another Many-to-many relationship between Warehouse-Product_Excepti ons.
The former will be simpler to store and easier to make queries, but will bloat the database. The later will be more complicated to store and query, but it will require much less storage.
Only one guy maintains this database and he is fair at writing queries.
What do you think is the best way to set up these tables?
Thanks,
Adam
Comment