Presentation is loading. Please wait.

Presentation is loading. Please wait.

AC 2002 - 20031 Databases A technical example of a two table relational database.

Similar presentations


Presentation on theme: "AC 2002 - 20031 Databases A technical example of a two table relational database."— Presentation transcript:

1 AC 2002 - 20031 Databases A technical example of a two table relational database

2 AC 2002 - 20032 A quick review : The simplest databases are the electronic equivalent to a shoebox –the shoebox itself is a TABLE –each card is a RECORD –on each card : specific data item containers are FIELDS (filled in with data)

3 AC 2002 - 20033 Let’s construct an example : A database of Water Treatment Stations –plants outside cities where used domestic waters are cleaned up What is the set of Water Treatment Stations that we shall consider ? –It will concern France. What information do we want to gather on each station ?

4 AC 2002 - 20034 What information do we want to gather on each station ? The name The location (which city it serves) Its capacity Its production The technology used The operator The number of stations run by the operator Financial figures about the operator The type of franchise

5 AC 2002 - 20035 Money Time used to be money Now : information is money

6 AC 2002 - 20036 An example : Gather information on 200 domestic waste treatment plants in France It takes 15 days of a free trainee on the phone Then sell the study to many clients –cities that intend to build a plant –operators –suppliers, etc. eg : 1000 €/ study x 50 clients = 50 000 €

7 AC 2002 - 20037 Another example Innovative buildings –select 500 innovative buildings in France –gather information on the architects, the techniques, the materials, the builder, the suppliers, etc. –there are thousands of potential clients (all architects, all suppliers, etc.) –we can sell the study 1000 € to say 1000 clients –NOTE : for each of them, to reproduce the work would cost more than 1000 €… An architect is in the business of drawing bldgs, not creating and selling information 1000 x 1000 € = ?

8 AC 2002 - 20038 Back to technicalities : Access is THE king information mgt software of the MS Office Suite It offers, like any other DB software, several VIEWS for the data : –the simplest : the TABLE presentation ; we see all the information at a glance –the most intuitive : the FORM presentation ; each record appears as ONE CARD

9 AC 2002 - 20039 Where IS the information ? In the TABLE DON’T delete tables (unless you’re sure of what you’re doing) Not in the FORM displays We may delete a form display without much consequences

10 AC 2002 - 200310 One problem : Access, like any DB, is designed to manage structured information It puts it into a table (with records, fields, etc.) It runs into the problem of repetitive information

11 AC 2002 - 200311 Repetitive information : In our example every time we enter Lyonnaise in the « operator » field, we then have to enter 2500 in the field « number of stations run by the operator » Time consuming useless repetition Potential source of data entering mistakes

12 AC 2002 - 200312 Solution : Create a separate table for « operators » Enter information specific to operators into this second database and LINK the operators table to the stations table. Our database will now be a multiple table database, also called a relational database

13 AC 2002 - 200313 A frequent mistake : A frequent mistake is to create the second table into a new database No, no We must create the new table within the SAME database, just like we created new sheets within the same excel document (if we wanted to link them…)

14 AC 2002 - 200314 The technique : We split the one table database into TWO tables Why ? Because there was repeated information, and we want to avoid that (There exists a tool that analyses how to split the information, we did not use it) We are still into ONE database There remains to link the two tables

15 AC 2002 - 200315 Let’s step back, what do we do ? We split our initial UNIQUE table into several tables of information In our example the way to do it was natural and evident : have a main table for Stations and a « subsidiary » table for Operators In more complex situations there is no unique choice ; it is a matter of database architecture (we have the choice)

16 AC 2002 - 200316 Database architecture With the same end use, some databases are beautiful, some databases are ugly It all depends upon the art of the architect The main database architecture tool is called UML (Uniformed Modelling Language)

17 AC 2002 - 200317 Creating the link Determine which field in the subsidiary table will be the « handle » of the link with the main table Make it the primary key of the subsidiary table Go to the Relations view and « pick and slide »...

18 AC 2002 - 200318 Difficulties FAQ Cannot create a « 1 to many » link : another person in the room uses the same name, with the same login Cannot « save as » : normal ACCESS is more complex than Word Why ? Because we ACCESS we work on the heart of information not just on displaying it


Download ppt "AC 2002 - 20031 Databases A technical example of a two table relational database."

Similar presentations


Ads by Google