Databases Flashcards
Exchanging data
What is a database
A structured, persistent (held for as long as required) store of data, organised so that it can be easily accessed managed and updated
What is a field
A single piece of data (represented by columns on a table)
- Has a specified data type
What is a record
A collection of fields (rows in a table )
What is a table
Complete set of records
What is a flat-file database
A database in which all data is stored in a single table
- Good for small amounts of data (prone to data redundancy)
Define data redundancy
When the same data is stored in different locations
- Wastes space
- Can lead to errors ( If all instances of the data aren’t changed during updates)
What are relational databases
Multiple tables linked together.
Each table represents an entity
How are relational databases linked
They are linked using primary and foreign keys
What is an entity
An instance of a class (anything which we can store data about)
What is a primary key
A field that has a unique value (Identifier) for every record in the table
Eg. registration plate (no two cars have the same one
What is a foreign key
The primary key in one table being used as a field in another table, creating a link
What is a secondary key
A field by which records are likely to be searched and is therefore indexed
Used when we want to search by a field that isn’t the primary key
What is an entity relationship diagram
A diagram showing the tables, which hold the entities and their links
What does it mean when entities have a one-to-one relationship
This is when each instance of an entity connects to a single instance of another entity
Eg. one student will have one mentor
What does it mean when entities have a one-to-many relationship
This is when a single instance of an entity may be linked to many instances of another entity. (a good way to resolve redundancy)
Eg. A computer science teacher may have many classes
What does it mean when entities have a many-to-many relationship
This is when multiple instances of one entity may be linked to multiple instances of another entity
Eg. Each order may have many items and each item can be ordered many times
How can we get rid of many-to-many relationships
Creating a link table containing its primary key and two primary keys from the other tables used as foreign keys (composite key)
What is optical mark recognition (OMR)
A data input method that recognises the position of marks made on paper
- Allows you to collect data from printed forms
What is Optical character recognition (OCR)
It can be used to convert documents into readable text
Eg. When speed cameras scan car number plates
What is the DBMS
Database management system - a layer of software that ensures the database is manipulated in a consistent way while ensuring integrity and security
Examples of the DBMS
- MySQL
- Microsoft Access
- PostgreSQL
What are the two main methods DBMSs offer to manage a database
- Structured query language (SQL)
- Query by example (QBE)