Fundamentals of Databases Flashcards
Relational Database
A method of creating a database using tables of related data, with relationships between the tables.
Entity
An object about which data will be stored
Entity Relationship Diagram
http://www.teach-ict.com/as_a2_ict_new/ocr/AS_G061/315_database_concepts/attributes_entities/miniweb/images/one2many.jpg
One to many
Primary Key
An attribute that can be used to uniquely identify every record within a table
Entity Identifier
An attribute which can uniquely identify each instance of an entity
Foreign Key
An attribute in a table that is a primary key in another table and is used to link tables together.
Normalisation
The process of ensuring that a relational database is structured efficiently.
This is by removing repeating/redundant data. For example, a school database - tutor group may repeat a lot. One way to solve this is to put tutor table as a separate database.
Pg 369
SQL
Enter data into a table
INSERT INTO Customer (CustomerID, Name, Address)
VALUES (“1”, “John Smith”, “1 High Street”)
This means insert CustomerID = 1, Name = John Smith, and Address = 1 High Street into database Customer.
Update data in the table
UPDATE Customer
SET Address = “29 Wellington Street”
WHERE CustomerID = “1”
Delete Data
DELETE * FROM CUSTOMER
* means all
Querying Data
SELECT CustomerName, CustomerAddress
FROM Customer
WHERE CustomerName = “John Smith”
ORDER BY CustomerName DESC;
Issues with concurrent (multiple) access on shared database
One common problem with a database that is accessible to a number of users is what to do if a number of users are trying to access the same data at the same time. As long as the users are only reading the data this is not a problem, but if two or more users want to write data there will be problems.
How to solve?
- Record Locks - a technique to temporarily prevent access to certain records held on a database
- Serialisation - A technique to ensure that only one transaction at a time is executed from at a time is executed from multiple users on a database.
Timestamp ordering - A technique to ensure multiple users can execute commands on a shared database based on the timestamp of when the data was last written to or read from.
Commitment ordering - A technique to ensure concurrent transactions on a shared database are executed based on the timestamp of when the request is made and also the precedence the request takes over other simultaneous request.
Big Data
A generic term for large or complex datasets that are difficult to store and analyse.
Main three big features of big data are:
Volume
Variety
Velocity
Examples include:
Scientific research, retail, banking, government, mobile networks, security, the internet.
Structured data - data that fit into a standard database structure or columns and rows.
Unstructured data - data that do not fit into a standard database structure of columns and rows.
Modelling big data - most big datasets are stored in what are called data warehouses, which as the name suggests, are very large. Modelling of big data can be expressed as diagrams or natural language such as We sold 1 million rechargeable batteries. Using We sold QUANTITY PRODUCTS format, it is possible to model other data that the retailer records.
Read rest pg 386