Presentation is loading. Please wait.

Presentation is loading. Please wait.

GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Databases.

Similar presentations


Presentation on theme: "GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Databases."— Presentation transcript:

1 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Databases

2 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Activity 1 1 minutes to discuss and feedback on the following: What is a Database?

3 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Introduction Learning Objectives: (e)Understand the relationship between entities and tables (f)Understand the components of relational databases, such as tables, forms, queries, reports and modules (g)Understand the use of logical operators in framing database queries (h)Explain the use of key fields to connect tables and avoid data redundancy (i)Describe methods of validating data as it is input. Order No. First Name SurnameHouseAddressTownPost Code ItemPriceDate 1DaveJones12Jubilee Rd ExeterEX2 5FD Monitor10012-03- 2014 2MandyWilliams63Fore Street TauntonTA8 9GH Keyboa rd 2212-03- 2014 3SamSmith233Grange Rd TorquayTQ1 9DR PC50013-03- 2014 4HollyMoon15House Lane ExmouthEX9 7HG Monitor10014-03- 2014 5AlfredRichie7Good Street ExeterEX1 6GF Games Pad 1214-03- 2014 “A database is a persistent organised store of related data” Learn this definition! Persistent – Permanent Organised – Data stored in records and fields Here is an example of a computer shop sales FLAT FILE database:

4 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Data Redundancy Learning Objectives: (e)Understand the relationship between entities and tables (f)Understand the components of relational databases, such as tables, forms, queries, reports and modules (g)Understand the use of logical operators in framing database queries (h)Explain the use of key fields to connect tables and avoid data redundancy (i)Describe methods of validating data as it is input. Order No. First Name SurnameHouseStreetTownPost Code ItemPriceDate 1DaveJones12Jubilee Rd ExeterEX2 5FD Monitor10012-03- 2014 2MandyWilliams63Fore Street TauntonTA8 9GH Keyboa rd 2212-03- 2014 3SamSmith233Grange Rd TorquayTQ1 9DR PC50013-03- 2014 4HollyMoon15House Lane ExmouthEX9 7HG Monitor10014-03- 2014 5AlfredRichie7Good Street ExeterEX1 6GF Games Pad 1214-03- 2014 6DaveJones12Jubilee Rd ExeterEX2 5FD Monitor10015-03- 2014 In this FLAT FILE database (which means the database consists of only one table), if another sale occurred, a new record would be added to the table. And in this record, ALL the data about the person and sale item, would have to be added.

5 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Data Redundancy The Entities in this database have a many to many relationship, which means: A Customer can buy many items. An item, can have many different customers. Because of this, if we had just one table (flat file) in our database we would potentially be forever adding the same information into our table for each sale: -If in one day, 10 keyboards got sold, we would be adding ‘keyboard’ and ‘£22’, into 10 separate records of our database. -If over the course of a week, one customer bought 5 different items (e.g. monitor, gamespad, PC etc), we would have to add the same customer details (name, address etc) into 5 separate records of our database. Learning Objectives: (e)Understand the relationship between entities and tables (f)Understand the components of relational databases, such as tables, forms, queries, reports and modules (g)Understand the use of logical operators in framing database queries (h)Explain the use of key fields to connect tables and avoid data redundancy (i)Describe methods of validating data as it is input. Customers Item

6 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Data Redundancy This is known as data duplication : -It is not only inefficient… -…it is also potentially problematic – humans make errors, so we want to limit the data they write to a database. The way around this is to make three different tables of data: -A ‘Customers’ table -An ‘Items’ table -An ‘Orders’ table …and link them together. Each time an order occurs all we do is link the appropriate customer (from the customer table) and the appropriate item (from the items table) to a record in the orders table. If the same customer makes another order, their details are already stored and so by linking them to a new order record means that we don’t need to keep entering the same data about the customer for each sale. Learning Objectives: (e)Understand the relationship between entities and tables (f)Understand the components of relational databases, such as tables, forms, queries, reports and modules (g)Understand the use of logical operators in framing database queries (h)Explain the use of key fields to connect tables and avoid data redundancy (i)Describe methods of validating data as it is input.

7 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Relational Database Design Learning Objectives: (e)Understand the relationship between entities and tables (f)Understand the components of relational databases, such as tables, forms, queries, reports and modules (g)Understand the use of logical operators in framing database queries (h)Explain the use of key fields to connect tables and avoid data redundancy (i)Describe methods of validating data as it is input. Customer ID First Name SurnameHouseStreetTownPost Code 1DaveJones12Jubilee Rd ExeterEX2 5FD 2MandyWilliams63Fore Street TauntonTA8 9GH 3SamSmith233Grange Rd TorquayTQ1 9DR 4HollyMoon15House Lane ExmouthEX9 7HG 5AlfredRichie7Good Street ExeterEX1 6GF Item ID ItemPric e 1Monitor100 2Keyboard22 3PC500 4Game sPad12 Order No.DateCustomer IDItem ID 112-03-201511 2 22 313-03-201533 414-03-201541 5 54 615-03-201514 Customers Table Items Table Orders Table

8 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Key Fields Learning Objectives: (e)Understand the relationship between entities and tables (f)Understand the components of relational databases, such as tables, forms, queries, reports and modules (g)Understand the use of logical operators in framing database queries (h)Explain the use of key fields to connect tables and avoid data redundancy (i)Describe methods of validating data as it is input. Customer ID First Name SurnameHouseAddressTownPost Code 1DaveJones12Jubilee Rd ExeterEX2 5FD 2MandyWilliams63Fore Street TauntonTA8 9GH 3SamSmith233Grange Rd TorquayTQ1 9DR 4HollyMoon15House Lane ExmouthEX9 7HG 5AlfredRichie7Good Street ExeterEX1 6GF Item ID ItemPric e 1Monitor100 2Keyboard22 3PC500 4Game sPad12 Order No.DateCustomer IDItem ID 112-03-201511 2 22 313-03-201533 414-03-201541 5 54 615-03-201514 Customers Table Items Table Orders Table

9 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Queries Although, the data about a particular sale is stored in several tables, because they all have a relationship (are all ‘linked up’) it means that the computer treats it like one big table. Most of the time, a database isn’t just about storing data, it is instead about using the stored data to find things out. Searching for information from a database is called a Querying. Because of the relationships, we can easily run a query and find the related data as if it were one big table. Learning Objectives: (e)Understand the relationship between entities and tables (f)Understand the components of relational databases, such as tables, forms, queries, reports and modules (g)Understand the use of logical operators in framing database queries (h)Explain the use of key fields to connect tables and avoid data redundancy (i)Describe methods of validating data as it is input.

10 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Lets look at a Real Relational Database Demonstration! Learning Objectives: (e)Understand the relationship between entities and tables (f)Understand the components of relational databases, such as tables, forms, queries, reports and modules (g)Understand the use of logical operators in framing database queries (h)Explain the use of key fields to connect tables and avoid data redundancy (i)Describe methods of validating data as it is input.

11 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Activity 2 15 minutes: Complete the Relational Database worksheet

12 GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Homework Research online to find out about data validation methods used with databases (search for “Access database validation”) Learning Objective: “Describe methods of validating data as it is input.” In a Word document, list and describe the various validation methods.


Download ppt "GCSE Computing: A451 Computer Systems & Programming www.computerscienceuk.com Relational Databases Databases."

Similar presentations


Ads by Google