Relational Databases
  9IST Information Software Technology
 T3L7 - Introducing relationships in DBMS

        www.cannedt...
About this show
• Learn about
• Using multiple tables in a DBMS
• Saving time and being flexible
• Advantages of Relational...
Relationships

• a way in which people and things
  are connected to each other
• husband and wife
• father and son
• brot...
Relational DBMS
• When a Database contains facts that are
  organised into more than one table
• If the facts have some ‘r...
2 Table Example
• Table 1 : The student table - contains facts
  about a student (name, address, year etc)
• Table 2 : The...
What if we use 1 table?
• If we use 1 table, we have to manually enter
  the names of the classes the students are for
  E...
Relational tables
                                    Year tbl
 Student tbl            Class tbl
                         ...
Why do this?
• Because we have 1 simple table to manage
  the facts (data) about the possible years
• 1 simple table about...
Why do this?
• Having data broken up into smaller, simpler
  tables makes it easier to manage and more
  flexible.
• we don...
Creating a class table
• What fields to we need to create a class
  table?
• name/year/subject
• so we can generate this ta...
Finding who’s who?
• This is done in s DBMS by asking questions
• Asking questions is called QUERYING
• If theres somethin...
Querying
• The question we would need to ask the
  DBMS for a class list is simple
• What STUDENTS are Maths
• SELECT name...
Summary
• Relational Databases are
• Good ways to break down ‘facts’ that can be
  re-used to remove REDUNDANCY
• Effectiv...
Activity
        click

Watch This!

    • Using a video camera in groups of 4
    • Think about a ‘role play’ in which yo...
Upcoming SlideShare
Loading in …5
×

9 Ist T3 L7 Database Relation Query

1,540 views

Published on

Episode 7 of the series for Year 9 looking at the topic of databases. Focus Relational Databases and Queries

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,540
On SlideShare
0
From Embeds
0
Number of Embeds
35
Actions
Shares
0
Downloads
62
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

9 Ist T3 L7 Database Relation Query

  1. 1. Relational Databases 9IST Information Software Technology T3L7 - Introducing relationships in DBMS www.cannedteacher.com
  2. 2. About this show • Learn about • Using multiple tables in a DBMS • Saving time and being flexible • Advantages of Relational Databases over Flat File Databases • Describing a Relational Database
  3. 3. Relationships • a way in which people and things are connected to each other • husband and wife • father and son • brother and sister • transmission and engine
  4. 4. Relational DBMS • When a Database contains facts that are organised into more than one table • If the facts have some ‘relationship’ that can be used to produce information as a result of BOTH tables • The resulting information is generated because of a relationship that the designer has made.
  5. 5. 2 Table Example • Table 1 : The student table - contains facts about a student (name, address, year etc) • Table 2 : The class table - contains facts about classes in school (year, subject) • If we want to generate a report about which students are in which class we could take advantage of a RELATIONAL DATABASE
  6. 6. What if we use 1 table? • If we use 1 table, we have to manually enter the names of the classes the students are for EACH student. • Requires more storage, takes longer and causes REDUNDANCY • REDUNDANCY - saying things over and over when you could say them once.
  7. 7. Relational tables Year tbl Student tbl Class tbl 7 art Name (text) 8 d&t Address 9 computing Year 10 maths 11 english Using 3 tables that 12 geography are related - we can hise ‘pull’ information pdhpe together that we need to form the class information
  8. 8. Why do this? • Because we have 1 simple table to manage the facts (data) about the possible years • 1 simple table about the subjects. • We can add, change or delete subjects from this table really easily - and use these facts in other places too • We can keep a simple record of a student and use these facts in other places too
  9. 9. Why do this? • Having data broken up into smaller, simpler tables makes it easier to manage and more flexible. • we dont need to repeat ourselves over and over and so use less space and less time • If a table becomes corrupt - it is easier to RESTORE (fix)
  10. 10. Creating a class table • What fields to we need to create a class table? • name/year/subject • so we can generate this table by ‘looking up’ facts from the first 3 we made. • this is called a LOOKUP • Look up the stuff you want and put it in
  11. 11. Finding who’s who? • This is done in s DBMS by asking questions • Asking questions is called QUERYING • If theres something wrong with a price at the shops, people often ‘query’ the bill with the cahier? • Does the store have what I want - you ask a member of staff - this too is a QUERY.
  12. 12. Querying • The question we would need to ask the DBMS for a class list is simple • What STUDENTS are Maths • SELECT names WHERE class = Maths • what information would you get if you asked these ... • SELECT names WHERE class <> Maths • SELECT names WHERE class = Maths and year = 9
  13. 13. Summary • Relational Databases are • Good ways to break down ‘facts’ that can be re-used to remove REDUNDANCY • Effective ways to asks questions - QUERY the data to produce new information • Lower storage needs and increase speed • Guard against terminal ‘data loss’
  14. 14. Activity click Watch This! • Using a video camera in groups of 4 • Think about a ‘role play’ in which your group can describe the idea of a RELATIONAL DATABASE - perhaps each person plays the role of a table and someone else pretends to be the database manager. • Role play how a query works. http://www.youtube.com/watch?v=GVOnFdMf0RU&mode=related&search=

×