L.02 Flashcards

Entity-Relationship Models

1
Q

What are the two main activities in database design?

A

1) Database design – Structuring the data model.
2) Application design – Implementing how the database interacts with applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the focus of conceptual database design?

A

-Designing the conceptual schema for a database application
-Mapping real-world entities and relationships

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why are ER diagrams useful?

A

1) Simpler than UML
2) Closely maps to relational algebra and the logical database design.
3) Widely used in industry

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three main components of an ER diagram?

A

1) Entities – Real-world objects.
2) Attributes – Properties of entities.
3) Relationships – Associations between entities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the difference between an entity and an entity type?

A

-Entity: A specific object (e.g., “John Smith” as an EMPLOYEE)
-Entity Type: A collection of similar entities (e.g., EMPLOYEE type)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the types of attributes in an ER model?

A

1) Simple (Atomic) – Every entity has exactly one atomic value.
2) Composite – Made of multiple components (e.g., Address = Street + City + Zip)
3) Multi-valued – Entity may have a list of values for that attribute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a key attribute? What is its notation?

A

An attribute where each entity must have a unique value.
Example: SSN for an EMPLOYEE
Notation: Each key attribute is underlined.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a derived attribute? What is its notation?

A

An attribute that is computed from other attributes. Their value can be derived (calculated from other information).
Notation: Attribute with a dashed line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an entity set?

A

A collection of entities stored in a database at a given time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between a primary key and a composite key?

A

Primary Key – A single attribute uniquely identifying an entity
Composite Key – A combination of attributes forming a unique identifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a weak entity?
What’s its notation?

A

An entity that does not have a key of its own. It needs an owner entity to be uniquely identified.
Weak entities are identified through a partial key and the owner.

Notation:
Double-line entity symbol and association symbol
For partial key: dashed underline

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How are weak entities represented in ER diagrams?

A

Double-lined boxes for weak entities.
Double-lined relationships to owner entity.
Dashed underline for partial key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the types of relationships in an ER model?

A

1:1 (One-to-One) – One entity is related to one entity in another type.
1:N (One-to-Many) – One entity is related to many entities in another type. (N can also be 0!)
M:N (Many-to-Many) – Many entities in one type relate to many entities in another. (N and M can be 0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the notation for relationships in ER diagrams?

A

Diamonds represent relationships
Straight lines connect entities
Cardinality notation (1:1, 1:N, M:N)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the Relationship Cardinalities?

A

The cardinality of a relationship type is the number of
participating entity types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is total participation in a relationship?

A

Every entity in an entity set must participate in the relationship
Represented by double lines in ER diagrams

17
Q

What are Participation constraints and what are their types?

A

Participation constraint indicates whether a relationship needs to exist for each concrete entity.
-Required (called total participation, double line)
-Not Required (called partial participation, single line)

18
Q

Can an entity have multiple relationships with another entity?

19
Q

What are ternary relationships?

A

Relationships involving three or more entity types

20
Q

Can relationships have attributes?

21
Q

What are the key takeaways from ER modeling?

A

-Entities, relationships, and attributes are fundamental

-Keys uniquely identify entities

-Cardinality defines the relationship constraints

-Weak entities rely on owners

-Notation is important for designing databases

22
Q

What are some advanced ER concepts?

A

-Composed keys and attributes

-Weak entity types

-Derived attributes

-Association attributes