1.3.2 Flashcards
database
an organised collection of data that allows for easy:
Adding
Modification
Deletion
Searching
relational database
2 databases that are linked together to share data
flat file
definition
a single table
can be created very easily using either database or spreadsheet software and is often saved as a CSV file
(used for small and normally personal use details)
flat file
cons
Inefficient and normally has repeated data so:
Take up unnecessary space
Be slow to query
Become difficult to maintain
entity relationship diagram
1:1 (one-to-one)
1:M (one-to-many)
M:M (many-to-many)
— 1:1
/
— 1:M
\
\ /
— M:M
/ \
primary key
a unique identifier
composite primary key
2 or more fields combined
secondary key
a second field to be indexed (can have repeats)
often used as a search
foreign key
a relational link
(the same on both databases but one has to be a primary key)
indexing
keeping an index of the primary keys so they can be searched for quickly
each index has the position of its primary key to save time
capturing data
typically done manually and then has to be read by a computer (normally using a data capture form)
using Optical Character Recognition (OCR)
or
using Optical Mark Recoignition (OMR)
or
chip and pin/barcodes/qr codes/etc…
can now be filled in on a computer
managing data
use SQL (DML) or DBMS to change the data
selecting data
use SQL (QBE) to choose data to see
exchange data
normalisation
splitting tables in a database and arranging the data to move it from 1NF 🡺 2NF 🡺 3NF
first normal form
All field names must be unique
Values in fields should be from the same domain
Values in fields should be atomic
No two records can be identical
Each table needs a primary key
second normal form
The data is already in 1NF
Any partial dependencies have been removed
Fix any M:M relationships created as a result
partial dependency means one or more of the fields depend on only part of the primary key
this issue can arise if the primary key is a composite key comprised of more than one field
third normal form
The data is already in 2NF
Any transitive dependencies have been removed (remove any non-key dependencies)
non-key dependency in one where the value of a field is determined by the value of another field that is not part of the primary key