Lesson 0 Flashcards
What is a relation schema?
The structure of a table, defined by its attributes (columns).
What is a relation instance?
The actual set of tuples (rows) in a table at a specific moment.
What are attributes and tuples?
Attributes are columns, and tuples are rows in a relation.
Example of a relation schema?
Instructor (ID, Name, Dept_Name, Salary)
What is a domain in a database?
The set of valid values an attribute can take.
What does atomicity of an attribute mean?
The attribute must store indivisible values.
What does NULL represent?
A missing or unknown value in a table.
What is a database schema?
The logical structure defining tables, attributes, and relationships.
What is a database instance?
The actual stored data at a specific point in time.
What is a superkey?
A set of attributes uniquely identifying a row in a table.
What is a candidate key?
A minimal superkey (smallest set of attributes that is still unique).
What is a primary key?
The selected candidate key that uniquely identifies each row.
What is a foreign key?
An attribute in one table that refers to the primary key of another table.
What are the main components of an ER model?
Entities, Attributes, and Relationships.
How are entities represented in ER diagrams?
As rectangles.
How are relationships represented in ER diagrams?
As diamonds.
What is an entity set?
A group of similar entities with shared attributes.
What are the types of mapping cardinality?
One-to-One, One-to-Many, Many-to-One, Many-to-Many.
Example of a one-to-many relationship?
One instructor advises multiple students.
Example of a many-to-many relationship?
Students enroll in multiple courses, and courses have multiple students.
What is a weak entity set?
An entity that cannot be uniquely identified without a strong entity.
What does a weak entity need to be uniquely identified?
A discriminator attribute and a foreign key to a strong entity.
How are weak entities represented in ER diagrams?
With a double rectangle.
How do entity sets become tables?
Each entity set is converted into a relation (table).
How do relationships become tables?
Many-to-many relationships require a separate table.
How are weak entities stored
They include the primary key of the identifying strong entity.
What is specialization?
The process of breaking an entity into subclasses.
What is generalization?
The process of combining multiple entities into a higher-level entity.
What is the ISA relationship?
Used to show specialization (e.g., an Instructor is a Person).