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