ER Diagram User Requirements Sales transactions Transaction Processing

  • Slides: 18
Download presentation
E-R Diagram

E-R Diagram

User Requirements

User Requirements

ตวอยางของ : การทำธรกรรมการขาย (Sales transactions) เชน ระบบการบนทกการขาย ประจำวน ซงเปนสารสนเทศในระดบ Transaction Processing Systems (TPS) Cust

ตวอยางของ : การทำธรกรรมการขาย (Sales transactions) เชน ระบบการบนทกการขาย ประจำวน ซงเปนสารสนเทศในระดบ Transaction Processing Systems (TPS) Cust Id. Cust Name Date สาขา หนามหาวทยาลยพะเยา Receipt No. T 16012019 N 00005 16/01/2019 Time Order No. Product Id. Product Name Qty Unit Price G 003 1 Bread 1 20. 00 G 001 2 Beer 2 60. 00 G 015 3 Milk 1 60. 00 G 004 4 Candy 1 10. 00 G 005 5 Coke 1 12. 00 Total รปท 1 ใบเสรจรบเงน C 001 นายขยน บานไกล /ใบกำกบภาษ 8: 00 Total 20. 00 120. 00 60. 00 12. 00 222. 00

1. สราง E-R diagram (Context Data Model)

1. สราง E-R diagram (Context Data Model)

การเปลยน E-R 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 Unit. Price Balance. 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 Balance. Qty 100 40 8

2. สราง E-R diagram (Key-Based Data Model)

2. สราง E-R diagram (Key-Based Data Model)

ผลลพธของการออกแบบ ซงจะได ผลลพธ Table: Product Sales_Detail Product. Id (Pk) Product. Name G 001 Beer

ผลลพธของการออกแบบ ซงจะได ผลลพธ 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

ผลลพธของการออกแบบ ซงจะได ผลลพธ Table: Product Sales_Detail Product. Id (Pk) Product. Name G 001 Beer

ผลลพธของการออกแบบ ซงจะได ผลลพธ 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 Time Customer. Id Total. No 8: 00 001 222 8: 10 001 280 Receipt. No (Pk) Product. Id (Pk) Product. Name Qty Price F 16012019 G 300001 G 003 Bread 1 20 F 16012019 G 300001 G 001 Beer 2 60 F 16012019 G 300001 G 015 milk 1 60 F 16012019 G 300001 G 004 Candy 1 10 F 16012019 G 300001 G 005 Coke 1 12 F 16012019 G 300002 G 003 Bread 2 20 F 16012019 G 300002 G 001 Beer 3 60 F 16012019 G 300002 G 015 milk 1 60 …