Lecture 4 Flashcards
(17 cards)
What is a relational table?
A two-dimensional structure composed of rows and columns that contains a group of related entities
An entity set and a table are often used interchangeably.
What are the basic components of the relational model?
Relational tables, keys, data integrity rules, data dictionary
These components enable the organization and management of data within relational databases.
What is a primary key?
An attribute (or a combination of attributes) that uniquely identifies any given entity (row)
The primary key must not contain NULL values and should be unique.
What is a foreign key?
An attribute whose values match primary key values in the related table
It ensures referential integrity by containing a value that refers to an existing valid tuple in another relation.
Define candidate key.
Any column or combination of columns that can qualify as a unique key in the database
There can be multiple candidate keys in one table, each of which can qualify as a primary key.
What is the role of keys in a relational database?
Keys consist of one or more attributes that determine other attributes
Knowing the value of one attribute allows the lookup of another.
What is controlled redundancy in relational databases?
It refers to necessary duplication of attribute values to enable tables to be linked together
Redundancy only exists when there is unnecessary duplication.
What is the data dictionary?
A detailed accounting of all tables in the user/designer-created database, containing metadata
It records design decisions about tables and their structures.
Why are NULL values not permitted in primary keys?
Because they represent no data entry, which violates the uniqueness requirement of primary keys
NULLs can create issues when performing functions like COUNT, AVERAGE, and SUM.
What are the criteria for selecting a primary key?
Select a key that does not contain NULL, is unique, and does not keep changing
Stability and uniqueness are essential for a primary key.
What is referential integrity?
A condition that ensures a foreign key contains a value that refers to an existing valid tuple in another relation
It maintains the accuracy and consistency of data across related tables.
Fill in the blank: A table is also called a ______.
relation
The term ‘relation’ was used by Codd, the creator of the relational model.
True or False: A secondary key is used strictly for data retrieval purposes.
True
Secondary keys do not enforce uniqueness but facilitate searching.
What is an attribute in the context of databases?
A property or characteristic of an entity
Attributes are the columns in a relational table.
What is the significance of data integrity rules?
They ensure the accuracy and consistency of data within the database
Integrity rules include entity integrity and referential integrity.
What does the term ‘domain’ refer to in databases?
The set of allowable values for an attribute
Domains help to enforce data integrity by restricting the type of data that can be stored.
What are the main teaching points about keys in relational databases?
Keys are central to the use of relational tables and define functional dependencies
Types of keys include candidate key, primary key, secondary key, and foreign key.