Chapter 17 - Relational databases and normalisation Flashcards
Where are data held in a relationship data base?
» Tables - also called relations
What is a relational databse?
» Collection of tables in which relationships are modelled by shared attributes
What does a row represent?
» One record
What does a column represent?
» One attribute
How would you describe a table?
» Entity name - shown outside the brackets
» Attributes - listed inside the brackets
» Primary key is underlined
What is the purpose of the primary key?
» Unique identifer to identify a particular record in the table
What is the purpose of indexing a primary key?
» So that a record with a particular primary key can be quickly located in a database
What is the foreign key?
» Attribute which is a primary key of one of the tables - links tables together
What is normalisation?
» Technique for designing a relational database to minimise duplocation of information and eliminates redunant data
What are the 4 features of normalisation?
» No data is unncessarily duplicated
» Data is consistent
» Structure of each table is flexible enough to allow you to enter as much as you want
» Structure should enable a user to make all kind of compelx queuries
How many normalisations are there?
» 4
What are the 3 features of the first normal form (1NF)?
» Each data tem cannot be broken down any further
» Each row record has a primary key
» There are no repeating data
What is the main thing to remember when some entities have a many-to-many relationship?
» You will always need a link table in the middle
What are the features of the second normal form? (2NF)
» If it is in the 1NF
» Contains no partial dependencies
What is a partial dependency?
» Mean that one or more of the attributes depends on only part of the primary, which can only occur if the primary key is a composite key
What are the features in the third normal form (3NF)?
» It is in the 2NF
» Contains no non-key depedencies
What is a non-key depedency?
» Where one value of an attribute is determined by the value of another attribute which is not part of the key
What is the main principle in 3NF?
» All attributes are dependent on the key, the whole key, and nothing but the key
What is an entity?
» A category of object of something or interest
What is the one of the main aims of normalising data?
» Remove the possibility of redundant data from any of the tables
What is redundant data?
» Data that appears in more than one database table
» Which can cause inefficiencies and inconsistencies in data
What is mantained in a normalised database?
» Data integrity
How can normalisation lead do faster sorting and searching?
» Normalisation will produce smaller tables, with fewer fields
» Leads to greater efficiency, as there is less data involved
What are the 3
benefits of normalisation?
» No unecessary duplication of data
» Data integrity is maintained
» Fewer fields - faster searches
What is atomic?
» Data cannot be broken down any further