ER diagrams and relationships

This study set covers essential concepts of ER diagrams and the relationships between entities in database design, which are crucial for understanding how data is structured and interconnected in relational databases.

Charlotte2008·64 flashcards·64 questions
collegecomputer_sciencedatabases
0
Known
1 / 64
0
Learning
Front

Define an Entity in ER Diagrams.

Tap to flip
Back

An entity is a distinct object or thing in the domain. Examples include 'Customer' or 'Order'.

Tap to flip
Got it
Still learning

Quiz(64 questions)

Question 1 of 64

1. What is a characteristic of a One-to-One (1:1) relationship?

Terms in this Study Set(64)

Fundamentals of ER Diagrams(16)

Define an Entity in ER Diagrams.

An entity is a distinct object or thing in the domain. Examples include 'Customer' or 'Order'.

True or False: An ER diagram can represent many-to-many relationships.

True. ER diagrams can represent many-to-many relationships through the use of junction tables.

What does 'Cardinality' refer to?

Cardinality specifies the number of instances of one entity that can or must be associated with each instance of another entity.

List the three types of cardinality.

- One-to-One - One-to-Many - Many-to-Many

Fill in the blank: An __________ connects entities in an ER diagram.

relationship

What is a Relationship?

A relationship describes how two entities interact. Examples include 'purchases' or 'belongs to'.

Compare weak entity and strong entity.

A strong entity can exist independently, while a weak entity relies on a strong entity for its existence.

What is an Attribute?

An attribute is a property or characteristic of an entity. For instance, 'Name' and 'Price' are attributes of 'Product'.

Describe the purpose of ER Diagrams.

ER diagrams visually represent the data structure and relationships in a database, aiding in design and understanding.

True or False: ER diagrams can only represent data but not relationships.

False. ER diagrams represent both data and the relationships between different entities.

Example of a One-to-Many relationship.

A 'Customer' can place multiple 'Orders', but each 'Order' is placed by one 'Customer'.

What is an Attribute’s role in an entity?

Attributes provide specific details about an entity, defining its properties or characteristics.

List two common ER diagram symbols.

- Rectangle for entities - Diamond for relationships

What is a Composite Attribute?

A composite attribute can be divided into smaller sub-attributes, such as 'Full Name' into 'First Name' and 'Last Name'.

Cause → Effect: Adding a new attribute to an entity.

Cause: New data needs arise → Effect: The ER diagram is updated to include the new attribute.

What does a Primary Key represent?

A primary key uniquely identifies each record in an entity, ensuring no duplicates exist.

Types of Relationships(16)

One-to-One (1:1) Relationship

Each entity in set A is related to one and only one entity in set B. Example: A person has one passport.

One-to-Many (1:N) Relationship

An entity in set A can relate to multiple entities in set B. Example: A teacher can teach many classes.

Many-to-One (N:1) Relationship

Multiple entities in set A can relate to a single entity in set B. Example: Many students belong to one school.

Many-to-Many (M:N) Relationship

Entities in set A can relate to multiple entities in set B and vice versa. Example: Students enroll in multiple courses.

True or False: 1:1 means one entity relates to many.

False. 1:1 means each entity relates to exactly one of the other type.

Fill in the blank: In a 1:N relationship, ___ relates to many.

One entity relates to many, while the other relates to one.

What characterizes a recursive relationship?

An entity relates to itself. Example: An employee manages other employees.

Comparison: 1:N vs. M:N

1:N has a single origin with multiple destinations; M:N has multiple origins and destinations.

Cause: Many-to-Many relationships require what?

A junction table to properly link the two entities and resolve relations.

What is a junction table?

A table that connects two or more related tables to handle many-to-many relationships.

True or False: A 1:1 relationship can have null values.

True, one entity may not exist for the other.

What is a hierarchical relationship?

A type of relationship where entities are organized in a tree structure, like an organizational chart.

Example of a hierarchical relationship.

A company structure: CEO -> Manager -> Employee.

In ER diagrams, relationships are represented by what symbol?

A diamond shape connects entities, indicating their relationship type.

True or False: Relationships can exist without entities.

False. Relationships define how entities interact; they require entities.

What does cardinality indicate?

The number of instances of one entity related to instances of another; essential for defining relationships.

Attributes and Entities(16)

Attribute → Definition

An attribute is a property or characteristic of an entity in an ER diagram that describes its features.

Entity → Definition

An entity is a distinct object or thing in the database that can be identified and has attributes.

True or False: Attributes can exist independently of entities.

False. Attributes are dependent on entities; they describe the properties of entities.

Example of an entity

A student is an example of an entity. It has attributes like Student ID, Name, and Major.

What is a composite attribute?

A composite attribute is an attribute that can be divided into smaller sub-attributes. E.g., Full Name can be divided into First Name and Last Name.

Single-valued vs. multi-valued attributes

- Single-valued: only one value per entity. - Multi-valued: multiple values allowed per entity, e.g., Phone Numbers.

Fill in the blank: An entity set is a collection of _____.

Entities that share the same attributes.

Derived attribute → Example

An attribute that is derived from other attributes. E.g., Age can be derived from Date of Birth.

What distinguishes a primary key?

A primary key uniquely identifies each entity in an entity set, ensuring no duplicate entries.

Entity Types vs. Entity Instances

Entity types are templates for entities (e.g., Student), while entity instances are actual entries (e.g., John Smith).

True or False: Attributes can have different data types.

True. Attributes can be of various data types, such as integer, string, or date.

What is a key attribute?

A key attribute is an attribute that is used to uniquely identify an entity instance within an entity set.

What is a weak entity?

A weak entity is an entity that cannot be uniquely identified by its attributes alone and relies on a 'strong' entity.

Example of a composite attribute

Address can be a composite attribute consisting of Street, City, State, and Zip Code.

What role do attributes play in an ER diagram?

Attributes provide specific details about entities, defining their properties and adding depth to the data model.

Cause → Effect: Adding attributes to entities.

Adding attributes enhances the detail and usability of the entity representation.

Advanced ER Concepts(16)

What is a ternary relationship?

A ternary relationship involves three entities. Example: An order contains a customer, a product, and a sales representative.

True or False: A weak entity can exist without a strong entity.

False. A weak entity cannot exist independently and relies on a strong entity for its existence.

Define a recursive relationship.

A recursive relationship occurs when an entity is related to itself. Example: An employee manages other employees.

What is an associative entity?

An associative entity is used to represent a many-to-many relationship, holding attributes that describe the relationship.

Fill in the blank: A _____ relationship involves two entities and includes a third entity.

ternary

Compare strong and weak entities.

Strong entities have primary keys; weak entities depend on strong entities and have a partial key.

What is generalization in ER diagrams?

Generalization is the process of extracting shared characteristics from two or more classes into a generalized superclass.

Cause → Effect: What happens if an entity is removed?

If a parent entity is removed, dependent weak entities may also be deleted.

What are derived attributes?

Derived attributes are those calculated from other attributes, such as age from a birthdate.

True or False: All relationships in ER diagrams must have attributes.

False. Relationships can exist without attributes, but they can have attributes for additional detail.

Define a multi-valued attribute.

A multi-valued attribute can hold multiple values for a single entity, such as phone numbers for a contact.

What is specialization in ER diagrams?

Specialization is the process of defining one or more sub-entities of a higher-level entity based on some distinguishing characteristics.

Illustrate a complex relationship type.

A complex relationship type may include multiple entities, like a course that involves students, instructors, and classrooms.

Fill in the blank: An _____ entity cannot exist without a related strong entity.

weak

What is a participation constraint?

A participation constraint defines whether all or only some entity occurrences participate in a relationship. It can be total or partial.

True or False: An associative entity can have attributes.

True. An associative entity typically has its own attributes in addition to linking two entities.

Questions in this Study Set(64)

1. What is a characteristic of a One-to-One (1:1) relationship?

A.Each entity in one set is related to exactly one entity in another set.
B.One entity can relate to many entities in another set.
C.Entities can relate to themselves in a cyclic manner.
D.Entities can belong to multiple groups.

2. What best describes an attribute in an ER diagram?

A.A characteristic of an entity
B.A group of entities
C.A type of relationship
D.An entity instance

3. What does an entity represent in an ER diagram?

A.A specific object or concept
B.A relationship between entities
C.A type of attribute
D.A set of data records

4. What best describes a ternary relationship in an ER diagram?

A.Involves three entities
B.Involves two entities
C.Involves four entities
D.Involves one entity

5. In a One-to-Many (1:N) relationship, how many entities can the entity in set A relate to?

A.One
B.Many
C.None
D.Two

6. Which of the following is an example of an entity?

A.A car
B.The color red
C.A set of attributes
D.A relationship

7. True or False: A weak entity cannot exist without a strong entity.

A.True
B.False
C.Only in certain scenarios
D.Depends on the database design

8. Which statement is true about weak entities?

A.They can exist independently.
B.They rely on strong entities.
C.They have a primary key.
D.They do not have any attributes.

9. What describes a Many-to-One (N:1) relationship?

A.Many entities in one set are related to one entity in another set.
B.One entity relates to many entities.
C.Entities relate to themselves.
D.Entities are unrelated.

10. True or False: Attributes can exist independently of entities.

A.True
B.False
C.Not always
D.Depends on the situation

11. What does the term 'relationship' indicate in an ER diagram?

A.A characteristic of an entity
B.The connection between two entities
C.A specific data type
D.An attribute of an attribute

12. How is a recursive relationship best defined?

A.Entity relates to itself
B.Entity relates to multiple entities
C.Entity has no relationships
D.Entity is a weak entity

13. Which of the following scenarios best illustrates a Many-to-Many (M:N) relationship?

A.Students enroll in multiple courses.
B.A teacher manages one classroom.
C.A school has one principal.
D.An employee reports to one manager.

14. What would be an example of a composite attribute?

A.Full Name
B.Age
C.Student ID
D.Email Address

15. Which is NOT a type of cardinality in ER diagrams?

A.One-to-One
B.One-to-Many
C.Many-to-Some
D.Many-to-Many

16. What is the purpose of an associative entity?

A.To represent one-to-many relationships
B.To hold attributes for many-to-many relationships
C.To create weak entities
D.To simplify ER diagrams

17. True or False: A 1:1 relationship indicates that one entity can relate to many.

A.True
B.False
C.Sometimes true
D.Not applicable

18. Which attribute type allows multiple values for a single entity?

A.Multi-valued attribute
B.Single-valued attribute
C.Derived attribute
D.Key attribute

19. What is the role of a primary key in an entity?

A.To categorize data
B.To uniquely identify records
C.To represent relationships
D.To define attributes

20. In ER diagrams, what is a multi-valued attribute?

A.An attribute that has a single value
B.An attribute that can hold multiple values
C.An attribute that is derived from other attributes
D.An attribute that is unique to an entity

21. Fill in the blank: In a 1:N relationship, ___ relates to many.

A.One entity
B.Many entities
C.No entity
D.All entities

22. Fill in the blank: An entity set is a collection of _____.

A.Entities with similar attributes
B.Attributes
C.Relationships
D.Data types

23. Which of the following is an example of a One-to-Many relationship?

A.One student has one ID
B.One teacher teaches multiple classes
C.One car is owned by one person
D.One city has one mayor

24. What happens to weak entities if their corresponding strong entity is deleted?

A.They become strong entities
B.They remain unchanged
C.They are also deleted
D.They lose all attributes

25. What is a recursive relationship?

A.An entity relating to itself.
B.Multiple entities relating to one.
C.Many entities relating to many.
D.One entity relating to one.

26. What is a derived attribute?

A.An attribute that can be calculated from other attributes
B.An attribute that is static
C.An attribute with multiple values
D.An attribute that uniquely identifies an entity

27. Fill in the blank: An ER diagram consists of entities, attributes, and __________.

A.relationships
B.records
C.files
D.schemas

28. Which of the following is NOT a characteristic of derived attributes?

A.They are calculated from other attributes
B.They are stored directly in the database
C.They can represent age from birthdate
D.They provide additional information

29. How does a 1:N relationship differ from a M:N relationship?

A.1:N has one source relating to many, while M:N has many sources relating to many.
B.1:N allows no relationships.
C.M:N must always involve only one entity.
D.1:N is the same as M:N.

30. What does a primary key do in an entity set?

A.Uniquely identifies each entity
B.Groups similar entities
C.Defines attributes
D.Describes relationships

31. What is an attribute in the context of ER diagrams?

A.A type of entity
B.A property of an entity
C.A connection between entities
D.A diagram element

32. What is the main function of generalization in ER diagrams?

A.To break down entities into sub-entities
B.To define relationships
C.To abstract shared characteristics
D.To create weak entities

33. What is required for many-to-many relationships to function properly?

A.A junction table.
B.A single entity.
C.Multiple properties.
D.No requirements.

34. Which of the following best describes a weak entity?

A.An entity that cannot be uniquely identified by its attributes alone
B.An entity with no attributes
C.An entity with multiple instances
D.An entity that has a strong primary key

35. What does a composite attribute represent?

A.An entity with multiple relationships
B.An attribute that can be subdivided
C.A unique identifier
D.A type of relationship

36. Which statement accurately compares strong and weak entities?

A.Strong entities depend on weak entities
B.Weak entities have primary keys
C.Strong entities exist independently
D.Weak entities can exist independently

37. Which statement correctly describes a junction table?

A.A table that links two or more related tables.
B.A table that holds only unique entities.
C.A table with no relationships.
D.A table that includes only one entity.

38. True or False: Attributes can have varied data types.

A.True
B.False
C.Only for certain attributes
D.Depends on the entity

39. True or False: ER diagrams can represent complex relationships.

A.True
B.False
C.Only simple relationships
D.Depends on the software used

40. Fill in the blank: A _____ relationship can involve more than two entities.

A.binary
B.ternary
C.recursive
D.one-to-one

41. True or False: A 1:1 relationship can have null values.

A.True
B.False
C.Only in certain cases
D.Not applicable

42. What distinguishes key attributes from regular attributes?

A.They uniquely identify entity instances
B.They provide more information
C.They are derived from other attributes
D.They can hold multiple values

43. How do attributes help define an entity?

A.By identifying relationships
B.By providing characteristics
C.By categorizing entities
D.By connecting to other entities

44. Which of the following best describes a participation constraint?

A.Defines the number of relationships
B.Specifies if all or some entities participate
C.Indicates weak entity status
D.Describes entity attributes

45. What defines a hierarchical relationship?

A.Entities arranged in a tree structure.
B.Entities having no clear structure.
C.A flat arrangement of entities.
D.Entities forming a single line.

46. Which is NOT a type of attribute?

A.Composite attribute
B.Key attribute
C.Link attribute
D.Derived attribute

47. What do rectangles represent in an ER diagram?

A.Attributes
B.Relationships
C.Entities
D.Primary keys

48. Which of the following is true about associative entities?

A.They cannot have attributes
B.They often link two entities
C.They are always weak entities
D.They cannot represent many-to-many relationships

49. Which scenario exemplifies a hierarchical relationship?

A.A company structure: CEO -> Manager -> Employee.
B.Students in multiple classes.
C.Teachers with various subjects.
D.A marketplace with many vendors.

50. What role do attributes serve in an ER diagram?

A.They define the properties of entities
B.They represent relationships
C.They classify entities
D.They serve as primary keys

51. Which of the following is a characteristic of a strong entity?

A.Depends on another entity
B.Can exist independently
C.Has no attributes
D.Is always a primary key

52. How is specialization defined in ER diagrams?

A.Creating generalized entities
B.Defining sub-entities from a higher-level entity
C.Combining multiple entities
D.Eliminating attributes from entities

53. In ER diagrams, how are relationships represented?

A.By a diamond shape.
B.By circles.
C.By squares.
D.By arrows.

54. What is the effect of adding attributes to an entity?

A.Increases detail and usability
B.Reduces complexity
C.Makes entities redundant
D.Eliminates the need for relationships

55. What happens when a new attribute is added to an entity?

A.The entity is deleted
B.The ER diagram is updated
C.All relationships are lost
D.The primary key changes

56. Which relationship type involves multiple entities interacting together?

A.Binary relationship
B.Complex relationship type
C.Weak relationship
D.Strong relationship

57. True or False: Relationships can exist without entities.

A.True
B.False
C.Sometimes true
D.Not applicable

58. What is the difference between entity types and entity instances?

A.Entity types are templates, while instances are actual entries
B.Entity types are specific, while instances are general
C.Entity types cannot have attributes, while instances can
D.Entity types are always singular, while instances are plural

59. What does 'cardinality' indicate in ER diagrams?

A.The type of entity
B.The number of instances in a relationship
C.The type of attribute
D.The design complexity

60. What is a key feature of multi-valued attributes?

A.They can only hold unique values
B.They must hold a single value
C.They can hold multiple values for one entity
D.They are always derived attributes

61. What does cardinality indicate in the context of relationships?

A.The number of instances of one entity related to another.
B.The types of entities involved.
C.The strength of a relationship.
D.The direction of a relationship.

62. Which of the following statements about multi-valued attributes is correct?

A.Multi-valued attributes can hold more than one value for a single entity.
B.Multi-valued attributes can only hold a single value for a single entity.
C.Multi-valued attributes are derived from other attributes.
D.Multi-valued attributes are used to uniquely identify entities.

63. Which of the following statements accurately describes a relationship in an ER diagram?

A.It shows how entities interact with each other.
B.It represents the properties of an entity.
C.It defines the primary keys of the entities.
D.It illustrates the hierarchy of attributes.

64. Which statement is true regarding a complex relationship type in ER diagrams?

A.It can involve multiple entities interacting together.
B.It cannot contain attributes.
C.It is only applicable to one-to-one relationships.
D.It requires at least one weak entity.

Related Study Sets

Create Your Own Study Set

Upload a PDF, paste your notes, or describe a topic – AI generates flashcards, quizzes and more in seconds.