ER diagram Table TPS Entity Sales Entity Product
การเปลยน E-R diagram เปน Table แบบมความสมพนธ (TPS) จากขอมลของใบเสรจรบเงนสามารถวเคราะหความสมพนธของขอมลไดดงน Entity Sales กบ Entity Product มความสมพนธแบบกลมตอกลม Customer. Id Many, Date M: M) Time Product. Id Total (Many to Product. Name Receipt. No รปท M Sales 2 M: M M Product Sell F 16012019 G 300001 … Time 16/01/2019 8: 00 Table: Sales. Detail Receipt. No (Pk) F 16012019 G 300001 … Date Customer. Id Product (Pk) G 003 G 001 Price Balanced. Qty Table: Product Table: Sales Receipt. No (Pk) 001 Product. Id (Pk) Product. Name Total G 001 G 002 G 003 222. 00 Qty … 1 2 Beer Blanket Bread Unit. Price 60 20 Balanced. Qty 100 40 3
ผลลพธของการออกแบบ ซงจะได ผลลพธ Table: Product Sales_Detail Product. Id (Pk) Product. Name G 001 Beer G 002 Blanket G 003 Bread G 004 Candy G 005 Coke G 006 Computer G 007 Cookie G 008 Diaper G 009 Egg G 010 Green Tea G 011 Make up G 012 Meat G 013 Medicine G 014 Microwave G 015 milk G 016 Printer G 017 Shampoo G 018 Telephone G 019 Television G 020 Water Table จากขอมลใบเสรจรบเงน (ระบบ TPS) Table 3 Table คอ Table Sales , Table Product และ Table Price 60 20 10 12 20000 40 150 20 20 200 190 290 3000 60 2000 60 30000 20000 12 Balanced. Qty 100 40 100 30 100 100 30 30 50 100 100 40 120 Table: Sales Receipt. No (Pk) Date F 16012019 G 300001 16/01/2019 F 16012019 G 300002 16/01/2019 … Table: Sales. Detail Receipt. No (Pk) F 16012019 G 300001 F 16012019 G 300001 F 16012019 G 300002 … Time Customer. Id Total. No 8: 00 001 222 8: 10 001 280 Product. Id (Pk) G 003 G 001 G 015 G 004 G 005 G 003 G 001 G 015 Qty 1 2 1 1 1 2 3 1
- Slides: 6