电子商店POS系统数据库设计 [英] Electronic shop POS system database design

查看:109
本文介绍了电子商店POS系统数据库设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Quote:





我正在为电子商店创建POS系统(电话,电脑,Xbox,手机套,手机充电器......等)



我在数据库中有一个名为资料的表格:



-MID

-MaterialBarCode

-category

-MatialName

-QuantityAvailable

-boughtPrice

-SellingPrice

-profit

-DataMa

-Ml

-Invoices_ID

到目前为止,每件事都很好,我的问题是:



如何添加手机当手机有条形码编号并且还有IEMI编号(每部手机的唯一编号)时的材料。



这样我就无法将IEMI编号添加到材料,因为这样我就需要在一条记录中添加每一部手机。



在同一条记录中添加相同手机的最佳方式是什么:



条码----类别----材料名称----数量

1111 -----------------电话 - ----------------- iphone x --------------------------- 5


并为每部手机添加IEMI号码,







我尝试过:



引用:

我现在拥有的是另一张IEMI表:



-barcode

-IEMI
每次用户插入手机时,他都会从datagridview中为每部手机添加IEMI号码。



我现在拥有的就像这样< br $>


材料表:



条码----类别----材料名称----数量

1111手机iphone x 5

IEMI表:



条码--------- - IEMI

1111 111111

1111 111112

1111 111113

1111 111114

1111 111115

但我认为还有更好的方法。我需要你的建议..谢谢你。

解决方案

听起来你刚开始创建一个完整的跟踪系统,所以你的公司可以告诉你他们把每个IEMI卖给谁。否则,为什么要跟踪单个IEMI号码?



如果是这种情况,您可能希望将表分开以完全标准化它们。在这种情况下,根据您的描述,您需要类似下表:



- 类别:ID,CategoryName



- 条形码:ID,条形码类型



- 材料产品:ID,ProductName,CategoryID,BarcodeID(使用的条形码)对于该产品)



- 购买:ID,SupplierID [来自其他表格的ID],PurchaseDate,MaterialID,数量,价格



- IEMIs:ID,PurchaseID,IEMI



- 销售:ID,IEMI_ID,日期,SalesPrice



...

你也可能有一张顾客餐桌。



从上面你可以跟踪一个最终IEMI回到原来的购买,除非我错过任何东西。



把所有东西放在一张桌子上,就像你似乎根据你的问题措辞做的那样,是一个良好的学习经历,但很快就变得完全无法管理,因为你意识到。这会让你头疼。虽然以上看起来像是很多工作和学习,但最好尽快这样做,最终消除大量的工作。



祝你好运!



(PS - 我将'材料'重命名为'产品',因为它更好地描述了你的意思(除非我错过了别的东西))

Quote:



I'm creating POS system for electronic shop (phones , computers ,xbox , phones covers , phone chargers ..., etc)

I have table in database called materials:

-MID
-MaterialBarCode
-category
-MaterialName
-QuantityAvailable
-boughtPrice
-SellingPrice
-profit
-DataMa
-Ml
-Invoices_ID
Every thing is good until now, my problem is:

how can I add phones to the materials when the phones have barcode number and also have IEMI number (unique number for every phone).

In this way I can't add the IEMI number to the materials because in this way I'll need to add every single phone in one record.

what is the best way to add the same phones in the same record like :

barcode ---- category ---- MaterialName ---- quantity
1111 ----------------- phones-------------------iphone x ---------------------------5

And add the IEMI number to each phone,



What I have tried:

Quote:

what I'm have now is another IEMI table :

-barcode
-IEMI
And every time the user inserts phones he will add the IEMI number for each phone from `datagridview``

what I have now is like this

materials table :

barcode ---- category ---- MaterialName ---- quantity
1111 phones iphone x 5
IEMI table:

barcode ---------- IEMI
1111 111111
1111 111112
1111 111113
1111 111114
1111 111115
But I think there is better way to do It. I need your suggestions ..thank you.

解决方案

It sounds like you are at the beginning of creating a complete tracking system, so your company can tell who they sold each IEMI to. Otherwise, why track individual IEMI numbers?

If that is the case, you will probably want to break your tables apart to fully normalize them. In this case, from your description, you will want something like the following tables:

- Category: ID, CategoryName

- Barcode: ID, BarcodeType

- MaterialsProduct: ID, ProductName, CategoryID, BarcodeID (of the barcode used for that product)

- Purchases: ID, SupplierID [ID from another table], PurchaseDate, MaterialID, Quantity, Price

- IEMIs: ID, PurchaseID, IEMI

- Sales: ID, IEMI_ID, Date, SalesPrice

...
You will also probably have a Customers table.

From the above, you could track a final IEMI back to the original purchase, unless I've missed anything.

Putting everything in one table, as you appear to have done based on your question phrasing, is a good learning experience, but quickly becomes totally unmanageable as you are realizing. It will lead to headache for you. Even though the above seems like a lot of work and learning, it is best to do so as soon as possible, to eliminate a ton of work in the end.

Good luck with it!

(PS - I renamed 'Materials' to 'Products,' as that better describes your meaning (unless I missed something else))


这篇关于电子商店POS系统数据库设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆