120 likes | 264 Views
ER Modeling Example Hachim Haddouti. Entities and Attributes. See Ch2 p.157. Example 2: Problem/Application. Providing customer invoice details of Maroc Telecom on the web . An Excerpt of raw data. 100|MAROCTelekom|0.2|98|20000430|EPLUS09800001M
E N D
ER Modeling Example Hachim Haddouti
Entities and Attributes Hachim Haddouti, ER Modeling
See Ch2 p.157 Hachim Haddouti, ER Modeling
Example 2: Problem/Application • Providing customer invoice details of Maroc Telecom on the web Hachim Haddouti, ER Modeling
An Excerpt of raw data 100|MAROCTelekom|0.2|98|20000430|EPLUS09800001M 203|1141310||Form|4032383060052000|||101|1|||SBS GmbH & Co OHG||Herr Giehr / TCS|EP-3310509|Heinz-Nixdorf-Ring 1|33106 Paderborn|||||N|N|.|| 203|1141310||Form|4032383060052000|||104|2|||COMMERZBANK (WEST) BERLIN|10040000|201032012|D|50020200|BHF-Bank|26048371|-1 203|1141310||Form|4032383060052000|||110|3|||0.00||23588.94|20000502||||||DEM|0.00||12060.83|EUR 203|1141310||Form|4032383060052000|||103|4|||Siemens AG|Frau|Marina Gaier|ICM CD MP GSM RD M84|Grillparzerstr. 10|81675 München|2674396||||N|N||| 203|1141310||Form|4032383060052000|||103|5|||Siemens AG|Herr|Michael Seeger|ICM CD MP GSM RD M64|Grillparzerstr. 10|81675 München|2589571||||N|N||| 203|1141310||Form|4032383060052000|||103|6|||Siemens AG||ZU REV 3|Herr Henkelmann|St.-Martin-Str. 76|81541 München|2551629||||N|N||| 203|1141310||Form|4032383060052000|||103|7|||Siemens AG||ICN WN ES D72|Rolf Lang|Hofmannstr. 51|81379 München|2534747||||N|N||| 203|1141310||Form|4032383060052000|||103|8|||Siemens AG||.|KWU W5PS, Frau Martina Huber|Freyeslebenstr. 1|91058 Erlangen|2461632||||N|N||| 203|1141310||Form|4032383060052000|||103|9|||Siemens Immobilien Management GmbH & Co.||.|Herr Lauschke/SIM VST|St.-Martin-Str. 76|81541 München|2390515||||N|N||| 203|1141310||Form|4032383060052000|||103|10|||||SBS GmbH & Co. KG |Herr Giehr / TCS|Heinz-Nixdorf-Ring 1|33106 Paderborn|2222056||||N|N||| Hachim Haddouti, ER Modeling
Identification of Entities, Attributes and Relationships • · INVOICE • ·Call Detail Records (INVOICE_CDR_ITEM) • ·Currency • ·Customer • ·TAX • ·BILL_SUM • ·SALDO • ·Bank account • ·ADDRESS • · Mid SUM • · Monthly Fees, once-only fee, free call units... • ... Hachim Haddouti, ER Modeling
Identification of Entities, Attributes and Relationships cont. • A Customer can have one or many mobile cards; many phone no • A customer can have many adresses. • An Invoice will be balanced by using a bank account. • An Invoice contains call sums, VAT, monthly and other fees • Call Detail Record (CDR) is the prove of an Invoice. • CDR can be deleted after certain time • Invoices can be deleted after 6 months. • Be sure that Bill_From cannot display the CDRs of Bill_To. • ..... Hachim Haddouti, ER Modeling
ER Model for CDR Hachim Haddouti, ER Modeling
A few Tables • INVOICE (invoice_number, customer_id, phone_id, bill_date,..) • ADRESS(invoice_number, Customer_id, phone_id, Street, City, Country, ZIP,..) • PAYMENT(invoice_number, Customer_id, cu_bank_name, cu_bank_code, cu_bank_account, cu_pay_method, Due_date, ..) • TAX(invoice_number, gross_sum, net_sum, vat_amount, vat_rate, currency..) • SALDO(invoice_number, saldo, total, last_booking_date, ..) • INVOICE_ITEM (invoice_number,phone_no, sequence, from_date, to_date, items, amount_per_item, total_gross, discount, gross_sum_off, ..) • INVOICE_CDR_ITEM(invoice_number, phone_no, position , call_group, distance_zone, time_zone, date, time, calling_number, duration, tarif_info, call_charges, ..) Hachim Haddouti, ER Modeling