1. Home
  2. Explore
  3. Computer Science
  4. Entity Relationship Diagrams

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Entity Relationship Diagrams

  • 49Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: ERD Foundations

What is an entity-relationship diagram (ERD), and what is its purpose in database design?

49 questions

  1. 1

    What is an entity-relationship diagram (ERD), and what is its purpose in database design?

    Model answer

    An ERD is a visual way to express the logical design of a database. It shows the things the database tracks and the relationships among them.

    Explanation

    An ERD helps clarify what a database needs to represent before the design is translated into a database structure.

  2. 2

    What information requirements might a database for community pet ownership need to meet?

    Model answer

    It might need to record owners’ names, pets’ names and photos, where pets live, and each pet’s animal type.

    Explanation

    These requirements describe the information the database must keep track of.

  3. 3

    How can identifying nouns in a requirement statement help begin a database design?

    Model answer

    Nouns can help identify the kinds of things the database needs to track, which can become entities or attributes in the design.

    Explanation

    The noun list is a starting point for identifying the database’s main concepts.

  4. 4

    Why should nouns identified from requirements usually be changed to singular form?

    Model answer

    Singular nouns provide a consistent name for each kind of thing, such as using “Person” rather than “People.”

    Explanation

    The pet database’s initial noun list is normalized to singular terms before it is refined.

  5. 5

    Why can “Owner” be removed from the pet database’s noun list while retaining “Person”?

    Model answer

    Because an owner is a person, “Owner” does not identify a separate kind of thing that needs to be tracked.

    Explanation

    Removing redundant terms makes the list of database concepts more concise.

  6. 6

    Why can “Animal” be removed from the noun list, and why should “Type” be changed to “Pet Type”?

    Model answer

    “Animal” is redundant because the animals in scope are pets, while “Pet Type” clarifies that “Type” means the kind of animal a pet is.

    Explanation

    Clarifying and removing redundant terms helps avoid ambiguity in the design.

  7. 7

    What six terms remain after refining the nouns for the pet database, and what do they represent?

    Model answer

    The terms are Person, Pet, Name, Photo, Pet Type, and Address. Each represents a kind of thing the database needs to track.

    Explanation

    Identifying these terms establishes the main concepts for the initial model.

  8. 8

    Why is it not enough for a database design to identify the things it tracks?

    Model answer

    The design must also represent relationships among those things, such as which person owns which pet.

    Explanation

    Recording entities without their relationships would not capture important facts in the requirements.

  9. 9

    What does cardinality describe in a relationship between two kinds of things?

    Model answer

    Cardinality describes how many instances of one thing can be associated with how many instances of another.

    Explanation

    For example, it specifies how many people may own a pet and how many pets a person may own.

  10. 10

    What cardinality is specified between Person and Pet in the pet ownership model?

    Model answer

    Each person owns zero or more pets, and each pet is owned by zero or more people.

    Explanation

    Neither side is required to participate, and either side may be associated with multiple instances on the other side.

  11. 11

    What cardinality is specified between Person and Name?

    Model answer

    Each person has one name, while each name may belong to zero or more people.

    Explanation

    The model allows different people to share the same name.

  12. 12

    What cardinality is specified between Pet and Name?

    Model answer

    Each pet has one name, while each name may belong to zero or more pets.

    Explanation

    The model allows different pets to have the same name.

  13. 13

    What cardinality is specified between Photo and Pet?

    Model answer

    Each photo depicts one pet, while each pet may be depicted in zero or more photos.

    Explanation

    A photo is associated with one pet, but a pet need not have a photo and may have several.

  14. 14

    What cardinality is specified between Pet Type and Pet?

    Model answer

    A pet has one pet type, while a pet type may apply to zero or more pets.

    Explanation

    For instance, a pet type can be shared by multiple pets, but each pet has one type in this model.

  15. 15

    What cardinality is specified between Address and Pet?

    Model answer

    A pet resides at zero or one address, while an address may have zero or more pets living in it.

    Explanation

    The model permits a pet to have no recorded address, but not more than one.

  16. 16

    Why should cardinality decisions be justified during database design?

    Model answer

    Cardinality decisions determine what associations the database permits, so they need plausible reasons grounded in the requirements.

    Explanation

    The choices are not always obvious, but they must reflect the intended rules of the system.

  17. 17

    What problem could arise if a design requires every pet name to belong to exactly one pet?

    Model answer

    The system could reject a second pet with the same name, even though the requirements may allow pets to share names.

    Explanation

    An overly restrictive cardinality can cause the database to fail to support valid real-world cases.

  18. 18

    In Chen notation, how are entities and relationships represented?

    Model answer

    Entities are shown as boxes, and relationships are shown as diamonds connected to the relevant entities by lines.

    Explanation

    The pet database’s Person, Pet, and Photo concepts would each be placed in entity boxes.

  19. 19

    In Chen notation, what do the cardinality labels at the ends of a relationship indicate?

    Model answer

    They indicate the maximum number of instances that can participate from each end of the relationship.

    Explanation

    The notation can also show minimum participation using line styles.

  20. 20

    In the Chen notation mother-daughter example, what does the maximum cardinality say about a daughter’s mothers and a mother’s daughters?

    Model answer

    A daughter has a maximum of one mother, while a mother may have any number of daughters, represented by NNN.

    Explanation

    The maximum is read in either direction from the entity at that end of the relationship.

  21. 21

    What does a double line mean in Chen notation, and what does a single line mean?

    Model answer

    A double line indicates mandatory or universal participation; a single line indicates that participation is not universal.

    Explanation

    A daughter must have a biological mother, but a mother need not have any daughters.

  22. 22

    Why does the mother-daughter example use a double line on the daughter’s relationship to Mother but a single line on the mother’s relationship to Daughter?

    Model answer

    Every daughter must have a biological mother, but some mothers have no daughters.

    Explanation

    The double line marks the daughter’s required participation, while the single line marks the mother’s optional participation.

  23. 23

    Which relationships in the pet model have mandatory participation for the Pet or Person entity?

    Model answer

    Each Pet must have a Name and a Pet Type, and each Person must have a Name.

    Explanation

    These required relationships are shown with double lines in the Chen diagram.

  24. 24

    Why might Name be represented as an attribute of Person and Pet instead of as an entity of its own?

    Model answer

    Each person and each pet has exactly one name, so representing Name as an attribute of each entity may be more natural.

    Explanation

    The design can be amended to reflect how the name functions in the requirements.

  25. 25

    How does Chen notation show attributes, and how can it mark a unique attribute?

    Model answer

    It shows each attribute as an oval connected to its entity, and underlines an attribute that uniquely identifies an entity.

    Explanation

    For a Photo, Image Filename and Date Uploaded can be shown as attributes, with Image Filename underlined if it is unique.

  26. 26

    How should a composite unique identifier be shown in Chen notation?

    Model answer

    Underline every attribute that together forms the unique identifier.

    Explanation

    For a Geographical Location identified by Latitude and Longitude together, both attributes are underlined.

  27. 27

    What is a weak entity, and how does Chen notation represent one?

    Model answer

    A weak entity derives part of its identity from a related entity. Chen notation shows it with a double-bordered entity box and a double-bordered relationship.

    Explanation

    An Order Line depends partly on its parent Order for identification.

  28. 28

    How is an Order Line identified in the Order and Order Line example?

    Model answer

    It is identified by the combination of its parent Order’s Order Number and its Line Sequence Number.

    Explanation

    Line Sequence Number alone does not identify an Order Line; Order Number supplies the remaining part of its identity.

  29. 29

    In crow’s foot notation, how are relationships and their cardinalities represented?

    Model answer

    A line connects related entities, and symbols at each end of the line express the relationship’s cardinality.

    Explanation

    Unlike Chen notation, crow’s foot notation does not use a diamond to represent the relationship.

  30. 30

    What do the circle, vertical line, and crow’s foot symbols mean in crow’s foot notation?

    Model answer

    The circle means zero, the vertical line means one, and the crow’s foot means many.

    Explanation

    Together, these symbols express minimum and maximum participation.

  31. 31

    How do the two symbols at one end of a crow’s foot relationship line express cardinality?

    Model answer

    The first symbol gives the minimum number and the second gives the maximum number.

    Explanation

    Each relationship has two symbols at each end, for four cardinality symbols in total.

  32. 32

    How would crow’s foot notation show that each mother may have zero or more daughters and each daughter has exactly one mother?

    Model answer

    At the Mother end, use zero as the minimum and many as the maximum; at the Daughter end, use one as both the minimum and maximum.

    Explanation

    The circle and crow’s foot encode zero or more, while two one symbols encode exactly one.

  33. 33

    What are the three basic relationship types identified by looking at maximum cardinalities?

    Model answer

    They are many-to-many, one-to-many (or many-to-one in the reverse direction), and one-to-one.

    Explanation

    These types are distinguished by whether the maximum at each end is many or one.

  34. 34

    How can you recognize a many-to-many relationship, and what is an example from the pet database?

    Model answer

    It has a many maximum at both ends; Pet and Person form a many-to-many relationship because pets may have multiple owners and people may own multiple pets.

    Explanation

    The pet model also permits either side to have zero associations.

  35. 35

    How can you recognize a one-to-many relationship, and what is an example from the pet model?

    Model answer

    It has a maximum of one at one end and many at the other; one pet may be depicted in many photos, while each photo depicts one pet.

    Explanation

    The same relationship can be described as many-to-one when read in the opposite direction.

  36. 36

    How can you recognize a one-to-one relationship?

    Model answer

    It has a maximum of one at both ends, such as the relationship in which each employee has one employee ID card and each card belongs to one employee.

    Explanation

    There are no crow’s foot symbols at either end because neither side can be associated with multiple instances.

  37. 37

    What relationship types connect Photo to Pet, Pet Type to Pet, and Address to Pet in the pet model?

    Model answer

    Each is one-to-many: each photo depicts one pet while a pet may have many photos; each pet has one type while a type may apply to many pets; and each pet has at most one address while an address may have many pets.

    Explanation

    The optional minimums do not change the one-to-many classification, which is based on maximum cardinalities.

  38. 38

    Which attributes should an ERD include when the goal is to make it informative without listing every database column?

    Model answer

    It should include uniquely identifying attributes and may include a selection of other significant attributes.

    Explanation

    An ERD does not necessarily need to display every attribute planned for the finished database.

  39. 39

    What is an attribute in an ERD, and what are two example attributes of Photo?

    Model answer

    An attribute is a characteristic or property that the database tracks for an entity. Image Filename and Date Uploaded are example attributes of Photo.

    Explanation

    In Chen notation, attributes are drawn as ovals connected to their entity.

  40. 40

    Why might Image Filename be underlined as a Photo attribute?

    Model answer

    It is assumed to be unique for each photo, so it can uniquely identify a Photo.

    Explanation

    The example assumes that the system assigns a unique filename when a photo is uploaded.

  41. 41

    What do PK and FK indicators mean beside attributes in an ERD?

    Model answer

    PK means primary key, and FK means foreign key; a foreign key attribute also appears as a primary key attribute on another entity.

    Explanation

    These indicators help show how entities will be identified and linked in the relational database.

  42. 42

    What is the difference between a primary key and a foreign key in the described ERD?

    Model answer

    A primary key identifies an entity’s records, while a foreign key is an attribute that corresponds to a primary key on another entity.

    Explanation

    The diagram marks these attributes so they can guide the database’s key definitions.

  43. 43

    Why might Order Number not be drawn as an Order Line attribute in Chen notation even though it contributes to identifying an Order Line?

    Model answer

    Order Line is a weak entity, so its double borders indicate that it derives part of its identity from Order; Order Number is understood through that relationship.

    Explanation

    Order Line is identified by Order Number combined with Line Sequence Number, even though Order Number is not explicitly shown as its attribute in this notation.

  44. 44

    How can a conceptual ERD be translated into the skeleton of a relational database?

    Model answer

    Create a table for each entity and a column for each attribute, then define primary and foreign keys in line with those shown in the diagram.

    Explanation

    Additional columns can be included as the database design is developed.

  45. 45

    How are one-to-many and one-to-one relationships represented in the relational database described?

    Model answer

    Each becomes a foreign key constraint in the database.

    Explanation

    The relationship’s key structure lets the database enforce the association.

  46. 46

    Why can’t a many-to-many relationship be represented directly using an ordinary foreign key constraint?

    Model answer

    A foreign key constraint can represent one-to-many or one-to-one relationships, but not a many-to-many relationship directly.

    Explanation

    The Person–Pet relationship therefore needs an additional modeling step.

  47. 47

    How can a many-to-many relationship be transformed into relationships that can use ordinary foreign keys?

    Model answer

    Introduce an associative entity between the original entities, turning the many-to-many relationship into two one-to-many relationships.

    Explanation

    For pet ownership, PET OWNERSHIP is placed between PERSON and PET.

  48. 48

    How does the PET OWNERSHIP entity represent multiple people owning the same pet or one person owning multiple pets?

    Model answer

    Each person–pet ownership pair is a separate instance of PET OWNERSHIP, so different owners of one pet and different pets owned by one person are recorded as separate instances.

    Explanation

    For example, Jenny and Bill owning Rover produce two ownership instances; Martin owning Skipper and Claude also produces two.

  49. 49

    How does the PET OWNERSHIP table allow the database to enforce the original many-to-many relationship?

    Model answer

    PET OWNERSHIP becomes a table with one-to-many relationships to PERSON and PET, and both relationships can be implemented with ordinary foreign key constraints.

    Explanation

    The associative table records each ownership pair while avoiding a direct many-to-many foreign key constraint.

1 of 49
Question 1 of 49

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent