1.3.2 Databases Flashcards
Database
An organised collection of data
Database advantages
Make data available to users, the data is correct and the data can be held securely
Table
A collection of associated data stored within a database
Fields
The characteristics of each table
Record
An individual entry that belongs in a table
Entity
Something in the real world that we store data about
Becomes a table in a database
Attribute
A characteristic of an entity
Becomes a field in a database
Entity description format
TableName(Entity1, Entity2…)
Char(n) vs VarChar(n)
A char string has fixed length n, a varchar string has variable length up to n
How to access a database
Using a DBMS (Database Management System)
Flat file database
A database comprised of a single table, based around a single entity and its attributes
Flat file advantages and disadvantages
+ simple and quick to set up
- very inefficient, used for storing small amounts of data
Relational databases
Databases split into multiple tables linked by relationships
Primary key
A field in a record which is unique, allowing each record to be uniquely identified. Must not be duplicated or reused.
Secondary key
A field can be defined as a secondary key to be indexed for faster lookups.