Presentation is loading. Please wait.

Presentation is loading. Please wait.

Starter Draw a mind map for topic 6 Databases. Objectives Revise topic CG3.6 Databases using various activities and ensure that topics covered are understood.

Similar presentations


Presentation on theme: "Starter Draw a mind map for topic 6 Databases. Objectives Revise topic CG3.6 Databases using various activities and ensure that topics covered are understood."— Presentation transcript:

1 Starter Draw a mind map for topic 6 Databases

2 Objectives Revise topic CG3.6 Databases using various activities and ensure that topics covered are understood in order to fully answer exam questions based upon this topic.

3 Activity 1 – Paired work 1)What is meant by data consistency? 2)What is meant by data redundancy? 3)What is data independence? 4)What is meant by a flat file database? 5)What is meant by a relational database?

4 Activity 1 – Paired work 1)What is meant by data consistency? – Data consistency refers to the concept that in databases all the data about a person or object would be the same in every instance of the data held about it. 2)What is meant by data redundancy? – Data redundancy is when the same data is repeated in a database system. 3)What is data independence? – Data independence is hiding the structural definition of data from the user of a database system 4)What is meant by a flat file database? – Flat file database system is one where all the data is stored together in one table. 5)What is meant by a relational database? – Relational database system is one where data is stored in two or more tables that are linked together

5 Activity 2 – Mind Map Complete this mind map! Advantages of relational databases over Flat file database

6 Activity 3 – Normalisation Normalisation is the name given to the process of turning a flat file database into a relational database. There are usually 3 stages known as: First Normal Form (1NF), Second Normal Form (2NF) and Third Normal Form (3NF). Using examples describe each of the above normalisation forms.

7 Activity 3 – Normalisation A table is in 1NF if it: 1)Contains no repeating attributes (fields) or groups attributes 2)Each group of related data is in its own table (Entity) 3) Contains a primary key that uniquely identifies each record (row) E.g. – Not in 1NF StudentTable (StudentNo, Student Name, DOB, Gender, Course No, CourseName, LecturerNo, Lecturer Name) In 1NF StudentTable (StudentNo, Student Name, DOB, Gender, Course No) CourseTable (Course No, CourseName, LecturerNo, Lecturer Name)

8 Activity 3 – Normalisation A table is in 2NF if it: 1) Is in 1NF 2) Contains no partial dependencies(Rows (records) of data should not be repeat) E.g. In 1NF StudentTable (StudentNo, Student Name, DOB, Gender, Course No) CourseTable (Course No, CourseName, LecturerNo, Lecturer Name) In the above example every time a student enrols on a new course their details would have to be repeated again with only the field CourseNo changing. This means data redundancy. CourseNo therefore is not related to the primary key field StudentNo. In 2NF StudentTable (StudentNo, Student Name, DOB, Gender) StudentTakes(StudentNo, Course No) CourseTable (Course No, CourseName, LecturerNo, Lecturer Name)

9 Activity 3 – Normalisation A table is in 3NF if it: 1) Is in 2NF 2) Contains no non-key dependencies(All columns depend on the primary key) E.g. In 2NF StudentTable (StudentNo, Student Name, DOB, Gender) StudentTakes(StudentNo, Course No) CourseTable (Course No, CourseName, LecturerNo, Lecturer Name) Look at the CourseTable. Lecturer Name is dependent on LecturerNo and not CourseNo. Hence this needs to separated into a table of its own. IN 3NF StudentTable (StudentNo, Student Name, DOB, Gender) StudentTakes(StudentNo, Course No) CourseTable (Course No, CourseName, LecturerNo) LecturerTable(LecturerNo, LecturerName)

10 Activity 4 – Normalisation 1)Describe what is meant by a primary key? 2)Describe what is meant by a foreign key? 3)Describe what is meant by a link? 4)Describe what is meant by a index?

11 Activity 4 – Relational Databases 1)Describe what is meant by a primary key? – A field that uniquely identifies a record (row) in a database table. 2)Describe what is meant by a foreign key? – A primary key field from one table that is repeated in another table to join the two tables together. 3)Describe what is meant by a link in a relational database? – This is the joining of 2 or more tables together by a foreign key. 4)Describe what is meant by an index in databases? – Data in a table is usually sorted in primary key order. Having an index on a field allows us to sort the data on another field besides the primary key field.

12 Activity 5 – Re-structuring data into third normal form For each of the following scenarios re-structure the data into third normal form: 1) 2) Student NumberStudent NameTutor NumberTutor Name 122111Jaspreet Kaur6Helen Smith 121122John Ingham6Helen Smith 132212Lucy Smith7Graham Roseblade 121121Remario Smyth6Helen Smith CompanyIDCompanyNameTelephonePackageNoPackagePrice RENTARent-A-Tool014732127771000PowerPoint£80.00 SEYMOURSeymour Glass013545436661000PowerPoint£80.00 RENTARent-A-Tool014732127771200Excel£100.00 RENTARent-A-Tool014732127771300Access£150.00

13 Activity 6 – Exam Practise 1)Using the CG 3 Past Papers find exam questions relating to the aspects we have covered in todays revision session. Answer the questions and mark your answers using the appropriate mark scheme.

14 Plenary How many of the keywords can you remember from last weeks 30 seconds challenge?


Download ppt "Starter Draw a mind map for topic 6 Databases. Objectives Revise topic CG3.6 Databases using various activities and ensure that topics covered are understood."

Similar presentations


Ads by Google