Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 10 Databases.

Similar presentations


Presentation on theme: "Lesson 10 Databases."— Presentation transcript:

1 Lesson 10 Databases

2 We Are Learning Today Describe a database as a persistent organised store of data Explain the use of data handling software to create, maintain and interrogate a database

3 What is a database? Go and list 5 databases that we use in our everyday lives..... 1 2 3 4 5

4 What is a database? A database is a store of data that is
persistent – it is held on some form of permanent medium such as a disk or flash memory related – the data in a database is not just a haphazard collection of facts organised – the data is stored in a structured predictable way so that it can be more easily processed usually held for the benefit of some organisation – all businesses and other organisations depend on their stored data

5 Database levels A database can be viewed at three levels:
The external view The conceptual view The physical view

6 The external view This is what the user sees. It is a view that is designed to be useful for a particular job.

7 The conceptual view This is concerned with how the data is organised. It has to do with the design of the tables and how they are linked.

8 The physical view This is concerned with how the data is actually stored on the storage medium. The designers and the users of the database are not concerned with this detail. It is looked after by the database software.

9 Types of databases Flat file – we will look at one....
Relational – Used in the main by most businesses Hierarchical – not really used now, but do exist!!!

10 Elements of a database Entity Attributes Record Field
Note down the following in your books!!!

11 Learning Activity Produce a mind map of the previous terms and explain them in more detail. Entity Attributes Record Field HINT: Use the emindmaps software to produce this.

12 Learning Activity Take the file out of the shared files....
You will complete the presentation on Database Concepts

13 Flat File Databases Consist of only table
Example would be a personal address book: fairly small Stores few items Fields could be: First_name Address_1 Telephone_No Record is when we have a full set of data about that person Could be set up easily in a spreadsheet

14 Example Flat File First Name Last Name Telephone Street City Postcode
DOB Claire Pate 404 Morbi Road Southampton SO528GD 28/06/1999 Susan Landry 32 Nullam Road SO555GF 05/04/1978 Brian Hodge 541 Sed Avenue SO123YW 26/01/1999 Noelle Hewitt 704 Varius Street SO10 7NJ 04/08/1994 David Goff 97 Primrose Close SO552AW 30/01/1998

15 Task Possibly a definition of what a flat file database is
List the advantages and disadvantages of using flat file databases Set up an example mark book for this class – either in Access or Excel

16 Data Redundancy What is it? What can this cause? Examples…
The unnecessary repetition of data What can this cause? Complex processing problems because each time a piece of data is repeated each instance has to be updated. Examples… Come up with one!

17 Data Integrity, validation and verification
Data Integrity is – the state of data being as it should be, it is what it should be! Validation is – the process of checking data as it is input to ensure that it is reasonable Verification is – the process of checking that data is true or correct

18 Validation This type of checking is carried out by data handling software It is useful for when data is copied into the computer systems by human operators It does not prevent all errors, just the breaking of the rules!

19 Verification Verification quite often can only be performed by human inspection It can be as simple as just carefully comparing what is entered in the database with the source material. Humans make errors too easily – so is slower more reliable method is to enter the data twice using two operators It compares then highlights any differences

20 Task Using the worksheet on Validation and Verification complete the following: Research the different types of validation checks explaining what each is and how it works Explain what each machine used to enter data is and a benefit and limitation of it

21 Lesson 12 Relational Databases

22 We Are Learning Today Understand the relationship between entities and tables. Understand the components of a relational database, such as; tables, forms, queries, reports and modules. Understand the use of logical operators in a database.

23 What is a relational database?
Stores data in tables Each table contains data about one entity A table is called a relation

24 How are tables linked? Primary keys – we will look at what they are
Foreign keys – we will look at what these are

25 The Employee Table Which columns acts as primary and which as foreign keys?

26 Example of a Relational Database Diagram
pub_id job_id Publishers -- pub_id Jobs -- job_id Highlight the primary and foreign keys emp_id Employee -- emp_id pub_id job_id pub_id job_id

27 Entity Relationships Data about different entities needs to be kept separate Tables are linked together to keep data duplication at a minimum Linking tables in a ONE –TO-MANY way avoids data redundancy Cats and fleas (example from book!) Cat Flea

28 Entity Relations Cat Flea
A cat has many fleas, but a flea can only have one cat. Think of three more examples of this. Get ready to feedback to the class.

29 Entity Relationship Diagram
Connections with “crows feet” Three prongs means MANY One prong means ONE Cat Flea

30 The DBMS The DBMS must allow data sharing allow multiple user access
allow multiple applications to work on them hold just one copy of data that everyone can access – this prevents inconsistent updates make it possible to change the data in a database without having to change the applications.

31 Referential integrity
Different applications must not cause conflicts. Records must be locked while one application is performing an update so that another application cannot produce an inconsistent result. Inconsistent changes must be prevented – for example , an exam subject must not be deleted if there are students connected to it. This is called maintaining referential integrity.

32 Realistic Example – Hotel Booking
What needs to be included? What would the relationships be? Tables we will have: Room Booking Client

33 Task Make a list of field names we will need in each table: Room
Booking Client Field Datatype Room_number Integer (number) Room_type Text View Boolean Bath TV

34 Relational Databases Stores data in tables
Each table has data about ONE entity A table is called a RELATION Table has attributes, as fields Rows which are records Each table has to have a primary key Tables are LINKED using PRIMARY and FOREIGN keys

35 Concurrency Locking of a file
Where might you use this? Note down in books Read through this on page 103


Download ppt "Lesson 10 Databases."

Similar presentations


Ads by Google