Database
A structured collection of related data
A database is structured in a way that allows you to… (3)
Popular ways of sorting data include… (3)
What are the two main types of databases?
2. Relational
Flat-file database
Stores all of its data in a single table
Pros and Cons of a Flat-file database (3 | 3)
Pros
Cons
Relational database
Organises its data into related tables of records
Pros and Cons of a Relational database (4 | 2)
Pros
Cons
Data duplication OR Data redundancy
Where the same data is stored more than once, unnecessarily
Data duplication leads to…
Data inconsistency
Data inconsistency
Where different and conflicting versions of the same data appear in different places, thus compromising data integrity
Entity
A single person, place or thing about which data can be stored
Table
A collection of data about a certain topic organised into records and fields
Record
Data stored about a particular entity within a table
Field
One specific data item being stored about a particular entity
Fill in the blanks:
Records form the _____ of a table. Fields form the table’s _____.
2. Columns
Primary key
The field in a table that uniquely identifies a record
How many times can a primary key occur in a table?
Once
Foreign key
A field in one table that is the primary key in another, used to create a relationship between the two
Relationship
A connection between two tables
How do you form a relationship?
By including the primary key of one table as a foreign key in another
What are the three different kinds of relationships between tables?
Index
A data structure defined along the columns of a database table, used to significantly speed up queries
How does an Index work?
It sorts the data by the most commonly searched columns