Module 2 Flashcards

1
Q

What are the main steps of database design?

A

Requirements collection, conceptual design, logical design, and physical design.

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

What is a data model?

A

A collection of concepts used to describe data, relationships, semantics, and constraints.

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

What are three common data models used in database design?

A

Entity-Relationship (E/R) Model, Object-Oriented Model, Semi-Structured Model (XML).

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

What is an entity?

A

A real-world object that is distinguishable from other objects.

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

What is an entity set?

A

A collection of similar entities with the same attributes.

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

What are attributes in an entity?

A

Properties that describe an entity (e.g., Name, Age, Address).

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

What is a primary key?

A

A unique identifier for an entity in an entity set.

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

What is a relationship in an E/R model?

A

An association between two or more entities.

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

What is a relationship set?

A

A collection of similar relationships.

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

What is the difference between a unary, binary, and ternary relationship?

A

Unary: One entity set, Binary: Two entity sets, Ternary: Three entity sets involved.

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

What is a one-to-one (1:1) relationship?

A

Each entity in set A is related to at most one entity in set B, and vice versa.

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

What is a one-to-many (1:N) relationship?

A

Each entity in set A can relate to multiple entities in set B, but each entity in B relates to only one entity in A.

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

What is a many-to-many (M:N) relationship?

A

Entities in set A can relate to multiple entities in set B and vice versa.

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

What is a weak entity set?

A

An entity set that does not have sufficient attributes to form a primary key.

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

What is a discriminator (partial key)?

A

An attribute in a weak entity that distinguishes it from other weak entities associated with the same strong entity.

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

How do you define the primary key of a weak entity?

A

The primary key of the weak entity is the primary key of the strong entity + the discriminator.

17
Q

Can relationships have attributes?

A

Yes, attributes on relationships store additional information about the association.

18
Q

Give an example of an attribute on a relationship.

A

In an ‘EnrolledIn’ relationship between Students and Courses, a ‘grade’ attribute can store the student’s grade.

19
Q

What does ISA represent in the E/R model?

A

ISA represents inheritance between entity sets.

20
Q

How does inheritance work in an E/R model?

A

A child entity inherits attributes and relationships from a parent entity (e.g., Student ISA GraduateStudent, UndergraduateStudent).

21
Q

What is referential integrity?

A

A constraint ensuring that a foreign key value must match an existing primary key in another table.

22
Q

What is a domain constraint?

A

A rule specifying that an attribute must have values from a defined set or range.

23
Q

What is a key constraint?

A

A rule that ensures no two entities have the same values for key attributes.

24
Q

How do we represent an entity set in an E/R diagram?

A

As a rectangle with the entity set name inside.

25
How do we represent a relationship set in an E/R diagram?
As a diamond shape connecting entity sets.
26
How do we represent a primary key in an E/R diagram?
By underlining the attribute name inside the entity set rectangle.
27
What is a multiway (n-ary) relationship?
A relationship that involves more than two entity sets.
28
How can we convert an n-ary relationship into binary relationships?
Introduce a connecting entity set and create binary relationships with the original entity sets.
29
What is the role of a connecting entity set?
It helps represent n-ary relationships by breaking them into multiple binary relationships.
30
Why is redundancy a problem in database design?
Redundancy leads to wasted storage, data inconsistency, and update anomalies.