如何设计用户点系统数据库?

时间:2021-03-20 12:41:40

In my application ,there is two pointing system. coffeepoints and sandwich points. I am looking best approach to design database.

在我的应用中,有两个指向系统。coffeepoints和三明治点。我正在寻找设计数据库的最佳方法。

Coffee points :- When user purchase coffee, he will earn coffee points sandwich points :- When user purchase sandwich he will earn in sandwich points

咖啡点数:-当用户购买咖啡时,他将获得咖啡点数:-当用户购买三明治时,他将获得三明治点数

1 method :- Create a table, point_types to store points name such as coffe points and sandwitch points 如何设计用户点系统数据库?

方法:-创建一个表,点类型来存储点名,比如coffe点和sandwitch点

2 method :- use coffe_points and sandwitch points as field_name wherever points data stored.

方法:-使用coffe_points和sandwitch point作为field_name,用于任何存储点数据的地方。

如何设计用户点系统数据库?

Which one is best approach?

哪一种是最好的方法?

1 个解决方案

#1


2  

In a pure conceptual modelisation point of view the first solution is the way to go.

从纯粹的概念模型的观点来看,第一个解决方案就是方法。

It gives your model flexibility and answer to the case without breaking normal forms.

它使您的模型具有灵活性并能在不破坏常规形式的情况下对这种情况做出响应。

I wouldn't implement the second solution, till you would have to work on several sql query if your fonctionnality ever evolve (10% chance)

我不会实现第二个解决方案,除非您必须处理几个sql查询,如果您的fonctionnality发生变化(10%的可能性)

#1


2  

In a pure conceptual modelisation point of view the first solution is the way to go.

从纯粹的概念模型的观点来看,第一个解决方案就是方法。

It gives your model flexibility and answer to the case without breaking normal forms.

它使您的模型具有灵活性并能在不破坏常规形式的情况下对这种情况做出响应。

I wouldn't implement the second solution, till you would have to work on several sql query if your fonctionnality ever evolve (10% chance)

我不会实现第二个解决方案,除非您必须处理几个sql查询,如果您的fonctionnality发生变化(10%的可能性)