1/24
Vocabulary flashcards covering attributes, keys, and integrity rules from relational-database lecture notes.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Relation
A two-dimensional table whose columns are attributes and rows are tuples; every row must be unique.
Attribute
A column in a relation representing a single data item, e.g., StudentID, Name, Major, GPA.
Tuple
A single row in a relation, such as (101, Alice, ComputerSci, 3.8).
Primary Key
An attribute or minimal set of attributes that uniquely identifies each tuple, e.g., StudentID in STUDENT.
Candidate Key
Any attribute set able to serve as a primary key because it ensures uniqueness, e.g., {StudentID, CourseID} in COURSE_ENROLLMENT.
Composite Key
A primary or candidate key composed of two or more attributes, like StudentID + CourseID in COURSE_ENROLLMENT.
Foreign Key
An attribute in one relation that references the primary key of another, linking the two tables; StudentID in COURSE_ENROLLMENT refers to STUDENT.
StudentID
Primary key of STUDENT and foreign key in COURSE_ENROLLMENT that identifies each student.
CourseID
Attribute identifying a course; forms part of the composite key {StudentID, CourseID}.
EnrollmentDate
Date a student enrolled in a course; not part of the composite key in COURSE_ENROLLMENT.
Unique Row Property
Rule that no two tuples in a relation may be identical; duplicates violate relational integrity.
Multivalued Attribute
An attribute that can store multiple values for a single entity, e.g., CourseTitle in the employee-training table.
Normalization of Multivalued Attributes
Process of ensuring each row holds a single value per attribute, often by moving the multivalued attribute to a separate relation.
BookID
Primary key of BOOK and foreign key referenced in PURCHASE.
PublisherID
Primary key of PUBLISHER; appears as a foreign key in BOOK.
CustomerID
Primary key of CUSTOMER; foreign key in PURCHASE linking orders to customers.
PurchaseID
Primary key of PURCHASE; distinguishes each purchase record.
Composite Key (ENROLLMENT)
The pair (StudentID, CourseID) that uniquely identifies each enrollment record.
Referential Integrity
Constraint ensuring every foreign-key value matches an existing primary-key value in the referenced table.
Non-candidate Composite Set
{StudentID, EnrollmentDate} in COURSE_ENROLLMENT lacks guaranteed uniqueness and is NOT a candidate key.
Invalid Customer Reference
OrderID 103 uses CustomerID 3, which does not exist in CUSTOMER, breaking referential integrity.
Valid ORDER_LINE Entry
Row like (101, 202, 1) where both OrderID 101 and ProductID 202 exist, maintaining referential integrity.
Duplicate Tuple Violation
Having two identical StudentID 101 rows breaks the unique row requirement, making the table an invalid relation.
Reason for Composite Keys
Used when a single attribute cannot uniquely identify a record; multiple attributes together provide uniqueness.
MajorID (Foreign Key)
Attribute in STUDENT and COURSE that references the primary key of MAJOR.