Half Term 3 Flashcards
Databases
What is an entity?
A single object, person, event or thing eg customers, appointments, products about which data is to be recorded. An entity is represented with one (or possibly more) database tables
Databases
What is an attribute?
A specific type of data representing a particular characteristic of each data record. Also known as a field or column
Databases
What is a flat file databse?
A database with a single table
Databases
What is a relational database?
A database that stores records in two or more tables. Records in one table can refer to records in another table to avoid duplicating data
Databases
What is a primary key?
An attribute that uniquely identifies every row of the table. If there is no natural attribute for a primary key, one should be introduced. The primary key is automatically indexed and cannot be blank
Databases
What is a composite primary key?
Sometimes two or even more attributes are needed to uniquely define a record. These attributes form a composite key
Databases
What is a foreign key?
A primary key of one table which appears in another table. By doing this relationships between the tables are formed
Databases
What is a secondary key?
A field, other than the primary key, which is indexed
Databases
What is an index?
A list of keys (or keywords), each of which identifies a unique record. Indices make it faster to find specific records and to sort records by the index field (the field used to identify each record)
Databases
What is a relationship?
A relationship exists between two tables when one table has a foreign key that references the primary key of the other table
Databases
What is an example of a one to one relationship?
Husband and Wife (One husband has one wife)
Databases
What is an example of a one to many relationship?
Mother and Child (One mother has many children)
Databases
What is an example of a many to many relationship?
Actor and Film (Many films have many actors)
Databases
What is a record?
A row in a database table which contains data about one instance of an entity
Databases
What is data integrity?
The overall accuracy and completeness of data
Databases
What is referential integrity?
A foreign key must refer to an existing primary key. Referential integrity is violated when the primary key to which a foreign key refers no longer exists. A measure of the consistency of the data in a database
Databases
What is a query?
A request for data or information from a database table or combination of tables
Databases
What is data redundancy?
This occurs in database systems when the same piece of data exists in multiple places
Databases
What is normalisation?
The process of structuring the data in a relational database according to formal rules, in order to avoid problems of data redundancy which leads to inconsistency and inaccuracy
Databases
What is a field?
A part of a record that holds data of a specific type about one characteristic of the subject of the record
Databases
What is a table?
A set of data items arranged using vertical columns (identifiable by name) and horizontal rows
Databases
What are the pros of a flat file database?
- Easy to set up - no knowledge required
- Easy to use in code - e.g. CSV files are easy to process
- Easy to share, e.g. email attachments
Databases
What are the cons of a flat file database?
- Duplication of data (data redundancy) which take more time to update, can lead to inconsistency
- Take up more space so more storage is required
- Everyone can see everything (not good if some data is sensitive)
- Inefficient – have to have all fields for every record
- Can’t perform complex queries as easily
Databases
What are the pros of a relational database?
- Reduces duplication of data meaning easier to update, accurate, better consistency, less storage space
- Can set different access rights for each user for each table
- Can index fields for quicker searching
- If implemented with DBMS, it will allow concurrent access to the database allowing multiple users
- Complex queries can be carried out
Databases
What is the drawback of a relational database?
- More difficult to correctly set up
Databases
How does an index work?
An index is a small table. The first column comprises a copy of the primary or secondary key. The second column contains a pointer for holding the address of the location where that specific record is stored
Databases
What is the benefit of a secondary key?
It is allows you to look up records using information other than the primary key
Databases
What are the drawbacks of a secondary key?
- It slows down inserts, updates and deletes because the database engine does not have to change the data only, but the index, too
- An index needs space on hard disk and in RAM
Databases