normalisation Flashcards
relational database
consists of many tables w many records w many fields where field stores single data item
relation/entity- table
row/entity instance - record
attribute/column/property - field
primary key underlined
managed by database management systems (dbms)
primary key fiels
uniquely identifies each record on table
no data value in primary key field is repeated
can be made by adding extra auto-numbered field so each record is made unique
naming convention- tablenameID
super keys
combination of fields in table which uniquely identify each row
more than 1 field
candidate keys
minimal super keys w no attributes included which do not contribute to uniqueness of rows
composite/compound/concatenated keys
combo of 2 or more fields to form primary key
normalisation
the process of organizing data in a database by creating tables and establishing relationships between those tables according to a defined set of rules designed both to protect the data and to make the database more flexible by eliminating redundancy and inconsistent dependency.
avoids repeating groups, data redundancy, anomalies (update,insertion,deletion)
complex queries
repeating group
field that can have multiple values
when repeating groups are removed, data redundancy is produced
in normalised database - all fields should have single value
anomalies
update anomaly- same data needs to be updated in more than one place
deletion anomaly- deletion causes unnecessary data loss
insertion anomaly- records are added that do not satisfy primary key requirements
dependancies
1 field related to another
A ➔ B
B is determined by A
partial dependancy
field’s value is dependent on part of a composite key
transitive dependency
field’s value is dependent on non-key field
derived data
use a field to calculate another
not stored
duplicate data
record has same value for a field as another record
not wrong; not redundant
atomic data
only storing single data item in single field
referential integrity
you cannot have data that refers to other data that does not exits