Presentation is loading. Please wait.

Presentation is loading. Please wait.

Version: 2.0. Forenam e of parent Surname of parent Address 1 Address 2 Name of child Age of child School database example. Try adding a few rows for.

Similar presentations


Presentation on theme: "Version: 2.0. Forenam e of parent Surname of parent Address 1 Address 2 Name of child Age of child School database example. Try adding a few rows for."— Presentation transcript:

1 Version: 2.0

2 Forenam e of parent Surname of parent Address 1 Address 2 Name of child Age of child School database example. Try adding a few rows for families. Can you spot any issues with this way of storing data?

3 The major advantage of a relational database over a flat-file database is that it eliminates duplication of data. This has several knock on effects: data only needs to be input once data only needs to be updated in one place

4  Relational Databases have this concept of an entity  An entity is basically a real life thing about which you wish to hold some data  Eg car, person, train journey, dvd

5  Typically its stored in tables, data about one entity is kept in one table, data about another entity is kept in another table  Eg data about cars might well be kept in one table while data about drivers would be kept in a different table

6  The table has columns (sometimes called fields), each of which holds just one piece of data eg age, or height, or name  All the data about one thing is called a row (or a record) eg for a car this might be make, model, registration, colour. MakeModelRegistrationColour FordKaW345YTRBlue Citroen2CVD234 FRERed AustinMaxiR564 DSWBeige An example table

7 Each row in a table must be able to be uniquely identified, you can’t rely on the data itself to do this because there may be duplicates eg two people might have the same name So typically an unique ID number is created for each row. This unique ID forms what is called a PRIMARY KEY, a value that uniquely identifies one row in a table. The primary key value is what is used to link one table to another A primary key value used in another table forms a FOREIGN KEY IDUnique number Surnametext First nametext agenumber addresstext Towntext Post codetext IDUnique number Owner idnumber maketext modelnumber registrationtext Primary key Foreign key owner car relationship

8 In the relational database, the tables are related to one another For example, a table about cars will be related to a table about car owners. Of course a car owner may own more than one car but a car may only be owned by one owner. This is a MANY – ONE relationship There are ONE-ONE relationships, eg person and medical record And MANY- MANY relationships, eg tv show and actor

9  This software allows the relational database to be managed  Tables created and deleted  Related tables to be linked to one another  Data to be entered and edited  Data to be retrieved and sorted  Queries to be performed (database interrogation)

10  A DBMS allows the separation of data from applications. Why is this desirable?

11

12

13

14

15 AUser must enter a letter or a digit. aUser can enter a letter or a digit.

16

17

18

19

20

21

22

23

24


Download ppt "Version: 2.0. Forenam e of parent Surname of parent Address 1 Address 2 Name of child Age of child School database example. Try adding a few rows for."

Similar presentations


Ads by Google