数据库的结构
我正在尝试构建一个数据库以实现最佳使用。但我不知道如何实现这一点。这是我将拥有的
类别,其中包含许多产品以及每种产品的计数
例如
餐厅将是该类别,产品将是计算机系统、收银机,并且每一种产品都有一个计数,所以也许会有2个收银机和3个计算机系统等等。另一个类别可能是酒吧,它可能有也可能没有相同的产品。然后,用户可以选择 2 家餐厅的套餐,该套餐可能有获得所有产品的折扣率。
如果我能得到一些帮助,我只需要构建 ERB,谢谢
I am trying to structure a database for optimal use. But I have no idea how to make that happen. Here is what i will have
A category which will have many products and a count for each on of those products
For example
Restaurants will be the category and the products will be the computer system, cash register and each one of these products has a count so maybe there will be 2 cash registers and 3 computer systems and so on. Another catagory might be a bar, which might or might not have the same products. Then the user has the option of choosing a 2 restarant package which might have a discount rate for getting all the products.
I just need to structure the ERB if i can get some help, Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
机构
产品
Estab_Prod_Bridge
折扣
注意:
Establishment 是一个很长的词,我只是在这里举例。您可以轻松地将其替换为位置/地点、地点或您认为合适的任何其他内容。
根据数据的变化,我添加了折扣表,认为购买不同数量的产品会有不同的折扣。
示例: 80% 的购买产品可享受 5% 的折扣,但 100% 的购买产品可享受 10% 的折扣。
Establishment
Product
Estab_Prod_Bridge
Discounts
Note:
Establishment is a long word, I just used it here for example. You could easily replace it with location/loc, venue, or anything else you see fit.
Depending on how the data changes, I added the discount table, thinking there would be different discounts for variant amount of products purchased.
Example: 80% of products purchased would yield a 5% discount, but 100% of purchases might yield a 10% discount.
PRODUCTS
CATEGORIES
PRODUCT_CATEGORIES_MAP
PRODUCTS
的外键)CATEGORIES
的外键)这将允许您将一种产品关联到多个类别,但不允许重复。
PRODUCTS
CATEGORIES
PRODUCT_CATEGORIES_MAP
PRODUCTS
)CATEGORIES
)This'll allow you to associate a product to more than one category, but not allow duplicates.