Midterm Flashcards

1
Q

What is EER (Enhanced Entity-Relationship) in database modeling?

A

EER (Enhanced Entity-Relationship) is an extension of the Entity-Relationship (ER) model that includes additional modeling concepts like specialization/generalization, category (union type), and aggregation, making it more expressive and capable of representing more complex real-world scenarios.

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

What does ‘cardinality’ refer to in the context of the EER model?

A

Cardinality refers to the number of instances of one entity that can be associated with instances of another entity. It specifies the numeric relationships between occurrences of entities. Examples of cardinality constraints are one-to-one (1:1), one-to-many (1:M), and many-to-many (M:N).

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

Define ‘specialization’ in the EER model.

A

Specialization is a process of defining a set of subclasses of an entity type, where each subclass shares common attributes (inherited from the entity type) but also has additional attributes that are unique to the subclass.

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

How does ‘generalization’ in the EER model differ from ‘specialization’?

A

Generalization is the reverse of specialization. It’s the process of abstracting common properties of multiple entity types into a higher-level, generalized entity type. While specialization divides a single entity into multiple entities based on differences, generalization combines multiple entities based on similarities.

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

In EER modeling, what is a ‘subclass’?

A

A subclass is a more specific and refined version of an entity type. It inherits attributes from its superclass and may also have additional attributes that are not present in the superclass.

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

What does ‘aggregation’ refer to in EER?

A

Aggregation is a modeling technique in EER where a relationship between entities is treated as a higher-level entity. It allows relationships to participate in other relationships.

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

Can an entity be a part of more than one subclass in the EER model?

A

Yes, an entity can be a part of more than one subclass if the subclasses are overlapping. This means that an entity instance can belong to multiple subclasses within the same superclass.

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

Why might you use an EER diagram instead of a simple ER diagram?

A

EER diagrams offer more advanced modeling concepts and are beneficial when the real-world scenario to be modeled has complexities that cannot be efficiently captured using simple ER diagrams. Concepts like generalization, specialization, and aggregation in EER make it more expressive and versatile.

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

What is the primary distinction between ER and EER models?

A

The EER model extends the ER model by introducing advanced concepts like specialization/generalization, category (union type), and aggregation to represent more complex scenarios.

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

What does ‘total specialization’ mean in EER?

A

Total specialization means that every instance of the superclass must belong to some subclass.

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

What’s the difference between ‘partial specialization’ and ‘total specialization’?

A

In total specialization, every instance in the superclass must be a member of some subclass, whereas in partial specialization, an instance can exist in the superclass without belonging to any of its subclasses.

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

What is a ‘composite attribute’?

A

A composite attribute is an attribute that can be subdivided into other meaningful attributes, indicating a hierarchy of attributes

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

How is a ‘derived attribute’ represented in an EER diagram?

A

A derived attribute is typically represented by a dashed ellipse connected to its respective entity or relationship.

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

What is a ‘weak entity’ in EER modeling?

A

Answer: A weak entity is an entity that cannot be uniquely identified by its attributes alone and relies on a related entity (the owner entity) for its identification.

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

How is ‘category’ or ‘union type’ represented in EER?

A

Answer: A category or union type is used to represent entities that can be members of one or more disjoint sets. It is typically depicted using a circle in EER diagrams.

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

Can an entity instance belong to multiple disjoint subclasses?

A

Answer: No, if subclasses are disjoint, an entity instance can belong to only one subclass.

16
Q

How are ‘overlapping subclasses’ different from ‘disjoint subclasses’?

A

Answer: In overlapping subclasses, an entity instance can belong to multiple subclasses, while in disjoint subclasses, each entity instance belongs to only one subclass.

17
Q

What’s the significance of ‘aggregation’ in EER diagrams?

A

Answer: Aggregation allows a relationship set to participate in another relationship, effectively treating a relationship as an entity.

18
Q

Can a subclass have further subclasses in the EER model?

A

Answer: Yes, subclasses can be further specialized into more specific subclasses, leading to a multi-level hierarchy.

19
Q

How is the relationship between a weak entity and its owner entity represented in EER diagrams?

A

Answer: It’s represented using an identifying relationship, typically depicted by a double diamond.

20
Q

What is the role of a ‘discriminator’ in the EER model?

A

Answer: A discriminator, also known as a partial key, is an attribute that distinguishes among entity instances of a weak entity set.

21
Q

Why is cardinality important in EER diagrams?

A

Answer: Cardinality defines the numeric relationships between instances of entities and provides constraints on how entities are related, ensuring accurate representation of real-world scenarios.

22
Q

What’s the difference between a ‘single-valued attribute’ and a ‘multi-valued attribute’?

A

Answer: A single-valued attribute holds a single value, while a multi-valued attribute can have multiple values for a single entity instance.

23
Q

How can you represent a many-to-many (M:N) relationship in an EER diagram?

A

Answer: It’s typically represented by a diamond (relationship symbol) connecting two entities with lines indicating the many-to-many cardinality.

24
Q

What is a ‘strong entity’?

A

Answer: A strong entity is one that can be uniquely identified by its attributes alone without relying on any other entity.

25
Q

In EER modeling, what’s the significance of ‘attribute inheritance’?

A

Answer: Attribute inheritance means that a subclass entity inherits all the attributes and relationships of its superclass, indicating a hierarchical relationship.

26
Q

What is an ‘associative entity’?

A

Answer: An associative entity represents the intersection of two or more entities in a many-to-many relationship. It can also hold attributes specific to the relationship.

27
Q

Why are constraints essential in EER modeling?

A

Answer: Constraints define the rules and restrictions for data and relationships, ensuring the integrity, accuracy, and consistency of the data within the database.

28
Q

+—-+———–+——-+
| ID | Name | Grade |
+—-+———–+——-+
| 1 | Alice | A |
| 2 | Bob | B |
| 3 | Charlie | C |
+—-+———–+——-+

SELECT Name FROM Students WHERE Grade=’A’;

What is the expected output of the query on the given table?

A

Answer:
+——+
| Name |
+——+
| Alice|
+——+

29
Q

+—-+——————+————+
| ID | Title | Author |
+—-+——————+————+
| 1 | Harry Potter | J.K. Rowling|
| 2 | Lord of Rings | J.R.R. Tolkien|
| 3 | To Kill a Mockingbird | Harper Lee|
+—-+——————+————+

SELECT Title FROM Books WHERE Author=’J.R.R. Tolkien’;

What is the expected output of the query on the given table?

A

Answer
+——————+
| Title |
+——————+
| Lord of Rings |
+——————