Relational Databases (Leaving Cert Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
Relational database
Relational database
Stores & provides access to related data points
Primary key
Primary key
Unique identifier for each record in a database table
Primary key: uniqueness property
Primary key: uniqueness property
Must be unique for each row in the table
Primary key null value rule
Primary key null value rule
Cannot contain null values
Primary key immutability
Primary key immutability
Should not change over time
Composite primary key
Composite primary key
Primary key consisting of multiple columns combined
Suitable primary key in Student Table
Suitable primary key in Student Table
ID column (unique for each student)
Why full name unsuitable as primary key
Why full name unsuitable as primary key
Multiple people may have the same name
Foreign key
Foreign key
Column(s) linking two tables by referencing primary key
What foreign key refers to
What foreign key refers to
Primary key in another table
Foreign key example in Student Table
Foreign key example in Student Table
Exam ID refs Grade Table primary key
Can primary key also be foreign key
Can primary key also be foreign key
Yes, primary key can also be a foreign key
