If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Creating a Database for Store Chains, Goods, and Pricing

Started by towertech, Aug 22, 2023, 07:05 AM

Previous topic - Next topic

towertechTopic starter

The subject of discussion is the creation of a database that includes a chain of stores, where the stores are located in specific cities. In these networks, there are goods available, such as milk, which can come from different vendors like LLC Zalessky farmer or JSC EZHK. The prices of these goods may vary across different networks and even within the same network in different cities.

The challenge lies in determining how to store the prices in the database in a way that allows for easy retrieval with queries. Complicating matters further is the fact that the product itself is not a simple entity; it needs to be represented by a SKU (Stock Keeping Unit). This means that the price will depend on various parameters of the product.

To illustrate this problem, I have provided an example of a specific product in the database, but I am struggling to devise a scheme for handling "products with SKUs."
  •  


friv10games

Here's an example of how you can structure your database:

1. Store Table: This table will store information about each store in the network, including the store ID and location details.

2. Vendor Table: In this table, you can store information about each vendor, including the vendor ID and other relevant details.

3. Product Table: This table will contain details about each product, including the SKU, product name, and any other attributes specific to the product.

4. Price Table: This table will store the prices of each product from different vendors in different stores. It will include columns like store ID, vendor ID, SKU, and price.

By structuring your database in this way, you can easily retrieve prices for a specific product across different networks or within the same network in different cities. You can accomplish this by executing SQL queries that join the relevant tables using common keys (such as store ID, vendor ID, or SKU).

For example, if you want to retrieve the prices of a specific product (identified by its SKU) across all stores in the network, you can write a query that joins the Price Table, Product Table, and Store Table on the appropriate keys. This query will return the prices along with store and product information.

Similarly, if you want to compare prices of the same product from different vendors within a specific store or city, you can modify the query to include the Vendor Table and filter by the desired store or city.

5. Category Table: This table can store the categories or types of products. Each product can be associated with a category ID in the Product Table. This allows you to group similar products together for easy retrieval or analysis.

6. Attribute Table: If your products have different attributes (such as size, color, weight, etc.), you can create an Attribute Table to capture these characteristics. Each attribute can have a unique ID and a name. You can then create a junction table to establish a many-to-many relationship between products and attributes.

7. Product Attribute Junction Table: This table will store the relationships between products and attributes using their respective IDs. It will provide the ability to associate multiple attributes with each product.

By including these additional tables in your database schema, you can store more detailed information about each product. For example, if a product has attributes like size and color, you can assign specific values for each attribute in the junction table.

When querying the database, you can join the necessary tables to retrieve information about products, their attributes, and their prices as per your requirements.

Overall, this expanded schema provides a more comprehensive representation of products, allowing for easy retrieval and analysis based on various attributes, while still maintaining the relationship with stores, vendors, and prices.
  •  

meganiams

Do you require the network parameter for any specific purpose?
If not, you can simply visualize everything as individual sales points, each of which possesses an address, contact information, and its own legal entity owner. Furthermore, each point of sale has its unique price display. However, if your sales points are unrelated (meaning each store operates its own 1C business system with non-overlapping nomenclature IDs), it is important for each store to have its distinct nomenclature.
For instance, milk at point of sale 1 is not the same as milk at point of sale 2 due to differences in expiration date or manufacturer.
  •  

rcezlilyq

There are various Types of Prices available, such as the commodity item - Milk (which is also Milk in Africa), and the different "options" of Milk, like "Manufacturer," "Fat percentage," and so on.

To begin with, we have the "Price type" - "Basic," which can be easily calculated based on the purchase. After that, we introduce other types of prices (Points, Networks, Branches, "Prices for a store in Bobruisk," and so on). An important aspect of each price type is the calculation rule, which can either be dynamic or based on another price plus a fixed percentage (or any other algorithm). The essence of the calculation rule is to assign or calculate the price based on incoming data such as the Product, its options, network point, and so forth.

Each product has its own specific type of price, depending on its options and/or networks. For a product (and with options, it becomes a SKU), a particular type of price is assigned for its calculation.

In summary, it is crucial to establish a common NSI (National System of Interconnectedness) for the entire IT field. Even if each store has its own database and "nomenclature ID," it is necessary to introduce common attributes to ensure synchronization. This applies not only to "price types" and "price calculation rules," but also to other aspects within the IT domain.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...