draw erd for the following situation

17
SV: TungTran 1. Billing System A company has a number of employees. The attributes of employee include Employee ID, Name, Address and Birth Date. The company also has several projects. Attributes of project include Project ID, Project Name and Start Date. Each employee may be assigned to one or more projects, or not be assigned to any project. A project must have at least one employee assigned, and may have any number of employees assigned. An employee’s billing rate may vary by project, and the company wishes to record the applicable billing rate for each employee when assigned to a particular project. have have E m ployees E m ployeeID Nam e A ddress B irthday <pi> C haracters (20) C haracters (50) C haracters (50) D ate E m ployeeID ... <pi> P rojects P rojectID P rojectNam e S tartD ate <pi> C haracters (20) C haracters (30) D ate P rojectID <pi> A ssigned B illing R ate M oney <M > 2. Tafe (vocational college) Tafe has a large number of courses in its catalog. Attributes of course include Course Number, Course Name and Units. Each course may have one or more courses as prerequisites, or may have no prerequisites. Similar, a particular course may be prerequisite for any number of courses, or may not be prerequisite for any other course. 3. Laboratory A laboratory has several chemists who work on one or more projects. Chemists also may use certain kinds of equipment on each project. Attributes of chemist includes Employee Id, Name and Phone number. Attributes of project includes Project Id and Start date. Attributes of equipment include Serial No and Cost. The organization wishes to record Assign Date – that is the date when a given equipment item was assigned to a particular chemist working on a specified project. A chemist must be assigned to at least one project and one equipment item. A given equipment item need not be assigned, and a given 1

Upload: dapxitlo-duc

Post on 18-Apr-2015

52 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Draw ERD for the Following Situation

SV: TungTran

1. Billing SystemA company has a number of employees. The attributes of employee include Employee ID, Name, Address and Birth Date. The company also has several projects. Attributes of project include Project ID, Project Name and Start Date. Each employee may be assigned to one or more projects, or not be assigned to any project. A project must have at least one employee assigned, and may have any number of employees assigned. An employee’s billing rate may vary by project, and the company wishes to record the applicable billing rate for each employee when assigned to a particular project.

have have

Employees

EmployeeIDNameAddressBirthday

<pi> Characters (20)Characters (50)Characters (50)Date

EmployeeID...

<pi>

Projects

ProjectIDProjectNameStartDate

<pi> Characters (20)Characters (30)Date

ProjectID <pi>

Assigned

Bill ing Rate Money <M>

2. Tafe (vocational college)

Tafe has a large number of courses in its catalog. Attributes of course include Course Number, Course Name and Units. Each course may have one or more courses as prerequisites, or may have no prerequisites. Similar, a particular course may be prerequisite for any number of courses, or may not be prerequisite for any other course.

3. Laboratory

A laboratory has several chemists who work on one or more projects. Chemists also may use certain kinds of equipment on each project. Attributes of chemist includes Employee Id, Name and Phone number. Attributes of project includes Project Id and Start date. Attributes of equipment include Serial No and Cost. The organization wishes to record Assign Date – that is the date when a given equipment item was assigned to a particular chemist working on a specified project. A chemist must be assigned to at least one project and one equipment item. A given equipment item need not be assigned, and a given project need not be assigned either a chemist or an equipment item.

4. Hospital

A hospital has a large number of registered physicians. Attributes of physician include Physician ID and Specialty. Patients are admitted to the hospital by physicians. Attributes of patient include Patient ID and Patient name. Any patient who is admitted must have exactly one admitting physician. A physician may optionally admit any number of patients. Once admitted, a given patient must be treated by at least one physician. A particular physician may treat any number of patients. Whenever a patient is treated by a physician, the hospital wish to record the details of the treatment (Treatment Detail). Components of Treatment Detail include Date, Time and Result.

1

Page 2: Draw ERD for the Following Situation

Each part in a requisition is ordered form one supplier.

Differentd parts of the same requisition can be orderd from different suppliers.

SV: TungTran

5. Project MannagementThere are number of projects in the company. Each project is identified by a Project ID. Each project is assigned to a Budget and a Manager to look after the project progress. The project will have a Expected Completion Date and the Actual Completion Date. Each project is made up of a number of tasks, identified by Task Name within the project. Each task has a Start Date and expected End Date. Task may have any number of requisitions of parts. Each requisition consists of a number of parts, identified by the Part ID and QtyNeeded. Part consists of Part ID, Part Name, Quantity On Hand. Each part in a requisition is orderd form one supplier, identified by Supplier ID, at a given Price. The supplier has Supplier Name and Supplier Address. Different parts of the same requisition cacn be orderd form different supplier.Deliveries made by supplier are identified by Delivery No within supplier and are made at a given DateDelivered. Each delivery may contain any number of parts. The delivery will state the Part No and the QtyDelivered for that requisition. Notes: parts requested may be delivered in one or more deliveries.

have

contain

within

Relationship_15

Relationship_16

orderd-given

have2 of

Projects U5

Project_U5IDEc.DateAc.DateBudgetManager

<pi> Characters (20)DateDateMoney (20)Characters (20)

<M>

ProjectID_U5...

<pi>

Tasks

Task NOTask Name

<pi> Characters (30)Characters (20)

<M>

Task Name...

<pi>

Requisition

RequisitionNODate Made

<pi> Characters (30)Date

<M>

RequisitionNO...

<pi>

Supplier

SupplierIDSupplier NameSupplier Address

<pi> Characters (20)Characters (30)Characters (30)

<M>

Supplier ID...

<pi>

Parts

PartsIDPart NameQuantity On Hand

<pi> Characters (10)Characters (20)Characters (20)

<M>

PartsIDPartName...

<pi><ai>

Deliveries

Delivery NODateDelivered

<pi> Characters (20)Date

<M>

Delivery NO...

<pi>

Requisition Detail

QtyNeededGiven Price

Characters (20)Money

made up

Start DateEnd Date

DateDate

2

Page 3: Draw ERD for the Following Situation

SV: TungTran

6. Trading Company

Mail Home is a mail order company located in South Australia selling domestic household items such as cleaning agents, cooking utensils, bathroom items, storage boxes etc. The business was quite successful in the past ten years but it is declining since last two years. Every 3 months, the company constantly generated a catalogue for distributing to the selected suburbs. The mail orders were processed manually. Inevitably, trading through mail order is out of fashion because of the impact of shopping centers in suburbs plus shopping on the Internet. Mail Home directors made the decision that they will change their trading strategy to doing business over the Internet and make the business known to the world. The director called in a system consultant to help to set up the database for the order system. The system consultant collected the following information from the management. The customer information includes Customer No, Customer First Name, Customer Last Name, Customer Address (Street No, Street Name, Suburb, State, Post Code), Phone No. A customer can place many orders.

An order may contain one or more items. Each order must have a customer. An order contains information such as Order ID, Order Date, Customer Name, Customer Address, Sales Representative, Credit Card No, Card Holder, Credit Card Expiry Date, Comments, Total and the details of the order item such as Item No, Item Name, Quantity and Price Each.

An item contains information such as Item No, Item Name, Item Description, Unit-On-Hand, Selling Price, Supplier Code, Warranty Period. An item may be ordered by different orders.

Within 14 days of delivery, the customers can return or refund any item ordered if they do not satisfy with the item. Each goods return must related to a sales order. A goods return may include one or more items which comes from a sales order. A goods return contains information such as Goods Return No, Return Date, Order ID, Customer Name, Customer Address, Refund Total, Refund Approved By and the return item details such as Item No, Item Name, Quantity, Price Each and Return-or-Refund.

The company has regional sales representatives who visit customers. If the customer has quoted the name of the sales representative in the sales order, the sales representative would receive 10% of commission on the sales amount. Each order contains zero or one sales representative. The sales representative includes information such as Sales Representative No, Sales representative Name, Commission-To-Date, and Basic Salary.

3

Page 4: Draw ERD for the Following Situation

SV: TungTran

7. Medical Clinic.

A medical clinic in North Adelaide has 20 specialist medical doctors and physiotherapists. Medical doctors and physiotherapists give consultation and treatment to patients in the clinic. In the doctors file, it records the doctor name, specialisation and consultation room number.

For every new patient, a new patient record card is generated for keeping the patient details and visit details. Patient details are first name, last name, address, referral doctor, date-of-birth and Medicare number. Patient treatment details are treatment date, treatment description, doctor name and equipment used. Each patient has at least one visit. Every visit must have a referral doctor. A visit must belong to one and only one patient. A visit has one or more treatment. A treatment must be conducted by one doctor.

There are medical equipment in the clinic for physiotherapists to treat patients. Each equipment has an equipment number and equipment name. Each equipment must be located in a room. A room can accommodate one or more equipment.

Booking is absolutely required for any visit. The booking system is to ensure the availability of the doctor and equipment during the consultation. New patient normally needs four weeks waiting period. During the booking, patients can specify which specialist or physiotherapist they would like to see. Most of the patients are referred from other doctors in town. A patient can make multiple appointments.

4

has..

has.

related to

Relationship_44

Relationship_45

Relationship_46

Relationship_47

Relationship_48

Customer

CustomerNOCustomerFNameCustomerLNameCustomer AddressPhone NO

<pi> Characters (10)Characters (10)Characters (10)Characters (30)Integer

CustomerNO <pi>

Address

StreetNOStreetNameSuburbStatePostCost

<pi> Characters (10)Characters (20)Characters (10)Characters (10)Integer

StreetNO...

<pi>

Goods Return

GoodsReturnNOReturn DateRefund TotalRefund Approved By

<pi> Characters (10)Date<Undefined><Undefined>

Goods Return NO...

<pi>

Order

OrderIDOrder DateCreditCardNOCardHolderCreditCardExDateCommentsTotal

<pi> Characters (10)DateNumberNumberDateCharacters (30)Money

<M>

Identifier_1...

<pi>

Sales Representative

Sales RepresentativeNOSales RepresentativeNameComidssiontoDateBasic Salary

<pi> NumberCharacters (20)DateMoney

Sales Representative NO...

<pi>

Item

ItemNOItemNameItemDesciptionUnitOnHandSellingPricesSupplierCodeWarranty Period

<pi> Characters (10)Characters (30)Characters (30)NumberMoneyCharacters (10)<Undefined>

<M>

Identifier_1...

<pi>

Return Item

QuantityReturn or Refund

Order-Item

QuantityPriceEach

<Undefined><Undefined>

Page 5: Draw ERD for the Following Situation

SV: TungTran

At the end of each consultation or treatment, in particular for physiotherapy, the type of equipment and the length of the treatment are suggested to the patient for subsequent visits. The next appointment is suggested and booked while the patient is still in the clinic.

Doctors normally have their own consultation rooms that they can see their patients. However, if any treatment requires any equipment located in any other room, the room will be booked in advance to avoid time crashes with other patients. The booking system is rather important for the physiotherapy equipment. Some treatments using the equipment can be as long as 1 hour. Normally, equipment bookings are in the unit of 15 minutes time slot. An appointment can book for more than one equipment. However, no two patients can be booked in the same room at the same time. A treatment must be carried out by only one doctor or physiotherapist.

At the end of each consultation, the doctors record the treatment details. Treatment details can be treatment date, treatment description (such as treatment name, diagnosis, prescription and recommendation), doctor name and equipment used. At present, doctors record treatment details in free format. The record card is passed to the receptionist for invoicing. There is a list of standard charges for consultation and treatment. There is no extra charge for using any equipment during the treatment. The invoice will list the patient's details, doctor name, invoice date, treatment date, each treatment details, total amount and due date. When the invoice is paid by the patient, the paid date is recorded. It is then removed from the invoice file and filed together with the patient's record.

8. The State Patrol Ticket Processing System (Hệ thống xử lý vi phạm giao thông)

The purpose of the Sate Patrol Ticket Processing System is to record driver violations, keep records of the fines paid by drivers when they plead guilty or are found guilty of moving violations by the courts, and to notify the court that a warrant for arrest should be issued when such fines are not paid in a timely manner. A separate State Patrol System records accidents and verification of financial responsibility (insurance). Yet a third system produces driving record reports from the ticket and accident records for insurance companies. Finally, a fourth system issues, renews, or suspends driver’s licenses. These four systems are obviously integrated in that they share access to the same database, but otherwise, they are operated separately by different departments of the State Patrol. State Patrol operations (what the officers do) are entirely separate

Mục đích của Tuần tra nhà nước có hệ thống xử lý vé là để ghi lại các hành vi vi phạm điều khiển, lưu giữ hồ sơ của các tiền nộp phạt của lái xe khi họ nhận tội hoặc bị kết tội vi phạm di chuyển của các tòa án, và thông báo cho tòa án rằng một lệnh bắt giữ phải được ban hành khi tiền phạt không được trả lương một cách kịp thời. Một nhà nước riêng biệt Hệ thống tuần tra biên bản tai nạn và xác minh về trách nhiệm tài chính (bảo hiểm). Tuy nhiên, một hệ thống thứ ba tạo lái xe báo cáo ghi lại từ các bản ghi vé và tai nạn cho các công ty bảo hiểm. Cuối cùng, một hệ thống các vấn đề thứ tư, đổi mới, hoặc đình chỉ giấy phép lái xe. Bốn hệ thống rõ ràng là được tích hợp trong đó họ chia sẻ quyền truy cập vào cơ sở dữ liệu giống nhau, nhưng nếu

5

Page 6: Draw ERD for the Following Situation

SV: TungTran

không, chúng được vận hành một cách riêng biệt của phòng ban khác nhau trong những tuần tra Nhà nước. Nhà nước hoạt động tuần tra (những gì các sĩ quan làm) là hoàn toàn riêng biệt

The portion of the database used with the ticket processing system involves driver data, ticket data, office data and court data. Diver data, officer data, and court data are used by the system. The system creates and maintains ticket data. Driver attributes include license number, name, address, date of birth, date licensed, and so on. Ticket attributes include ticket number (each is unique and preprinted on each sheet of the officer’s ticket book), location, ticket type, ticket date, ticket time, plea, trial date, verdict, fine amount, and date paid. Court and officer data include the name and address of each respectively. Each driver may have zero or more tickets, and each ticket applies to only one driver. Officers write quite a few tickets

Các phần của cơ sở dữ liệu được sử dụng với các hệ thống xử lý dữ liệu liên quan đến vé xe, vé số liệu, dữ liệu văn phòng và các dữ liệu của tòa án. Diver dữ liệu, dữ liệu nhân viên, và các dữ liệu tòa án được sử dụng bởi hệ thống. Hệ thống này tạo ra và duy trì dữ liệu vé. thuộc tính Driver bao gồm số giấy phép, tên, địa chỉ, ngày sinh, ngày cấp phép, và như vậy. Vé số thuộc tính bao gồm vé (mỗi là duy nhất và in sẵn trên mỗi tấm vé của cuốn sách của viên chức), địa điểm, loại vé, vé ngày, thời gian bán vé, lời bào chữa, ngày xét xử, bản án, số tiền phạt, và ngày trả tiền. Toà án và cán bộ dữ liệu bao gồm tên và địa chỉ của từng tương ứng. Mỗi trình điều khiển có thể có không hoặc nhiều vé, và mỗi vé chỉ áp dụng đối với một trình điều khiển. Cán bộ viết vé khá một vài

When an officer gives a ticket to a driver, a copy of the ticket is turned in and entered into the system. A new ticket record is created and relationships to the correct driver, officer, and court are established in the database. If the driver pleads guilty, he or she mails in the fine in a preprinted envelope with the ticket number on it. In some cases, the driver claims innocence and wants a court date. When the envelope is returned without a check and the trail request box has an “X” in it, the system notes sends a ticket details report to the appropriate court. A trial date questionnaire form is also produced at the same time and is mailed to the driver. The instructions on the questionnaire tell the driver to fill in convenient dates and mail the questionnaire directly to the court. When the court receives this information, it schedules a trial date and notifies, the driver of the date and time

Khi một cán bộ được đưa ra một vé cho người lái xe, một bản sao của vé là hướng vào trong và nhập vào hệ thống. Một kỷ lục vé mới được tạo ra và mối quan hệ với nhân viên chính xác, điều khiển, và tòa án được thành lập vào cơ sở dữ liệu. Nếu lái xe kêu gọi có tội, anh ta hoặc cô thư trong mỹ trong một phong bì in sẵn với số lượng vé vào nó. Trong một số trường hợp, lái xe tuyên bố vô tội và mong muốn một ngày ra tòa. Khi phong bì được trả về mà không cần kiểm tra và yêu cầu hộp đường mòn có một "X" trong đó, các ghi chú hệ thống sẽ gửi một vé chi tiết báo cáo với tòa án thích hợp. Một ngày thử nghiệm hình thức câu hỏi cũng được sản xuất tại cùng một thời điểm và được gửi cho lái xe. Các hướng dẫn trên bảng câu hỏi cho các trình điều khiển để điền vào những ngày thuận tiện và thư bảng câu hỏi trực tiếp đến tòa án. Khi tòa án nhận

6

Page 7: Draw ERD for the Following Situation

SV: TungTran

được thông tin này, nó lịch một ngày thử nghiệm và thông báo, người điều khiển ngày và thời gian

When the trial is completed, the court sends the verdict to the ticketing systems. The verdict and trial date are recorded for the ticket. If the verdict is innocent, the system that produces driving record reports for insurance companies will ignore the ticket. If the verdict is guilty, the court gives the driver another envelope with the ticket number on it for mailing in the fine

Khi thử nghiệm đã hoàn thành, tòa án sẽ gửi bản án cho các hệ thống bán vé. Các bản án và ngày xét xử được ghi lại cho vé. Nếu bản án được tuyên vô tội, hệ thống sản xuất báo cáo hồ sơ lái xe cho các công ty bảo hiểm sẽ bỏ qua thẻ. Nếu phán quyết có tội, tòa án cho phép người lái xe một phong bì với số lượng vé vào nó để gửi thư trong mỹ

If the driver to pay the fine within the required period, the ticket processing system produces a warrant request notice and sends it to the court. This happens if the original envelope is not returned within two weeks or if the court-supplied envelope is not returned within two weeks of the trial date. What happens then is in the hands of the court. Sometimes the court requests that the driver’s license be suspended, and the system that processes driver’s licenses handles the suspension

Nếu người lái xe nộp tiền phạt trong thời hạn yêu cầu, hệ thống xử lý vé ra một thông báo yêu cầu bảo đảm và gửi nó đến tòa án. Điều này xảy ra nếu các phong bì gốc không trả lại trong vòng hai tuần hoặc nếu tòa án cung cấp phong bì không trả lại trong vòng hai tuần kể từ ngày xét xử. Điều gì xảy ra sau đó là trong tay của tòa án. Đôi khi yêu cầu tòa án cấp giấy phép lái xe bị đình chỉ, và hệ thống các quá trình xử lý giấy phép lái xe bị đình chỉ

9. Quản lý thư viện

Một thư viện tổ chức việc cho mượn sách như sau:

Mỗi quyển sách được đánh một mã sách (MASH) dùng để phân biệt với các quyển sách khác (giả sử nếu một tác phẩm có nhiều bản giống nhau hoặc có nhiều tập thì cũng xem là có mã sách khác nhau), mỗi mã sách xác định các thông tin khác như : tên sách (TENSACH), tên tác giả (TACGIA), nhà xuất bản (NHAXB), năm xuất bản (NAMXB).

Mỗi đọc giả được thư viên cấp cho một thẻ thư viện, trong đó có ghi rõ mã đọc giả (MAĐG), cùng với các thông tin khác như : họ tên (HOTEN), ngày sinh (NGAYSINH), địa chỉ (ĐIACHI), nghề nghiệp(NGHENGHIEP).

Cứ mỗi lượt mượn sách, đọc giả phải ghi các quyển sách cần mượn vào một phiếu mượn, mỗi phiếu mượn có một số phiếu mượn (SOPM) duy nhất, mỗi phiếu mượn xác định các thông tin như: ngày mượn (NGAYMUON), đọc giả mượn, các quyển sách mượn và ngày trả (NGAYTRA). Các các quyển sách trong cùng một phiếu mượn không nhất thiết phải trả trong trong cùng một ngày.

7

Page 8: Draw ERD for the Following Situation

SV: TungTran

10. Quản lý khách sạn.

Một khách sạn cần xây dựng một hệ thống quản lý việc thuê phòng của các khách trọ. Thông tin về Phòng gồm Mã phòng, Loại phòng. Đơn giá. Thông tin về Khách gồm Mã khách, Họ tên, Số CMND, Địa chỉ, Quốc tịch. Một khách trọ có thể đến thuê phòng tại khách sạn này nhiều lần. Thông tin về mỗi Lần thuê của một khách gồm Phòng thuê, Ngày bắt đầu, Ngày kết thúc. Giả sử tất cả các phòng đều là phòng đơn (phòng 1 người). Đơn giá thuê/ ngày của một phòng được ấn định trước tuỳ theo phòng thuộc loại phòng nào. Trong mỗi lần thuê phòng, khách trọ có thể trả thêm các khoản tiền về dịch vụ (như điện hoa, ăn uống, karaoke, …).

11. Hãng hàng không.

Một công ty hàng không có mở nhiều tuyến bay trong và ngoài nước. Thông tin về tuyến bay gồm Mã tuyến bay, nước khởi hành, nước đến, đơn giá vé, số giờ bay. Mỗi tuyến bay có nhiều chuyến bay. Thông tin về chuyến bay gồm Mã chuyến bay, loại máy bay, các phi công lái, các hành khách đi trên chuyến bay. Thông tin về hành khách gồm Mã số , họ tên, ngày sinh. Một người có thể đi trên nhiều chuyến bay khác nhau vào nhưng thời điểm khác nhau. Công ty có nhiều đơn vị bay. Thông tin về đơn vị bay gồm Mã số, tên đơn vị. Mỗi đơn vị bay gồm nhiều phi công. Thông tin về phi công gồm Mã số, họ tên. Mỗi phi công chỉ thuộc một đơn vị bay. Một phi công có thể lái nhiều chuyến bay.

12. Cửa hàng cho thuê băng Video.

Một cửa hàng cho thuê băng Video có nhiều cuốn băng video được dán mã số khác nhau. Mỗi cuốn băng video do một hãng sản xuất (Sony, JVC, …). Thông tin về hãng sản xuất băng gồm Mã hãng, tên hãng. Mỗi cuốn băng có thể chứa nhiều phim. Hai phim trong cùng một băng là khác nhau. Mỗi băng chỉ được in với một hệ. Thông tin về một phim gồm mã phim, tên phim, năm sản xuất, tên đạo diễn. Thông tin về hệ băng gồm tên hệ (Pal, NTSC, …), tần số. Một phim

8

has

lái

thuộc

đi

TuyenBay

MaTuyenBayNước Khởi HànhNước ĐếnĐơn Giá VéSố Giờ Bay

<pi> Characters (30)Characters (20)Characters (20)MoneyNumber

Mã tuyến bay...

<pi>

ChuyenBay

MaChuyenBayLoại máy bay

<pi> Characters (30)Characters (30)

<M>

Mã chuyến bay...

<pi>

HanhKhach

Mã Hành KháchHọ TênNgày Sinh

<pi> Characters (20)Characters (30)Date

<M>

Mã Hành Khách...

<pi>ĐonVi

Mã Đơn VịTên Đơn Vị

<pi> Characters (20)Characters (30)

Mã đơn vị <pi>

PhiCong

Mã SốHọ Tên

<pi> Characters (20)Characters (30)

<M>

Mã số phi công...

<pi>

Page 9: Draw ERD for the Following Situation

SV: TungTran

có nhiều diễn viên đóng và chỉ do một hãng phim sản xuất. Mỗi diễn viên gồm mã số, họ tên, quốc tịch. Thông tin về hãng phim gồm tên hãng, tên giám đốc. Một khách hàng (gồm mã số, tên, địa chỉ) có thể đến cửa hàng này thuê băng nhiều lần. Mỗi lần thuê, nhân viên se ghi lại ngày giờ thuê và các băng được thuê.

13. Cửa hàng thời trang.

Cửa hàng có nhiều loại mặt hàng khác nhau. Mỗi mặt hàng gồm mã số, tên gọi, cỡ (size), giá niêm yết, số lượng có. Một mặt hàng chỉ được lấy từ 1 nhà cung cấp (NCC) nhưng 1 NCC có thể cung cấp nhiều mặt hàng khác nhau. Thông tin về NCC gồm Mã NCC, tên NCC, địa chỉ. Một khách hàng có thể đến cửa hàng mua quần áo nhiều lần. Sau mỗi lần mua hàng khách se có một hóa đơn gồm mã hóa đơn, ngày lập và tổng số tiền mua. Trong hóa đơn gồm tên vài mặt hàng kèm theo số lượng và giá bán của từng mặt hàng đó. Thông tin về khách hàng gồm mã KH, tên KH, điện thoại. Ngoài ra cửa hàng còn có nhiều đại lý khác nhau. Các đại lý có bán nhiều loại mặt hàng. Thông tin về đại lý gồm mã ĐL, tên ĐL, địa chỉ.

Trong nhiều loại mặt hàng mà cửa hàng bán có 3 loại là Áo vét, Quần tây và Áo Ghi-lê. Cửa hàng se sắp sẵn nhiều bộ Âu phục khác nhau. 1 loại Áo vét + 1 loại Quần tây + 1 loại Áo Ghi-lê se tạo thành 1 bộ. Khách hàng có thể chọn mua một bộ được sắp sẵn như vậy. Tuy nhiên khách hàng cũng có nhu cầu lựa chọn 1 bộ tương tự như trên nhưng không có áo Ghi-lê. Chú ý thông tin về Áo vét có thêm màu sắc, Quần tây có thêm kiểu dáng và Áo Ghi-lê có thêm nhãn hiệu.

9

chọn mua

Lấy

bánkèm theo.

kèm theo

chọn lựa. chọn lựaâu phục sắp sẵn

âu phục sắp sẵn.

MATHANG

MaSoTenGoiSize...

<pi> IntegerVariable characters (50)<Undefined>

<M><M>

NHACUNGCAP

MaNCCTenNCCDiaChi

<pi> IntegerVariable characters (50)Variable characters (50)

Identifier_1...

<pi>

KHACHHANG

MaKHTenKHDienThoai

<pi> IntegerVariable characters (50)Number

HOADON

MaHoaDonNgayLapTongSoTien

<pi> IntegerDate & TimeMoney

Identifier_1 <pi>

DAILY

MaDaiLyTenDaiLyDiaChi

<pi> IntegerVariable characters (50)Variable characters (50)

Identifier_1 <pi>

AOVET

MauSac Variable characters (50)

QUANTAY

KieuDang Variable characters (50)AOGHI_LE

NhanHieu Variable characters (50)

CTHD

SoLuongGiaBan

IntegerMoney

BO 2BO 3

Page 10: Draw ERD for the Following Situation

SV: TungTran

14. Công ty du lịch.

Công ty thiết lập ra nhiều chương trình du lịch (program). Thông tin về chương trình gồm MãCT, tênCT, số ngày, giá tiền và các khách sạn có trong chương trình. Có nhiều chuyến đi (tour) được tổ chức cho 1 chương trình. Không có tour nào bao gồm nhiều hơn 1 chương trình. Thông tin về chuyến đi gồm MãCĐ, ngày BĐ, ngày KT, điểm khởi hành, các hành khách và 1 xe ôtô. Thông tin về hành khách gồm MãHK, tênHK, tuổi, địa chỉ. Thông tin về khách sạn gồm MãKS, loạiKS, địa chỉ. Mỗi xe ô tô trong mỗi chuyến đi chỉ do 1 người lái (trường hợp có nhiều xe trong 1 chuyến đi). Thông tin về xe gồm số xe, hiệu xe, số chỗ, năm SX. Thông tin về tài xế gồm MãTX, họ tên TX, ngày sinh. Trong 1 chuyến đi có vài hướng dẫn viên (HDV) đi theo và cty se trả các khoản tiền công khác nhau cho mỗi người theo từng chuyến. Thông tin về HDV gồm MãHDV, họ tên HDV, ngày sinh, ngày vào làm.

10

Có Nhiều xe trong 1 chuyến đi

Relationship_39

tài xế lái 1(n) xe trong 1 (n) chuyến đi

Chuyến Đi2

MãCĐNgày BĐNgày KTĐiểm KH

<pi> Characters (10)DateDateCharacters (30)

MÃ Chuyến ĐI...

<pi>

Tài Xế2

Mã TXHoTenTXNgaySinh

<pi> Characters (10)Characters (20)Date

Mã Tài xế...

<pi>

Xe2

Số XeHieu XeSố ChỗNăm Sản Xuất

<pi> Characters (10)Characters (10)IntegerInteger

Số Xe...

<pi>

Xe-CĐ

Page 11: Draw ERD for the Following Situation

SV: TungTran

15. Quản lý lao động

Để quản lý việc phân công các nhân viên tham gia vào xây dựng các công trình. Công ty xây dựng ABC tổ chức quản lý như sau:

Cùng lúc công ty có thể tham gia xây dựng nhiều công trình, mỗi công trình có một mã số công trình duy nhất (MACT), mỗi mã số công trình xác định các thông tin như: tên gọi công trình (TENCT), địa điểm(ĐIAĐIEM), ngày công trình được cấp giấy phép xây dựng (NGAYCAPGP), ngày khởi công (NGAYKC), ngày hoàn thành (NGAYHT).

Mỗi nhân viên của công ty ABC có một mã số nhân viên(MANV) duy nhất, một mã số nhân viên xác định các thông tin như: Họ tên (HOTEN), ngày sinh (NGAYSINH), phái (PHAI), địa chỉ (ĐIACHI). Mỗi nhân viên phải chịu sự quản lý hành chánh bởi một phòng ban. Tất nhiên một phòng ban quản lý hành chánh nhiều nhân viên. Công ty có nhiều phòng ban (Phòng kế toán, phòng kinh doanh, phòng kỹ thuật, phòng tổ chức, phòng chuyên môn, Phòng phục vụ,…). Mỗi phòng ban có một mã số phòng ban(MAPB) duy nhất, mã phòng ban xác định tên phòng ban (TENPB).

11

có.

Relationship_31

Relationship_32

within.có..

mỗi xe trong mỗi chuyến đi có 1 tài xế

...

có...

Chương Trình

MãCTTTênCTSố NgàyGiá Tiền

<pi> Characters (10)Characters (20)IntegerMoney

Mã Chương Trình...

<pi>

Chuyến Đi

MãCĐNgày BĐNgày KTĐiểm KH

<pi> Characters (10)DateDateCharacters (30)

MÃ Chuyến ĐI...

<pi>

HDV

MaHDVHọTenNgaySinhNgayVaoLam

<pi> Characters (10)Characters (30)DateDate

MÃHDV <pi>

Khách Sạn

MaKSLoaiKSĐịa chỉ

<pi> Characters (10)Characters (10)Characters (30)

Mã Khách Sạn...

<pi>

Tài Xế

Mã TXHoTenTXNgaySinh

<pi> Characters (10)Characters (20)Date

Mã Tài xế...

<pi>

Hành Khách

MaHKTenHKTuổiĐịa chỉ

<pi> Characters (10)Characters (20)IntegerCharacters (30)

Mã Hành Khách...

<pi>

Xe

Số XeHieu XeSố ChỗNăm Sản Xuất

<pi> Characters (10)Characters (10)IntegerInteger

Số Xe...

<pi>

Vip

Số Thẻ Vip <pi> Integer

Số Thẻ Vip <pi>

Relationship_30

Lương Money

Page 12: Draw ERD for the Following Situation

SV: TungTran

Công ty phân công các nhân viên tham gia vào các công trình, mỗi công trình có thể được phân cho nhiều nhân viên và mỗi nhân viên cùng lúc cũng có thể tham gia vào nhiều công trình. Với mỗi công trình một nhân viên có một số lượng ngày công (SLNGAYCONG) đã tham gia vào công trình đó.

16. Quản lý bán hàng

Mỗi khách hàng có một mã khách hàng (MAKH) duy nhất, mỗi MAKH xác định được các thông tin về khách hàng như : họ tên khách hàng (HOTEN), địa chỉ (ĐIACHI), số điện thoại (ĐIENTHOAI). Các mặt hàng được phân loại theo từng nhóm hàng, mỗi nhóm hàng có một mã nhóm (MANHOM) duy nhất, mỗi mã nhóm hàng xác định tên nhóm hàng (TENNHOM), tất nhiên một nhóm hàng có thể có nhiều mặt hàng. Mỗi mặt hàng được đánh một mã số (MAHANG) duy nhất, mỗi mã số này xác định các thông tin về mặt hàng đó như : tên hàng (TENHANG), đơn giá bán (ĐONGIA), đơn vị tính (ĐVT). Mỗi hóa đơn bán hàng có một số hóa đơn (SOHĐ) duy nhất, mỗi hóa đơn xác định được khách hàng và ngày lập hóa đơn (NGAYLAPHĐ), ngày bán hàng (NGAYBAN). Với mỗi mặt hàng trong một hóa đơn cho biết số lượng bán (SLBAN) của mặt hàng đó.

12

has Join

Thuộc

Công Trình

MaCTTenCTĐịa ĐiểmNgày Cấp GPNgày Khởi CôngNgày Hoàn Thành

<pi> Characters (10)Characters (20)Characters (30)DateDateDate

MÃ CT...

<pi>

MaNV

MaNVHọTenNgày SinhPháiĐịa chỉ

<pi> Characters (10)Characters (30)DateCharacters (3)Characters (30)

<M>

MÃ Nhân Viên...

<pi>

Phòng Ban

MÃ Phòng BanTên Phòng Ban

<pi> Characters (10)Characters (20)

<M>

MÃ Phòng Ban...

<pi>

Tham Gia

SL ngày Công Integer

Page 13: Draw ERD for the Following Situation

SV: TungTran

13