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) designed to express?

49 questions

  1. 1

    What is an entity-relationship diagram (ERD) designed to express?

    1. A

      The physical layout of database hardware

    2. B

      The sequence of commands used to query a database

    3. C

      The logical design of a database in visual form

    4. D

      The complete source code of a database application

    Correct answer
    C

    The logical design of a database in visual form

    Explanation

    An ERD visually expresses the logical design of a database, including the things it tracks and the relationships among them.

  2. 2

    How can an ERD help during database design?

    1. A

      It specifies the exact hardware on which the database must run.

    2. B

      It automatically determines which users are allowed to access the database.

    3. C

      It replaces the need to decide what information the database should store.

    4. D

      It clarifies what information the database must track and how the information is related.

    Correct answer
    D

    It clarifies what information the database must track and how the information is related.

    Explanation

    An ERD helps clarify the database's information requirements, entities, relationships, and other important aspects of its logical design.

  3. 3

    What is a useful first step when turning a written database requirement into a design?

    1. A

      Identify the nouns in the requirement as possible things the database must track.

    2. B

      Choose primary keys before identifying what information is needed.

    3. C

      Decide which programming language will access the database.

    4. D

      Convert every sentence in the requirement into a database table.

    Correct answer
    A

    Identify the nouns in the requirement as possible things the database must track.

    Explanation

    Identifying nouns in the requirement provides a starting list of possible entities or other things the database needs to track.

  4. 4

    Why might a designer change plural nouns to singular nouns and remove terms such as “Owner” from an initial list?

    1. A

      To distinguish relationships from attributes using grammar

    2. B

      To indicate that the database can store only one instance of each thing

    3. C

      To make the list clearer and remove terms that duplicate an existing concept

    4. D

      To ensure that every noun becomes a separate database table

    Correct answer
    C

    To make the list clearer and remove terms that duplicate an existing concept

    Explanation

    Singular terms make the list consistent, and redundant terms can be removed when one concept is already represented—for example, an owner is a person.

  5. 5

    In the people-and-pets example, why is “Type” clarified as “Pet Type”?

    1. A

      Because the requirement means the kind of animal a pet is, such as a dog or cat

    2. B

      Because “Type” refers to the database's data type for storing a pet's name

    3. C

      Because a pet can have only one type of relationship with a person

    4. D

      Because each person must have a type that identifies their ownership role

    Correct answer
    A

    Because the requirement means the kind of animal a pet is, such as a dog or cat

    Explanation

    The requirement uses “Type” to mean what kind of animal a pet is, so “Pet Type” makes the intended meaning explicit.

  6. 6

    Which set contains the six terms retained for the people-and-pets database example?

    1. A

      Owner, Animal, Name, Image, Type, and Location

    2. B

      Person, Pet, Name, Breed, Owner, and Residence

    3. C

      Person, Pet, Name, Photo, Pet Type, and Address

    4. D

      Person, Owner, Pet, Animal, Photo, and Address

    Correct answer
    C

    Person, Pet, Name, Photo, Pet Type, and Address

    Explanation

    After making terms singular, removing redundant terms, and clarifying “Type,” the six terms are Person, Pet, Name, Photo, Pet Type, and Address.

  7. 7

    Why is it not enough for a database design to list entities such as Person and Pet?

    1. A

      Entities cannot be stored unless each has several photos.

    2. B

      A database can track only relationships, not individual things.

    3. C

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

    4. D

      Relationships are needed only when two entities have identical names.

    Correct answer
    C

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

    Explanation

    The database must capture connections among things as well as the things themselves—for example, that Tricia owns Cleo and Buster.

  8. 8

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

    1. A

      How many instances of one thing can be associated with instances of the other

    2. B

      What data format is used to store an entity's attributes

    3. C

      Whether two entities have the same name

    4. D

      Which entity must be created first in the database

    Correct answer
    A

    How many instances of one thing can be associated with instances of the other

    Explanation

    Cardinality concerns how many of one thing are associated with how many of another, including possible minimum and maximum numbers.

  9. 9

    In the example model, what cardinality is assigned to pet ownership?

    1. A

      Each pet must be owned by exactly one person, and each person may own only one pet.

    2. B

      Each pet may be owned by zero or more people, and each person may own zero or more pets.

    3. C

      Each pet may be owned by one or more people, and each person must own at least one pet.

    4. D

      Each pet may be owned by zero or one person, and each person may own zero or more pets.

    Correct answer
    B

    Each pet may be owned by zero or more people, and each person may own zero or more pets.

    Explanation

    The model allows both pets with no owners and people with no pets, as well as multiple owners per pet and multiple pets per person.

  10. 10

    What cardinalities does the example assign to the relationship between Person and Name?

    1. A

      Each person has zero or one name, and each name belongs to zero or one person.

    2. B

      Each person may have zero or more names, and each name belongs to one person.

    3. C

      Each person has one name, and each name belongs to exactly one person.

    4. D

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

    Correct answer
    D

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

    Explanation

    The model gives each person one name but allows a name to be shared by zero or more people.

  11. 11

    What cardinalities does the example assign to the relationship between Pet and Name?

    1. A

      Each pet may have zero or more names, and each name belongs to one pet.

    2. B

      Each pet has zero or one name, and each name belongs to zero or one pet.

    3. C

      Each pet has one name, and each name belongs to exactly one pet.

    4. D

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

    Correct answer
    D

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

    Explanation

    Each pet must have one name, while the same name may be associated with multiple pets or with no pets.

  12. 12

    What cardinalities does the example assign to the relationship between Photo and Pet?

    1. A

      Each photo depicts one pet, and each pet must appear in at least one photo.

    2. B

      Each photo may depict one or more pets, and each pet may appear in zero or one photo.

    3. C

      Each photo may depict zero or more pets, and each pet appears in exactly one photo.

    4. D

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

    Correct answer
    D

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

    Explanation

    A photo is assigned to one pet, while a pet may have no photos or may be depicted in multiple photos.

  13. 13

    What cardinalities does the example assign to the relationship between Pet Type and Pet?

    1. A

      A pet type applies to exactly one pet, and each pet may have zero or more types.

    2. B

      A pet type may apply to zero or more pets, and each pet has one pet type.

    3. C

      A pet type may apply to zero or one pet, and each pet may have zero or one type.

    4. D

      A pet type must apply to at least one pet, and each pet has exactly one type.

    Correct answer
    B

    A pet type may apply to zero or more pets, and each pet has one pet type.

    Explanation

    The model allows a pet type to have no pets or many pets, while each pet has one pet type.

  14. 14

    What cardinalities does the example assign to the relationship between Pet and Address?

    1. A

      Each pet may reside at many addresses, and each address may have zero or more pets.

    2. B

      Each pet resides at exactly one address, and each address has exactly one pet.

    3. C

      Each pet may reside at zero or one address, and each address must have at least one pet.

    4. D

      Each pet resides at zero or one address, and each address may have zero or more pets.

    Correct answer
    D

    Each pet resides at zero or one address, and each address may have zero or more pets.

    Explanation

    The model permits a pet to have no address or one address, and an address to have no pets or multiple pets.

  15. 15

    Why can an incorrect cardinality decision cause problems for database users?

    1. A

      The database will automatically convert every relationship into an attribute.

    2. B

      The database may reject valid data, such as two pets sharing the same name.

    3. C

      The database will prevent users from creating any table.

    4. D

      The database will be unable to display any entity in a diagram.

    Correct answer
    B

    The database may reject valid data, such as two pets sharing the same name.

    Explanation

    If a design incorrectly requires each name to belong to exactly one pet, users may encounter errors when two pets share a name.

  16. 16

    In Chen notation, how are entities and relationships represented?

    1. A

      Entities use circles, and relationships use double-bordered boxes.

    2. B

      Entities use diamonds, and relationships use boxes connected by ovals.

    3. C

      Entities use boxes, and relationships use diamonds connected to entities by lines.

    4. D

      Entities use lines, and relationships use ovals connected by arrows.

    Correct answer
    C

    Entities use boxes, and relationships use diamonds connected to entities by lines.

    Explanation

    Chen notation places entities in boxes and represents relationships with diamond shapes linked to the relevant entities.

  17. 17

    In Chen notation's mother-daughter example, what do the maximum cardinalities indicate?

    1. A

      A daughter may have at most one mother, while a mother may have at most one daughter.

    2. B

      A daughter must have exactly one mother, while a mother must have exactly one daughter.

    3. C

      A daughter has at most one mother, while a mother may have any number of daughters.

    4. D

      A daughter may have any number of mothers, while a mother has at most one daughter.

    Correct answer
    C

    A daughter has at most one mother, while a mother may have any number of daughters.

    Explanation

    Read from Daughter to Mother, the maximum is one; read from Mother to Daughter, the maximum is N, meaning any number.

  18. 18

    Why might Chen notation use M at one end of a relationship and N at the other, even when both mean “any number”?

    1. A

      To show that one end counts entities and the other counts attributes.

    2. B

      To avoid suggesting that the two maximum counts must be equal.

    3. C

      To indicate that one side is optional and the other is mandatory.

    4. D

      To distinguish a one-to-many relationship from a one-to-one relationship.

    Correct answer
    B

    To avoid suggesting that the two maximum counts must be equal.

    Explanation

    M and N both mean an unlimited or any-number maximum; using different letters avoids implying that the counts on the two sides are literally equal.

  19. 19

    What do the minimum cardinalities and line styles communicate in Chen notation's mother-daughter example?

    1. A

      A daughter must have a mother, shown by a double line; a mother may have no daughters, shown by a single line.

    2. B

      A daughter may have no mother, shown by a double line; a mother must have daughters, shown by a single line.

    3. C

      Both daughters and mothers must participate, so both relationships use double lines.

    4. D

      Neither relationship is mandatory, so both relationships use single lines.

    Correct answer
    A

    A daughter must have a mother, shown by a double line; a mother may have no daughters, shown by a single line.

    Explanation

    The daughter's minimum number of mothers is one, making that relationship universal and represented by a double line. A mother's minimum number of daughters is zero, so that relationship is non-universal and uses a single line.

  20. 20

    In the pet model, which relationships are mandatory for every Pet or Person and therefore shown with double lines in Chen notation?

    1. A

      Each Pet must have an Address and owner, and each Person must have a Photo.

    2. B

      Each Pet must have an owner and a Photo, and each Person must own a Pet.

    3. C

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

    4. D

      Each Pet must have a Photo and Address, and each Person must own a Pet.

    Correct answer
    C

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

    Explanation

    The model makes Name mandatory for each Pet and Person, and Pet Type mandatory for each Pet. These universal relationships are shown with double lines.

  21. 21

    What is an attribute in an ERD?

    1. A

      A rule that limits the number of entities in a relationship

    2. B

      A visual symbol used only to connect two relationships

    3. C

      A characteristic or property of an entity that the database may track

    4. D

      A separate database that stores an entity's relationships

    Correct answer
    C

    A characteristic or property of an entity that the database may track

    Explanation

    Attributes are characteristics or properties of entities that a database is intended to keep track of.

  22. 22

    How are attributes represented in Chen notation?

    1. A

      As diamonds placed between two related entities

    2. B

      As double-bordered boxes connected to the entity

    3. C

      As ovals connected by lines to the entity they describe

    4. D

      As crow's-foot symbols placed at the ends of entity lines

    Correct answer
    C

    As ovals connected by lines to the entity they describe

    Explanation

    In Chen notation, an attribute is shown as an oval connected to its entity by a line.

  23. 23

    Why is Image Filename underlined in the Photo example?

    1. A

      It shows that the filename is a foreign key to another entity.

    2. B

      It uniquely identifies each photo in the system.

    3. C

      It means the attribute is optional for every photo.

    4. D

      It indicates that every photo must have multiple filenames.

    Correct answer
    B

    It uniquely identifies each photo in the system.

    Explanation

    The filename is assumed to be assigned uniquely when a photo is uploaded, so underlining marks it as a unique identifier.

  24. 24

    If Latitude and Longitude together uniquely identify a Geographical Location, how should Chen notation mark them?

    1. A

      Underline Longitude and leave Latitude unmarked.

    2. B

      Underline Latitude and leave Longitude unmarked.

    3. C

      Underline both Latitude and Longitude.

    4. D

      Draw a double border around both attribute ovals.

    Correct answer
    C

    Underline both Latitude and Longitude.

    Explanation

    When a unique identifier consists of multiple attributes, each attribute in that combination is underlined.

  25. 25

    What makes Order Line a weak entity in the example?

    1. A

      It has no attributes that can be stored in a database.

    2. B

      It has a unique identifier that does not include any other entity's identifier.

    3. C

      It can be connected to only one relationship.

    4. D

      Part of its identity depends on the related Order entity.

    Correct answer
    D

    Part of its identity depends on the related Order entity.

    Explanation

    A weak entity derives part of its identity from a related entity. Order Line depends on its parent Order for part of its identifier.

  26. 26

    How is an Order Line uniquely identified in the example?

    1. A

      By using the Order Line's photo filename

    2. B

      By combining the Order Number with the Line Sequence Number

    3. C

      By combining the Order Number with the customer's name

    4. D

      By using the Line Sequence Number alone

    Correct answer
    B

    By combining the Order Number with the Line Sequence Number

    Explanation

    Order Number identifies the parent Order, and the combination of Order Number and Line Sequence Number identifies an Order Line.

  27. 27

    What do the double borders around Order Line and its relationship to Order signify in Chen notation?

    1. A

      Order Line has two independent primary keys.

    2. B

      Order Line has a many-to-many relationship with Order.

    3. C

      Order Line is a weak entity whose identity depends partly on Order.

    4. D

      Order Line is optional and may exist without any Order.

    Correct answer
    C

    Order Line is a weak entity whose identity depends partly on Order.

    Explanation

    The double border on the entity and its relationship indicates a weak entity and its identifying relationship to the parent entity.

  28. 28

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

    1. A

      An attribute can represent a relationship between two entities.

    2. B

      Names cannot be shared by different people or pets.

    3. C

      Entities cannot have attributes when they participate in relationships.

    4. D

      Each Person and each Pet has exactly one Name, so treating Name as a property may be more natural.

    Correct answer
    D

    Each Person and each Pet has exactly one Name, so treating Name as a property may be more natural.

    Explanation

    Because each Person and each Pet has exactly one Name in the example, representing Name as an attribute of each entity may be more natural than making it an entity.

  29. 29

    In a crow's-foot ERD, what indicates that two entities have a relationship?

    1. A

      A line connecting the two entities

    2. B

      A diamond placed between the two entities

    3. C

      An oval attached to each entity

    4. D

      A double border around both entities

    Correct answer
    A

    A line connecting the two entities

    Explanation

    Crow's-foot notation does not require diamonds for relationships; a line between entities is enough to show a relationship.

  30. 30

    What information do the symbols at the ends of a crow's-foot relationship line express?

    1. A

      The names and data types of the entities

    2. B

      The minimum and maximum number of related instances

    3. C

      The order in which database tables are created

    4. D

      The attributes that are shared by both entities

    Correct answer
    B

    The minimum and maximum number of related instances

    Explanation

    The symbols at each end of a relationship line communicate cardinality, including the minimum and maximum numbers.

  31. 31

    How many cardinality symbols are shown for a relationship line in crow's-foot notation, and what does their order mean?

    1. A

      Three symbols are shown, with the first giving the minimum and the last giving the maximum.

    2. B

      Four symbols are shown, two at each end; at each end, the first gives the minimum and the second gives the maximum.

    3. C

      Four symbols are shown at one end; the other end is understood from the entity names.

    4. D

      Two symbols are shown, one at each end; each gives the maximum only.

    Correct answer
    B

    Four symbols are shown, two at each end; at each end, the first gives the minimum and the second gives the maximum.

    Explanation

    Each relationship line has two symbols at each end. At a given end, the first symbol represents the minimum and the second represents the maximum.

  32. 32

    What do the three basic cardinality symbols in crow's-foot notation mean?

    1. A

      A circle means optional, a vertical line means mandatory, and a crow's foot means unknown.

    2. B

      A circle means zero, a vertical line means one, and a crow's foot means many.

    3. C

      A circle means many, a vertical line means zero, and a crow's foot means one.

    4. D

      A circle means one, a vertical line means many, and a crow's foot means zero.

    Correct answer
    B

    A circle means zero, a vertical line means one, and a crow's foot means many.

    Explanation

    The circle represents zero, the vertical line represents one, and the crow's-foot shape represents multiple or many.

  33. 33

    In crow's-foot notation, how is the mother-daughter relationship represented?

    1. A

      A mother may have zero or more daughters, while a daughter has exactly one mother.

    2. B

      A mother may have zero or one daughter, while a daughter must have two or more mothers.

    3. C

      A mother must have one or more daughters, while a daughter may have zero or one mother.

    4. D

      A mother has exactly one daughter, while a daughter may have zero or more mothers.

    Correct answer
    A

    A mother may have zero or more daughters, while a daughter has exactly one mother.

    Explanation

    The mother's end has a minimum of zero and a maximum of many daughters. The daughter's end has a minimum and maximum of one mother.

  34. 34

    What defines a many-to-many relationship when considering maximum cardinalities?

    1. A

      The minimum is zero at both ends of the relationship.

    2. B

      The maximum is many at one end and one at the other.

    3. C

      The maximum is many at both ends of the relationship.

    4. D

      The maximum is one at both ends of the relationship.

    Correct answer
    C

    The maximum is many at both ends of the relationship.

    Explanation

    A many-to-many relationship has a crow's-foot, meaning many, at both ends when maximum cardinalities are considered.

  35. 35

    What defines a one-to-many relationship when considering maximum cardinalities?

    1. A

      The maximum is many at both ends of the relationship.

    2. B

      The minimum is one at one end and zero at the other.

    3. C

      The maximum is one at both ends of the relationship.

    4. D

      The maximum is many at one end and one at the other.

    Correct answer
    D

    The maximum is many at one end and one at the other.

    Explanation

    A one-to-many relationship has a maximum of many at one end and a maximum of one at the other. Read in reverse, it is many-to-one.

  36. 36

    What defines a one-to-one relationship when considering maximum cardinalities?

    1. A

      The maximum is many at both ends, with a crow's foot at each end.

    2. B

      The minimum is zero at both ends, regardless of the maximum.

    3. C

      The maximum is one at both ends, with no crow's feet.

    4. D

      The maximum is one at one end and many at the other.

    Correct answer
    C

    The maximum is one at both ends, with no crow's feet.

    Explanation

    In a one-to-one relationship, each side has a maximum of one, as in the example of employees and employee ID cards.

  37. 37

    How is the Person–Pet relationship classified in the crow's-foot model?

    1. A

      Many-to-one, because a person may own many pets but a pet has at most one owner

    2. B

      Many-to-many, because a person may own many pets and a pet may have many people as owners

    3. C

      One-to-one, because each person owns one pet and each pet has one owner

    4. D

      One-to-many, because a pet may have many people as owners but each person owns one pet

    Correct answer
    B

    Many-to-many, because a person may own many pets and a pet may have many people as owners

    Explanation

    The model permits multiple pets per person and multiple people per pet, so the relationship is many-to-many.

  38. 38

    How is the Pet–Photo relationship classified in the crow's-foot model?

    1. A

      One-to-one, because each pet has exactly one photo

    2. B

      Many-to-one, because each pet depicts one photo and each photo belongs to many pets

    3. C

      One-to-many, because each photo depicts one pet and a pet may appear in many photos

    4. D

      Many-to-many, because each photo depicts many pets and each pet appears in many photos

    Correct answer
    C

    One-to-many, because each photo depicts one pet and a pet may appear in many photos

    Explanation

    Each photo is associated with one pet, while a pet can be depicted in zero or more photos, making the relationship one-to-many from Pet to Photo.

  39. 39

    How is the Pet Type–Pet relationship classified in the crow's-foot model?

    1. A

      One-to-one, because each pet type applies to exactly one pet

    2. B

      Many-to-one, because each pet has many types and each type applies to one pet

    3. C

      One-to-many, because one pet type may apply to many pets and each pet has one type

    4. D

      Many-to-many, because each pet has many types and each type applies to many pets

    Correct answer
    C

    One-to-many, because one pet type may apply to many pets and each pet has one type

    Explanation

    A pet type can apply to multiple pets, while each pet has one pet type, so the relationship is one-to-many from Pet Type to Pet.

  40. 40

    How is the Address–Pet relationship classified in the crow's-foot model?

    1. A

      Many-to-many, because each pet may have many addresses and each address may have many pets

    2. B

      Many-to-one, because each address has at most one pet and each pet may have many addresses

    3. C

      One-to-one, because each address and each pet can participate only once

    4. D

      One-to-many, because an address may have many pets and each pet has at most one address

    Correct answer
    D

    One-to-many, because an address may have many pets and each pet has at most one address

    Explanation

    An address may have zero or more pets, while each pet resides at zero or one address, producing a one-to-many relationship from Address to Pet.

  41. 41

    What do PK and FK indicators mean beside attributes in a crow's-foot ERD?

    1. A

      PK marks a relationship, and FK marks an entity with no attributes.

    2. B

      PK marks a many-to-many relationship, and FK marks a one-to-one relationship.

    3. C

      PK marks a primary key attribute, and FK marks a foreign key attribute also found as a primary key elsewhere.

    4. D

      PK marks an optional attribute, and FK marks an attribute that must be unique within its own entity.

    Correct answer
    C

    PK marks a primary key attribute, and FK marks a foreign key attribute also found as a primary key elsewhere.

    Explanation

    PK stands for primary key. FK stands for foreign key, an attribute that can also be found as a primary key attribute on another entity.

  42. 42

    What is a reasonable goal when adding attributes to an ERD?

    1. A

      Show every possible attribute, even if its relevance is unknown.

    2. B

      Show attributes that uniquely identify entities and perhaps some other significant attributes.

    3. C

      Avoid attributes until after every database table has been implemented.

    4. D

      Show only attributes that are foreign keys and omit identifying attributes.

    Correct answer
    B

    Show attributes that uniquely identify entities and perhaps some other significant attributes.

    Explanation

    An ERD need not list every attribute planned for the finished database, but it should show uniquely identifying attributes and may include other significant ones.

  43. 43

    When translating an ERD into a relational database design, what does each entity and attribute generally become?

    1. A

      Each entity becomes a foreign key, and each attribute becomes a relationship.

    2. B

      Each entity becomes a table, and each attribute becomes a column in its table.

    3. C

      Each entity becomes a column, and each attribute becomes a separate table.

    4. D

      Each entity becomes a constraint, and each attribute becomes a database user.

    Correct answer
    B

    Each entity becomes a table, and each attribute becomes a column in its table.

    Explanation

    The design can be translated by creating a table for each entity and a column for each attribute, along with any additional needed columns.

  44. 44

    How should primary and foreign keys in the database relate to those shown in the ERD?

    1. A

      The tables should use foreign keys only where the ERD shows a many-to-many relationship.

    2. B

      The database should ignore the key indicators because they apply only to diagrams.

    3. C

      The tables should define primary and foreign keys in line with the keys indicated on the entities.

    4. D

      The tables should replace every primary key with a relationship name.

    Correct answer
    C

    The tables should define primary and foreign keys in line with the keys indicated on the entities.

    Explanation

    Primary and foreign keys are defined for the database tables in line with the keys represented on the entities in the diagram.

  45. 45

    Which ERD relationships can generally be implemented as foreign key constraints between tables?

    1. A

      Many-to-many relationships only

    2. B

      All relationships, including many-to-many, without additional tables

    3. C

      One-to-many and one-to-one relationships

    4. D

      Only relationships in which both entities have the same attributes

    Correct answer
    C

    One-to-many and one-to-one relationships

    Explanation

    One-to-many and one-to-one relationships can be represented with foreign key constraints. A many-to-many relationship cannot be represented directly by a single foreign key constraint.

  46. 46

    Why can't a many-to-many relationship, such as Person–Pet ownership, be represented directly by a single foreign key constraint?

    1. A

      Foreign key constraints are used only for attributes, never for relationships.

    2. B

      Many-to-many relationships cannot contain any identifiable entities.

    3. C

      A many-to-many relationship means the entities have no shared data.

    4. D

      A single foreign key constraint does not capture multiple associations on both sides of the relationship.

    Correct answer
    D

    A single foreign key constraint does not capture multiple associations on both sides of the relationship.

    Explanation

    A single foreign key constraint can express one-to-many or one-to-one relationships, but not the multiple associations possible on both sides of a many-to-many relationship.

  47. 47

    How can a database design represent a many-to-many relationship between Person and Pet?

    1. A

      Remove one of the entities and store its name as an attribute of the other.

    2. B

      Replace both entities with one table that permits only one owner per pet.

    3. C

      Create two one-to-one relationships and omit the ownership information.

    4. D

      Introduce a Pet Ownership entity between Person and Pet, creating two one-to-many relationships.

    Correct answer
    D

    Introduce a Pet Ownership entity between Person and Pet, creating two one-to-many relationships.

    Explanation

    An associative entity such as Pet Ownership turns the many-to-many relationship into two one-to-many relationships, which can be implemented with foreign keys.

  48. 48

    If Jenny and Bill both own Rover, how is that represented using a Pet Ownership entity?

    1. A

      As two Pet Ownership instances, one linking Jenny to Rover and one linking Bill to Rover

    2. B

      As one Pet Ownership instance linking Rover to both people without separate associations

    3. C

      As one Pet Ownership instance linking Jenny to Rover, with Bill stored as a pet

    4. D

      As two Pet Ownership instances, each linking Rover to a different pet

    Correct answer
    A

    As two Pet Ownership instances, one linking Jenny to Rover and one linking Bill to Rover

    Explanation

    Each individual ownership is a separate instance of Pet Ownership, so Jenny's ownership of Rover and Bill's ownership of Rover are two instances.

  49. 49

    What happens to the Pet Ownership entity when the ERD is translated into a relational database?

    1. A

      It becomes a many-to-many foreign key constraint between Person and Pet.

    2. B

      It becomes a table, and its two one-to-many relationships can be represented by foreign key constraints.

    3. C

      It becomes a single primary key shared by the Person and Pet tables.

    4. D

      It disappears, because associative entities cannot be represented as tables.

    Correct answer
    B

    It becomes a table, and its two one-to-many relationships can be represented by foreign key constraints.

    Explanation

    The associative entity becomes its own table, and the relationships from Person and Pet to Pet Ownership can each be captured as ordinary foreign key constraints.

Question 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