Chapter 16 - Database concepts
What is a;
A) Flat file database
B) Relational database
A) A flat file database consists of asingle file. It might be suitable to hold the names and addresses of all memebersof a sports club, or information about all the dvds in your personal collection
B) In a relational database, a separate table is created for each entity indentified in the system. Foreign keys are used to link the 2 tables
Chapter 16 - Database concepts
Define the following keys:
A) Primary Key
B) Secondary Key
C) Foreign Key
D) Composite Key
A) A primary key exists to uniquely identify an entity, as such, that key needs to be wholey unique as to not have duplicates.
B) An index of all the primary keys in the database, and there the record is held, is automatically maintained by the database software.
- When it comes to searching/sorting/filtering a database, a secondary key is likely to be used
C) A foreign key is an attribute that creates a join between 2 tables. It is the attribute that is common to both tables and the primary key in on table is the foreign key in the able to which it is linked.
D) This is a primary key which consists of more than one attribute.
Chapter 16 - Database concepts
Explain what is ment by Referential integrity
When tables are linked in a relational database, it is important to ensure that, a particular component is not deleted if it is used in a product in the product table. This is known as referential integrity.
Chapter 17 - Relational databases and normalisation
Explain what Indexing is
Chapter 17 - Relational databases and normalisation
Explain what Normalisation is and why it is used.
What it is: Normalisation is a process used to come up with the best possible design for a relational database:
Why its used:
- No data is unnecessarily duplicated
- Data is consistent throughout the database
- The structure of each table is flexible enough to allow you to tenter as many or as few items as required
- The structure should enable a user to make all kinds of complex queries relating data from different tables
- Faster searching and sorting
Chapter 17 - Relational databases and normalisation
Explain what it means for a table to be in;
A) First normal form
B) Second normal form
C) Third normal form
A) A table is in first normal form if it contains no repeating attributes or groups of attributes ( attributes must be atomic )
B) A table is in second normal form if it is in first normal form and contains no partial dependencies.
- A partial dependency would mean that one or more of the attributes depends on only part of the primary key, which can only occur if the primary key is a composite key
C) A table is in third normal form if it is in second normal form and contains no ‘non-key dependencies’.
- A non-key dependency is one where the value of an attribute is determined by the value of another attribute which is not part of the key
Chapter 20 - Transaction processing
Describe what ACID is
ACID is a set of properties that guarantees that transactions are processed reliably.
Chapter 20 - Transaction processing
Describe what record locking is and the issues that it brings
What it is: Record locking is the techniqe of preventing simultaneous access to objects in a database in order to prevent updates eing lost or inconsistencies in the data arising.
Problems: If 2 users are attempting to update 2 records, a situation can arise in which niether can proceed, known as a deadlock. To combat this, Serialisation, timestamp ordering or commitment ordering may b used
Chapter 20 - Transaction processing
Describe what Serialisation is
Serialisation: This is a technique which ensures that transactions do not overlap in time and therefore cannot intefere which each other or lead to updates being lost. A transaction cannot start until the previous one has finished. This can be implemented using timestamp ordering
Chapter 20 - Transaction processing
What is:
A) Timestamp Ordering
B) Commitment Ordering
A) Timestamp Ordering: Whenever a transaction starts, it’s given a timestamp, so that if 2 transaction affect the same object, the transaction the earlier timestamp should be applied first.
- Every object in the database will have a read timestamp and a write timestamp.
- If the read timestamp has changed from when the transaction started when being written to, it will know another transaction is taking place
B) Commitment Ordering: Transactions are ordered in terms of their dependencies on each other as well as the time they were intiated. It can be used to prevent deadlock by blocking one request until another is completed
Chapter 20 - Transaction processing
Describes some methods of;
A) Capturing Data
B) Selecting/Managing data
C) Exchanging data
A) Methods include;
- Manual entry
- Magnetic ink character recognition (MICR, used for cheques at banks)
- Optical mark recognition (OMR, and others types of forrm using OCR)
- Smart card readers
- Scanners
- Barcode readers
B) Data may be selected before it is even added to a database, depending on whether or not is matches specifcied criteria.
- Once in the database, SQL may be used to select data from different tables
C) A common method of transferring data between computer systems without the need for human intervention is EDI ( Electronic Data Interchange ) Using standardised message formatting, document can be exchange electronically.
- Transaction software processes the information and software on the receiving end looks up details of, for example, items to be purchased, price, buyer’s name etc.