Relational Model Flashcards
What is the relational model?
Logical data model representing data as relations (tables) with attributes (columns) and tuples (rows)
What is the difference between schema and instance ina database?
Schema describes structure, instance represents actual data at a specific point in time
Primary Key
Unique identifier for tuples in a table, ensuring no duplicate rows
One of the candidate keys, if there are multiple candidate keys
Superkey
Set of attributes that uniquely identify each row in a table
Candidate Key
minimal set of attributes that can uniquely identify a tuple
every table must have at least a single candidate key
minimal superkey, meaning no subset of its attributes can uniquely identify a tuple
A table can have multiple ____ keys but only one ____ key
Candiate;Primary
Alternate key
all keys that are not primary key
Foreign Key
Attribute in one table that references the primary key in another table, ensuring referential integrity
primary key in one tablle, secondary key in other table
Domain Constraints
Rules that restrict the values an attribute can have
Ranges, specific formats
Tuple Constraints
Conditionas that apply to individual tuples
price = cost + tax
Referential integrity constraints
Ensure foreign key values in a table correspond to primary key values in the referenced table
First Normal Form (1NF)
Property of a relation where all attribute values are atomic, with no nested or repeating groups
- Prevents storing multiple pieces of data in once cell, ensuring each piece is individually accessible and updateable
- What about 2NF and 3NF???
Non-Prime Attribute
Not part of any candidate key
Why is normalization important?
Reduces redundancy and ensures data consistency
What does NULL represent in a databse
Absence of information or inapplicable value