Information Handling Databases by wuzhengqin

VIEWS: 0 PAGES: 13

									Lesson 2 - Tables
Starter
 www.reviseict.co.uk


 Go to the revision games section. Search for and play the
  ‘database’ games.
Objectives
 Become familiar with databases.
 Explore the uses of tables in database design.
 Begin creating database tables with suitable types.
What is a database?

 A database is an organised collection of data.


 Organised in tables


 Search via queries and filters
    ‘query’ the data (e.g. when you have a query)
    A query is a QUESTION, which you ask the computer.
Quick Task
 Data in a database is a specific TYPE. Write down two
  examples of each of the following types


 Text                    Name, Address
 Number                  Age, Stock. Score
 Currency                Price, Wage, Hourly Rate
 AutoNumber              Customer Number, Item Number
 Boolean (Yes/No)        Paid, Valid member
 Date/Time               DOB, Date of Registration
A collection of data…

 Organised, structured.
 What’s the problem?
    How can I tell which is which?
    How do database users overcome this?
A Unique Identifier

 Uniquely identifies a record.
 Known as a ‘Primary Key’ (a.k.a a unique identifier)
 You have one of these to track you throughout your academic career. It is called
  your Unique Pupil Number.
 You have one on the network. This is your username.
What a database is made up of?
   Record – A set of information relating to one thing (a
   row of data) . How many records are here?




Primary key – a field
which uniquely identifies                              Field – One piece of information
a record                                               within a record. How many fields
                                                       are in a record?



What would happen if there was no primary key? Look at Chris
Smith….which one?
                         Creating a table
-Field types (including AUTONUMBER)
                         - Field Formats
                           - Primary Key
Task 1

 Create a folder in your Unit 1 folder called ‘Databases’
 Create a new database called ‘Vets Data’
 Create a table inside your database, with the following fields:
 Add two additional fields which you think could be added.
 Add 5 records.
     Field                  Type         Properties

     Customer Number        AutoNumber   Required: Yes, Primary Key

     Customer Name          Text         Length: 100, Required: Yes

     Customer Title         Text         Length: 10, Required: Yes

     Address Line 1         Text         Length: 200, Required: Yes

     Town                   Text         Length: 50, Required: Yes

     Postcode               Text         Length: 7, Required: Yes
Task 2
 Practice your sorting and filtering.


 Sort by surname
 Sort by postcode
 Sort by customer number
 Add a record
 Delete a record
 Change a record (e.g. an address)
 Add a yes/no field called “PrivateCustomer”
 Change three records so that they are private customers.
Objectives Review
 Become familiar with databases.
 Explore the uses of tables in database design.
 Begin creating database tables with suitable types.
Q&A Recap
 What is a primary key and why is it needed?


 Suggest 5 different data types and an example of their use


 What other data types exist (e.g. on in the internet)?
    Sound, Video, Lists, Images


 Give two examples of where a database is used in society
  with reasons for use.

								
To top