Presentation is loading. Please wait.

Presentation is loading. Please wait.

Our world depends on databases

Similar presentations


Presentation on theme: "Our world depends on databases"— Presentation transcript:

1

2 Our world depends on databases
Google basically IS a database (index) Facebook is build around databases So is e-Bay & Netflix and X-Box Live Travel agents, schools, doctors and hospitals all rely on them You get the idea!

3 Databases are so useful because they’re so good at storing info
But they do it in a very structured way That’s so the data can also be sorted And so the data can also be searched So overall, what makes databases so special is how they store, sort & search Let’s look at some examples…

4 Store Search Sort

5 We’re actually going to look at databases into two stages.

6 Database Tables Types of Data Relational Databases
First, we’ll learn the basics of how databases work: A Database Tables B Types of Data C Relational Databases

7 A Database Tables So we’ve said what makes databases so special is how they store, sort & search But how can they do that? The secret is that they work in a very structured or organised way This starts with the way that all data is stored in what are called tables…

8 Database Tables A Here’s a database table for members of a club...
Field name Record Field

9 Database Tables A Here’s a database table for members of a club...
Field name Record Field

10 Database Tables A Here’s a database table for members of a club...
Field name Record Primary Key Field

11 Database Tables Recap A Databases store info in a structured way
Data in a database is stored in a table Each row is called a record Each column is called a field A special field called the primary key holds a unique identifier for each record

12 ‘Unique identifiers’ are everywhere!

13 Database Tables Recap A Table Field name Recordl Primary Key Field
All this data is stored in a ?? Table This is a ?? Field name This is a ?? Recordl This is the ?? This is a ?? Primary Key Field

14 Database Tables Recap A This table has ____ records 4
There are ____ fields 4 The primary key is called _______ LessonID

15 A Database Tables B Types of Data C Relational Databases

16 B Types of Data A second secret to how databases work is the way they handle different types of data Let’s look at an example…

17 Types of Data B Can you spot the different types of data?
We call these ‘data types’ Text Numbers Dates

18 B Types of Data Database tables can store different data types, such as... Text Numbers Dates When building a database, you say what type of data can go in each field This can help prevent errors, such as checking that dates are DD/MM/YY

19 A Database Tables B Types of Data C Relational Databases

20 Relational Databases C
Simple databases with just one data table are called flat file databases. But using only one table creates BIG problems for larger systems because lots of data can be duplicated and the database becomes very inefficient. So advanced databases use multiple tables They are called relational databases Let’s look at why they are needed…

21 Relational Databases C Notice that several patients see Dr Brown
So her details are duplicated. This is called redundant data because copies are inefficient & cause inconsistencies Can you spot one?

22 Relational Databases C PatientID DocID Primary Key Foreign Key DocID

23 Relational Databases We show this relationship in a diagram
C Relational Databases We show this relationship in a diagram Doctors DocID Surname Department Mobile Patients Patient ID Forename Surname DocID It’s a ‘One To Many’ relationship One doctor can treat many patients

24 Relational Databases C Car Club Again, data is duplicated or redundant
Redundant data causes inconsistencies Can you spot one?

25 Relational Databases C Car Club SupplierID SupplierID 1 2 3 1 1 2 1 2

26 Relational Databases We show this relationship in a diagram
C Relational Databases We show this relationship in a diagram Supplier SupplierID CarSupplier Address1 Town Postcode Member MemberID Forename Surname Car Reg Car Supplier It’s a ‘One To Many’ relationship One Car Supplier can supply many members

27 Relational Databases C Dog Kennel Business
Again, data is duplicated or redundant Redundant data causes inconsistencies Can you spot any?

28 Relational Databases C Dog Kennel Business VetID VetID 3 1 2 2 3 2 1
Betta Vetz 2 Top Vets 3 West Vets

29 Relational Databases We show this relationship in a diagram
C Relational Databases We show this relationship in a diagram Vet VetID VetName Address1 Town Postcode Pets PetID Name Owner Name Owner Mobile Vet ID It’s a ‘One To Many’ relationship One Car Supplier can supply many members

30


Download ppt "Our world depends on databases"

Similar presentations


Ads by Google