Docstoc

Databases Databases

Document Sample
Databases Databases Powered By Docstoc
					Databases

What are they?
What is a database?
   telephone directory
   address book
   doctor/dentist patient
    records
   cinema bookings
   Internet!
   School data sheets
    on you!
OK…don’t laugh…but..
   One example of a database is a MP3 player.
    Ipods store files in the following system: you do any
                                            Can
                                                         better?
             Song        Artist     Album       Len     Rating
              title                             gth   Add your own
                                                     choice of records
           Teenage     The        True          2:28    *****
Record     kicks       Undertones Confessions
                                                         to Task 1.

  1
           Vertigo     U2         How to        2:02   ****
Record                            dismantle ?
  2
           19th        Rolling    Forty Licks   3:57   *****
Record     nervous     Stones
  3        breakdown
                                                    Adam
                                      Ross
                                                    Ahmad
Sorted!                               Christopher
                                      Stanley
                                                    Amy
                                                    Charlie
                                      James
     So now go to your worksheet and
                               Robert  Christopher
   One great feature of
    databases iscomplete task 2!
                               Vincent Danielle

                 that it       Edward  Dom
                                      Danielle      Edward
    can SORT data into                Samantha      James
    ORDER…. Through                   Charlie       Lizzie
    many fields…. Do you              Thomas        Matthew
    have the skills to do             Adam          Michaela
                                      Matthew
    this yourself?                    Michaela
                                                    Nathalie
                                                    Robert
                                      Nathalie      Ross
                                      Amy
   Put the following data so
                        OK…
                                      Lizzie
                                                    Samantha
                       what are the                 Stanley
    into Ascending 1st 5 names?       Ahmad
                                                    Thomas
    order…                            Dom
                                                    Vincent
 Task 2 answers…
      Type                  Name           Gender        Age                 Food
                                                                                                 So get the hint….

      Giant Panda       Pongo                  M                8        Bamboo
                                                                                                   A database can
      Giant Panda       Bongo                  F                7        Bamboo
                                                                                                   SORT a lot of
      Penguin           Pingu                  M                5        Fish
                                                                                                   data QUICKLY
      Lion              Hermes                 M                4        Fresh meat
                                                                                                 into any order that
                                                                                                     you want…
      Lion              Tarsa                  F                4        Fresh meat
      Crocodile         Spike                  M                7        Fresh meat
                                                                                                  ascending or
      Gorilla           Gemella                F               122       Fruit
                                                                                                descending by any
      Zebra             Stripey                M                8        Grass
                                                                                                    data fields
      Snake             Leyla                  F                2        Live mice
      Parrot            Robina                 F               25        Nuts and
                                                                         seeds


Q1:             If this database was put into ascending order by name – who would be 1st and last in the list?
                Bongo & Tarsa

Q2:             If this database was put into descending order by Type order – who would be 1st and last in the list?
                 Zebra & Crocs

Q3:             If this database was put into into descending order by age order – who would be 1st and last in the list?
                Gorilla & Snake
Data Types
   Alphabetic – only       Numeric – only
    letters are allowed.   numbers are allowed:

    Example fields:        Example fields:
    First name             Age
    Colours                Height
    Animal type            Speed/m.p.h.
                           Percentage
Data Types
   Alpha_numeric –            Currency – uses
    this uses letters and       currency signs!
    numbers together.           Pound, dollar, Euro
                                etc.
   Examples:                  Time – hours,
   Tutor Groups                minutes, seconds
   Postcode                   Date – day, month,
                                year
   NI number
Data Types
   Boolean – exam board               Memo – contains lots of words
    favourite!
                                       Container – image, sound,
This data type has only 2 choices       video
   for the PC user to select…
                                       Auto-number – this
                                        automatically generates a
Examples:                               number every time a new
Yes / No                                record is created
Male / Female
On / Off
                                                                                                                 Boolean!
       Now to your worksheet
 Name      Initials Title        Address1         Address2     Address3      Postcode Car Number    Date      Nights    Room        Deposit
                                                                                                                       Number        paid
Allen      S       Miss     18 Mathew Gate       Dawlish     Devon           EX7 8AS    W28 JTY    22/03/00        3            2      Yes
Baker      D       Rev      The Rectory          Manor Road  Gateshead       NE11 1TB   R124 TFX   23/03/00       11            8      Yes
Belson     H       Dr       51 Willes Road       Stalbridge  Dorset          DT10 2TB   B29 GYK    24/03/00        1            3       No
Bowman     C       Mr       Rooks House          Manor Drive Portsmouth      PO5 3BX    S447 PXW   25/03/00        3            2      Yes
Fisher     P       Mr       19 Chaddock Street   Wast        Glasgow         G74 3D     L241 PJF   22/03/00        2            4      Yes
Hall       T       Mr       12 Regents Avenue    Kilbridge
                                                 Gravesend   Kent            DA11 5RN   P275 JTR   24/03/00        3            4      Yes
Kelly      J       Mr       48 Mill Road         Colchester  Essex           CO4 3TT    K218 TXW   27/03/00        2            4       No
Martin     N       Dr       5 Mulberry Court     Brampton    Cambridge       PE18 9JR   T921 55B   25/03/00        3            2      Yes
Mitchell   M       Mrs      9 Darnal Way         Prudhoe     Northumberlan   NE44 5BP   T12 MM1    23/03/00        2            6      Yes
Nichols    F       Mr       8 Wickham Road       Trud        d
                                                             Cornwall        TR 1 2BB   Y382 FKB   21/03/00        1            2       No
Slater     P       Mr       10 Heather Way       Abergavenny Gwent           NP7 4DP    l119 GWR   25/03/00        2            1      Yes
Thomas     L       Mrs      10 Duke Rise         Grange Park Swindon         SN5 8AH               25/03/00        2            6       No
Walker     A       Mr       85 Gloucester Road               London          SW6 2PP    L231 PSW   22/03/00        3            5      Yes
Ward       T       Dr       5 Oak View           Monkseaton Whitley Bay      NE42 6AA   S977 TMR   25/03/00        5            5       No
Watson     J       Miss     19 Golf Road         High Melton Kingston        KN3 6SR    JN5 2US    22/03/00        2            3      Yes
Weetman    P       Mr       144 Townsend         Banbury     Oxon            OX16 7SN              21/03/00        4            8      Yes
                            Avenue

   alphabetic                               Memo                             alphanumeric               date             numeric

       Label your copy of this database file with the correct
        Data types.
                                                                    OR in other
                                                                     words…
Types of Databases
   Flat File - A flat file The school databaseone data file at a time. Each
                            database deals with with Y11
                               student timetable data held can be 'interrogated'
    record contains the same field headings. The in it…
    by carrying out searches and sorts and producing reports.

                                        The school class-room database that
 Relational - Related items of data can be stored teacher, Year group &
                                       gives each room, in separate files so
                                        subject for cuts room, every lesson,
  that the data is accessed only when needed. Thiseverydown on the number of
  separate data items stored in the computer memory. each day!
                                                    for


   Distributed - It is a large-scale relational database with on-line
    features for users to contact the system. A user has direct access to the
    database from his or her computer terminal. The database contacted could be
    miles away (even in a different country). The connection is through a WAN
    network through a modem. Access to a distributed database is strictly
    controlled, with users being allowed into specific parts of the system at a time.
    Security of the data is very carefully monitored.
… Types of databases.
   Flat File – your MP3
    file, your mobile
    phone file of phone
    numbers – only stores
    the USERS data
    under one file name.
Relational Database
   Data is stored in separate
    files
                                        But who do these agencies link
Examples include                        their database files to???
Police files database
School database
Travel Agents
DVLA (car registration) linked to
   Insurance linked to police queries



    Travel                Airplane         Car Hire                Hotel
    Agent                 company          Company
Distributed Databases
   This is a large-scale relational
    database with on-line features
    for users to contact the
    system.




   Cinema bookings
   On-line supermarkets
   Travel Agents
   Secret service
Computerised databases…
   Can hold a vast amount of data
   Very fast to find a specific record
   Can easily search for a specific criteria e.g. "all of the people who
    live in Warwick“
   Can perform analysis on the data e.g. ‘most popular selling item’
   Data can be sorted into ascending or descending order on any
    criteria
   Can easily update or amend a record e.g customer moves house
   Records are stored safely and are not easily lost
   Easy to make a back-up in case of data loss
Paper-based databases

   Limited by physical storage space available
   Can take a while to manually search through all of the records
   Difficult to search for a specific criteria, every record would have to
    be manually looked at.
   Very difficult to analyse the data.
   Can only store data ascending or descending under one criteria e.g.
    surname
   Changes have to be done manually, records can look messy if
    scribbled out.
   Records can be lost or misfiled, making it hard to find them.
   Difficult to make a back up in case of data loss
Which are manual & which are
computerised database issues?

Can easily search for a specific criteria e.g. "all of the people who live in Warwick"             Complete the
Can easily update or amend a record e.g customer moves house
                                                                                                 questions on your
Can hold a vast amount of data
                                                                                                    work sheet
Can only store data ascending or descending under one criteria e.g. surname

Can perform analysis on the data e.g. 'most popular selling item'

Can take a while to manually search through all of the records

Changes have to be done manually, records can look messy if scribbled out.

Data can be sorted into ascending or descending order on any criteria

Difficult to make a back up in case of data loss

Difficult to search for a specific criteria, every record would have to be manually looked at.

Easy to make a back-up in case of data loss

Limited by physical storage space available

Records are stored safely and are not easily lost

Records can be lost or misfiled, making it hard to find them.

Very difficult to analyse the data.

Very fast to find a specific record