1 / 24

Databases

Databases. IGCSE ICT Mrs. Ghazaal. f ile = table = file = table = file = table. Records. Fields. Key Field / Primary Key.

elwyn
Download Presentation

Databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Databases IGCSE ICT Mrs. Ghazaal

  2. file = table = file = table = file = table

  3. Records

  4. Fields

  5. Key Field / Primary Key It is very important that every record in a database can be individually identified. We need to be sure that when we access a record, we are accessing the correct one. The ID number is the ideal field to use to uniquely identify each individual record. We call this field the Key Field, or Primary Key The key field becomes essential when the records need to be sorted, searched or merged.

  6. Flat File Database • Collection of data held in a single table, data can only be viewed in a limited way • Table can be large or small, but all data is contained in one table

  7. Relational Database • Data is held in a number of tables where links (or relationships) are created to connect the data in different tables to each other • Purpose of creating a relational database • Data does not have to • be typed in twice • Quicker to • enter/update/edit data • Fewer errors are likely • Reduces storage • requirements

  8. How to Create a Relational Database • The files would be saved as separate tables • Key field(s)/foreign key would be identified • One field would be used to create a link/relationship between the tables

  9. Foreign Key • Foreign key is the primary key from another table • Foreign key is sometimes used to link two files and create the relationship between them • In the previous slide now you can see that the relational database allows us to use a student ID to find out the Tutor name and room number for any student

  10. Data Types • It is important that the database knows what type of data it is using for two main reasons. • Data such as numbers is stored differently to text • As a result of being stored differently, this determines what operations can be carried out on it • For example, numbers need to be stored in such a way that arithmetic can be performed efficiently. Dates need to be stored so that they can be referenced in order and have comparisons made on them.

  11. Different Data Types Before creating a database, it is vital that you have considered the fields and given each one it’s correct data type. (example of field: Family Name)

  12. Assigning types to fields It is very important that fields names be meaningful. When someone looks at a record structure, they need to know what the field contains. It is more sensible to have FirstName and FamilyName than name1, name2; and better to have Mobile or Home rather than just Telephone When inputting dates particular care has to be taken if the data contains American style dates and the computer is setup to expect British/Saudi style dates (or vice-versa) The date 6/9/08 refers to 6th September 2008 in Saudi, but would be 9th June 2008 in America. The regional settings of the computer must be adapted for the particular date format you need

  13. Practice Questions Alphanumeric/Text Date Numeric/Integer Boolean/Logical

  14. Validation • Validation is a method of checking that the data that has been entered into a system can successfully be used by the programs processing the data • When data is input to a computer, it is a good idea for the computer to check that the data is sensible (no dates of birth in the future, etc.) • Checks like this are called validation checks (is the data valid?) • Validation is always carried out by the computer

  15. Validation There are some commonly used validation checks, you will need to select the most appropriate data validation

  16. Which type of validation should we use? • All exam marks should be in the range 1 to 100 in an exam marked out of 100 • Range check • Dates should be entered in a specific way: mm/dd/yyyy or dd/mm/yyyy for example • Format check • Credit card numbers have the same number of digits all over the world. If a number is entered with more, or fewer digits then an error message appears. • Length check

  17. Which type of validation should we use? • A monetary value should only have numbers. Any currency symbol would be regarded as an invalid character • Invalid character or type • The computerised checkout will not function unless the checkout operator has logged in and entered their ID number. In electronic forms, you may find that certain fields are ‘required fields’ and that transactions cannot be completed until all the data has been entered • Presence check • When booking a return journey the departure data/time must be earlier than the return date/time • Consistency

  18. Verification • Verification is checking that data has been accurately copied from one medium to another. • For example, if you are entering a telephone number and you mis-type it: • Correct Telephone Number: 0541568599 • Telephone Number Entered: 0541568595 • Using validation checks, you would not see an error, since it is a valid telephone number

  19. verification • To check that data is the correct value, we use a system called data verification • Two methods: • Proof Reading (Visual Check): After the data has been entered a person compares the original data with the data in the computer (either on the screen or using a print-out) • If mistakes are spotted they can be corrected by the person

  20. Verification • Double Entry – the data is entered into the computer twice (preferably by two different people) • The computer compares the two sets of data to see if they match. If not it generates an error and a person will need to correct the mistake • Double-entry takes more time and effort, but it catches almost every mistake • A common example of double-entry verification is when you are asked to choose a new password – you are usually asked to type it in twice to make sure you’ve typed it correctly

  21. Validation and Verification • Validation will pick up errors that verification does not • Verification will pick up errors that validation does not • Verification does not check that data is correct • If original data is incorrect it will still be incorrect after it has been copied accurately • Validation does not check that data is correct • If, for example, data is incorrect but within a given range, a range check won’t reject it

  22. Range check Number must be no lower than zero/no higher than highest number/158 (Invalid) character/type check Only digits can be entered – no other characters Boolean check Data must be true or false/N or Y (Invalid) character/type check Only alphabetic characters can be entered/no digits Length check Must be exactly one character Format check Data must be two digits followed by slash followed by two digits followed by slash followed by two digits (Invalid) character/type check Only digits or slashes can be entered/no alphabetic or punctuation marks other than slash Length check Must have the same number of characters/be no more and no less than 8 characters Range check Day must be <32/Month must be less than 13/year must be <100/All must be >0/Whole date must be < today

More Related