Module 2 Flashcards
What are the main steps of database design?
Requirements collection, conceptual design, logical design, and physical design.
What is a data model?
A collection of concepts used to describe data, relationships, semantics, and constraints.
What are three common data models used in database design?
Entity-Relationship (E/R) Model, Object-Oriented Model, Semi-Structured Model (XML).
What is an entity?
A real-world object that is distinguishable from other objects.
What is an entity set?
A collection of similar entities with the same attributes.
What are attributes in an entity?
Properties that describe an entity (e.g., Name, Age, Address).
What is a primary key?
A unique identifier for an entity in an entity set.
What is a relationship in an E/R model?
An association between two or more entities.
What is a relationship set?
A collection of similar relationships.
What is the difference between a unary, binary, and ternary relationship?
Unary: One entity set, Binary: Two entity sets, Ternary: Three entity sets involved.
What is a one-to-one (1:1) relationship?
Each entity in set A is related to at most one entity in set B, and vice versa.
What is a one-to-many (1:N) relationship?
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.
What is a many-to-many (M:N) relationship?
Entities in set A can relate to multiple entities in set B and vice versa.
What is a weak entity set?
An entity set that does not have sufficient attributes to form a primary key.
What is a discriminator (partial key)?
An attribute in a weak entity that distinguishes it from other weak entities associated with the same strong entity.
How do you define the primary key of a weak entity?
The primary key of the weak entity is the primary key of the strong entity + the discriminator.
Can relationships have attributes?
Yes, attributes on relationships store additional information about the association.
Give an example of an attribute on a relationship.
In an ‘EnrolledIn’ relationship between Students and Courses, a ‘grade’ attribute can store the student’s grade.
What does ISA represent in the E/R model?
ISA represents inheritance between entity sets.
How does inheritance work in an E/R model?
A child entity inherits attributes and relationships from a parent entity (e.g., Student ISA GraduateStudent, UndergraduateStudent).
What is referential integrity?
A constraint ensuring that a foreign key value must match an existing primary key in another table.
What is a domain constraint?
A rule specifying that an attribute must have values from a defined set or range.
What is a key constraint?
A rule that ensures no two entities have the same values for key attributes.
How do we represent an entity set in an E/R diagram?
As a rectangle with the entity set name inside.