1 / 6

Cardinality

Cardinality - refers to the number of times instances in one entity can be related to instances in another entity One instance in an entity refers to one and only one instance in the related entity ( 1:1 )  “one-to-one”

steve
Download Presentation

Cardinality

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cardinality - refers to the number of times instances in one entity can be related to instances in another entity One instance in an entity refers to one and only one instance in the related entity (1:1)  “one-to-one” One instance in an entity refers to one or more instances in the related entity (1:N)  “one-to-many” One or more instances in an entity refer to one or more instances in the related entity (M:N)  “many-to-many” Modality - Refers to whether or not an instance of a child entity can exist without a related instance in the parent entity Not Null means that an instance in the related entity must exist for an instance in another entity to be valid Null means that instance in the related entity is not necessary for an instance in another entity to be valid Cardinality

  2. Relationship Cardinality …an example • 1 : 1 one-to-one • satu orang staf ( contoh ketua jabatan) akan menguruskan satu jabatan dan satu jabatan akan hanya mempunyai satu ketua jabatan sahaja • 1 : N one-to-many • satu orang pelanggan boleh membuat banyak tempahan tetapi bagi satu tempahan adalah untuk satu pelanggan sahaja • M : N many-to-many • satu orang pelajar boleh mendaftar banyak kursus dan satu kursus boleh ambil ramai pelajar

  3. Relationship Cardinality Mandatory 1 cardinality (1,1) or Mandatory many (M) cardinality (1, 2,…,many), n is a number for an upper limit) (1,n) or Optional 0 or 1 cardinality (0,1) or Optional zero-many cardinality (0,1,2,…many) (0,n) or

  4. ERD : Contoh Entity-Relationship Diagram: MISville Library This is the entity-relationship diagram for the MISville Library: AttributesB #1:  ISBN Number B #2:  Title B #3:  Subject(s) B #4:  Author(s) B #5:  Date of Publication B #6:  Acquisition Number LC #1:  Name LC #2:  Address LC #3:  Phone LC #4:  DOB LC #5:  SSN LC #6:  Card Number AJ #1:  ISBN Number AJ #2:  Title AJ #3:  Subject(s) AJ #4:  Author(s) AJ #5:  Date of Publication AJ #6:  Acquisition Number CC #1:  Book Title CC #2:  Author(s) CC #3:  Subject(s)  Data Modeling - ERD

  5. Whenever new patients are seen for the first time, they complete a patient information form that asks their name, address, phone number, and insurance agent, all of which is stored in the patient information file. Patients can be signed up with only one agent. Each time a patient visits its doctor, an insurance claim is sent to the agent for payment. The claim must contain information about the visit, such as the date, purpose, and cost. It would be possible for a patient to submit two claims on the same day. Draw an ERD for the situation. address name # phone Patient Doctor Insurance name visit submit sign (0, 2) date Insurance Claim Insurance Agent cost send (0, 2) (0, 1) purpose

  6. Read the situation given below, Food Order System is used by Yummy Restaurant to manage every order from their customers. The Food Order System has few functions and very user friendly. It begins when the system receives order from the customer. The system will produce receipt by referring to the order. The order is also sent to the kitchen department. The system also used the information from the order to update their inventory as well as their sales. The system also has function to generate reports for the top management, i.e. sales report and inventory report. Food Order System digunakan oleh Yummy Restaurant untuk mengurus setiap tempahan dari pelanggan. Food Order System ini mempunyai beberapa fungsi dan ramah pengguna. Ia bermula apabila sistem menerima tempahan dari pelanggan. Sistem akan mengeluarkan resit dengan merujuk kepada tempahan. Tempahan juga dihantar kepada bahagian dapur. Sistem juga menggunakan maklumat dari tempahan untuk mengemaskini inventori serta jualan. Sistem juga mempunyai fungsi untuk menghasilkan laporan-laporan bagi pihak pengurusan, iaitu laporan jualan dan laporan inventori Draw ERD for the situation given. Practice: Food Order System

More Related