Databases Flashcards
What are serial files
- Data stored in the order in which it was entered
- No order to the data is maintained
- Useful for storing transactional data and initialisaion files
What are sequential files?
- Store data in order of a ket field
- Order is maintained when new records are added
- Useful for storing master files
What are sequential files?
- Store data in order of a ket field
- Order is maintained when new records are added
- Useful for storing master files
What are databases used for?
- Handles large data sets
- Efficient processing of data
- Reducing storage requirements
- Avoiding redundancy
- Allowing different users to see relevant data
What is the Database Management System (DBMS)
- A manipulation langague to access anmd change the data
- Integraty to ensure efficiency and structure is not compromised
- Additional security
- INterface for other programs to access and use the data
- Progrma data inderpendence
What are databases made up of?
- Tables that store data in rows and colums
- Queries to manipulate data: search, sort, add, amend and delete
- Can create UI and forms
Why is a flat file database bad?
- Only one table
- Not easy to query
- Duplicated data + inefficient
- More errors between datasets = loss of integrety
What do entity relationship models show
- They can show the relationships between databases
- Can be one to one or one to many
What are primary Keys
- Unique identifier for one record from any other
What is seconday keys?
- Allows for quick ordering of data accoring to a column
What is normalisation?
- Splitting up tables in a database
- Arranging the data to move it from 1NF to 2NF to 3NF
How do you go from 0NF to 1NF
- Eleminate uplicate columns
- Get rid of any groups repeating data
- Identify Primary key
- Seperate out any attributes which are not atomic into sepearate attributes (One peice of data per field)
How to get from 1NF to 2NF
- Check data is already in 1NF
- Remove any partial dependencies which is one or more of the attributes depend on only part of the primary key (like course number and student name)
- Seperate the partial dependencies into different tables
- Fix any many-to-many relationships found
How do you convert from 2NF to 3NF
- Check data in 2NF
- Make sure there is no-key dependencies
- Meaning every field must depend on the primary key
- If not its seperated again to remove repeating data
What is SQL?
- Allows fast efficient querying
- Retrieving information from databases
What is the command for deleting data?
DELETE from FORM WHERE Forename = ‘9C’
What is the command for inserting a new row into the table
INSERT INTO Form VALUES (‘10C’, ‘Miss. Badman’, ‘B12’)
What is the command for querying a database?
SELECT Forename FROM Form WHERE FORM = ‘7R’
What is the command for updating an existing command
UPDATE Form SET Formteacher = ‘Joey’ WHERE Forename = ‘7R’
What is the command for creating a new table?
CREATE TABLE Staff(
StaffID INT PRIMARY KEY;
Name VARCHAR(20);
JoinDate date-time;
Age int;
Gender boolean;
)
What is transaction processing?
- Any information processing which is divided into individual, indivisible operations
- Each operation must succeed or fail as a complete unit
What transactional statments do all databses have?
CRUD
- Create
- Read
- Update
- Delete
What does the A.C.I.D rules do?
They are a set of rules that ensure data integraty
What is atomicity?
- A change to a database must be performed or not performed
- Any half completed change must not be saved to the datasbe
What is consistency?
Any change in the databse must retain the overall state of the database
What is isolation?
- A transaction must not be able to be interruped by another transaction
- The transaction must occur in isolation so that other users or processes cannot have access to the data concerned
- Carried out through record locking where any data used is temporarily put in a read only mode
What is durability?
- Once a change has been made to the databse it must not be lost due to a system failure
- Achived through transactions being stored in secondary storage as soon as possible (as secondary is non volitile)