Data Types Unit-5 IGCSE ICT


Published on

Published in: Education
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Data Types Unit-5 IGCSE ICT

  1. 1. Data Types<br />
  2. 2. Data is processed by computers, the resulting information can then be used to make decisions. <br />MANOJ KUMAR CVSLONAVALA<br />2<br />
  3. 3. Data<br /> Data is words, numbers, dates, images, sounds etc without context i.e. Data consists of raw facts and figures.<br /> This is a list of data items:<br /><ul><li>42
  4. 4. rabbits
  5. 5. 16:00
  6. 6. 76
  7. 7. apples
  8. 8. 09743245530
  9. 9. $40
  10. 10. Seaside</li></ul> Data items need to be part of a structure, such as a sentence, in order to give them meaning.<br />MANOJ KUMAR CVSLONAVALA<br />3<br />
  11. 11. Information<br /> Information is a collection of words, numbers, dates, images, sounds etc put into context, ie to give them meaning.<br /> For example, take these data items from the previous page:<br /><ul><li>42
  12. 12. rabbits
  13. 13. 16:00
  14. 14. 76
  15. 15. apples
  16. 16. 09743245530
  17. 17. £40
  18. 18. seaside</li></ul>When used to form part of a sentence they gain meaning:<br />There are 42 apples in that box and each one of them has been nibbled by rabbits.<br />The fare to the seaside is £40 and the journey takes 76 minutes by rail.<br />My telephone number is 09743245530. Call me at 16:00.<br />This is information - data put into context.<br /> Information can then be used to produce knowledge, by applying rules to it.<br />MANOJ KUMAR CVSLONAVALA<br />4<br />
  19. 19. Data Types<br />Data can be stored in many formats called ‘data types’. When setting up a database or spreadsheet, it is important that the correct data type is selected for each field. This is because the data type will determine what can be done with the data held in that field e.g. sorting, searching, calculations etc. Data can be of different types –<br />Text (alphanumeric)- A text data type can hold any letter, number, symbol or punctuation mark. It is sometimes referred to as 'alphanumeric' or 'string'. The data can be pure text or a combination of text, numbers and symbols. <br />Decimal (real numbers)- Your numerical data might need to be formatted with decimal places. This means it cannot be stored as an integer number. Instead it is known as a 'real' number. You can specify the number of decimal places that you need. <br />Integers- An integer stores whole numbers, either positive or negative. Integers however cannot store numbers with decimal places. <br />Currency- When you choose to format numerical data as currency then it will automatically be given two decimal places. The currency data type also allows you to display the correct currency symbol such as £ or $.<br />Dates 12/03/02 <br />Calculated an average of exam marks. <br />Pictures<br />Sounds Boo! <br />Moving graphics / Video Clips<br />MANOJ KUMAR CVSLONAVALA<br />5<br />
  20. 20. File structure<br /> A database consists of a number of related files (sometimes called tables). <br /> A file consists of a number of related records.<br /> A record consists of a number of related fields.<br /> A field is a single data item consisting of a number of characters.<br />MANOJ KUMAR CVSLONAVALA<br />6<br />Character<br />Field<br />Record<br />File<br />Database<br />
  21. 21. Database<br />A database is a collection of data that you want to manage, rearrange, and add to later. It is a good program to use to manage lists that are not entirely numbers, such as addresses and phone numbers, inventories, and membership rosters. With a database you could sort the data by name or city or postal code or by any individual item of information recorded. You can create forms to enter or update or just display the data. You can create reports that show just the data you are interested in, like members who owe dues.<br /> Both spreadsheets and databases can be used to handle much the same information, but each is optimized to handle a different type most efficiently. The larger the number of records, the more important the differences are.<br /> Examples of databases: MS Access, dBase, FoxPro, Paradox, Approach, Oracle, Open Office Base.<br /> Purpose: Managing data  <br /> Major Advantages:Can change way data is sorted and displayed<br />MANOJ KUMAR CVSLONAVALA<br />7<br />
  22. 22. Features/Terms:<br />A flat database contains files which contain records which contain fields.<br />MANOJ KUMAR CVSLONAVALA<br />8<br />
  23. 23. A relational database contains tables which are linked together. Each table contains records which contain fields.A query can filter your records to show just the ones that meet certain criteria or to arrange them in a particular order.<br />MANOJ KUMAR CVSLONAVALA<br />9<br />
  24. 24. Types of databases<br /> Flat database:<br /> The earliest and simplest databases are flat databases.  A flat database may still be all you need for your purpose. <br />Advantages:<br />Easy to set up<br />Easy to understand<br />Disadvantages:    <br />May require entering the same information in many records.<br />A text database is hard to read.<br />A single record in a spreadsheet database may not fit across the screen.<br /> A text database is a plain text file where the fields are separated by a particular character like a vertical bar | or a comma , or a semi-colon ; . The example below puts a vertical bar between each field. The first record shows the names of the fields.<br /> A text database is hard to read in this raw form. A database program can show each record separately in a more readable display. It is hard to create a report that contains just the parts you want to see.<br /> A spreadsheet can work as a flat database. Each field is in a separate column and each row is a single record.  You cannot use two rows for one record.<br />MANOJ KUMAR CVSLONAVALA<br />A 'flat-file' database is one that only contains a single table of data. <br />All of the data in the database is stored in this one place. <br />
  25. 25. Types of databases<br /> Relational database:<br /> Microsoft Access and Oracle and other relational databases are more advanced and more efficient. This kind of database uses a set of tables which are linked together. Using a well-designed relational database can greatly reduce the amount of data you must enter each time you add a record. For large numbers of records, a relational database can search through the records faster. A 'relational' database is one that contains two or more tables of data, connected by links called relationships. <br /> Advantages:<br />Reduces the duplication in data entry.<br />Faster searches.<br />Can create forms and reports that display only the data you want to see.<br />Can create queries to answer questions that are hard or impossible to answer in flat databases.<br /> Disadvantages:<br />Can be complex to set up, using many tables.<br />It is harder to understand how all the parts relate to each other.<br />MANOJ KUMAR CVSLONAVALA<br />11<br />
  26. 26. Below is an illustration of the tables in a small database that records information about insurance agents and policy holders. This particular insurance office works with several different insurance companies. There are 7 tables in the database. The lines show which fields in each table are the same. These link the tables together.<br />MANOJ KUMAR CVSLONAVALA<br />12<br />
  27. 27. Each agent can be licensed with several different companies and in several different states. In a flat database you would have to have a record for each agent for every company and state he is licensed with, repeating the agent info for each record. If the agent moved to a new house, you would have many records to update with his new address.  Argh! Too much typing!! With a relational database, there will be only one place to update. <br /> You can design a form so that you can do this all in one spot! This is much easier than repeating so much information for each record as you would do in a flat database. <br />MANOJ KUMAR CVSLONAVALA<br />13<br />
  28. 28. Analogue Signals and Digital Data<br />An analogue signal is one which has a value that varies smoothly. It is easiest to understand this by looking at an example:The sound waves that your mouth produces when you speak are analogue - the waves vary in a smooth way. These waves can be converted into an electrical signal by a microphone. This electrical signal is also analogue:<br />MANOJ KUMAR CVSLONAVALA<br />14<br />All numbers stored inside a computer are stored using a system called binary. Binary only uses 0s and 1s for all numbers.<br />
  29. 29. Analogue Signals and Digital Data<br />Computers (and most other modern electronic devices such as cameras, mobile phones, etc.) are ‘digital’ devices because they process data in the form of numbers (digits).<br />Computer software is a collection of numeric codes which tell the computer what to do<br />Text that you type into a computer is stored as numeric codes<br />Images inside a computer are stored as numeric values (different values for different coloured pixels)<br />MANOJ KUMAR CVSLONAVALA<br />15<br />Everything stored and processed inside a computer is a number (digital).Computers are unable to process analogues signals because they are digital devices. For digital devices such as computers, to work with analogue devices, conversion is required... <br />
  30. 30. Analogue Signals and Digital Data<br />Analogue to Digital Convertor (ADC)<br /> If you want to attach an analogue input device to a digital device such as a computer, you will need an analogue to digital convertor (ADC). A good example of a computer peripheral that requires an ADC is a microphone. When you plug a microphone into a computer, you are actually plugging it into an ADC which converts the analogue signals from the microphone into digital data that the computer can then process. <br />MANOJ KUMAR CVSLONAVALA<br />16<br />
  31. 31. Analogue Signals and Digital Data<br />Digital to Analogue Convetor<br /> If you want to attach an analogue output device to a digital device such as a computer, you will need a digital to analogue convertor (DAC).<br />A good example of a computer peripheral that requires a DAC is a loudspeaker or headphones. When you plug a loudspeaker into a computer, you are actually plugging it into a DAC, which takes digital data from the computer and converts it into analogue signals which the loudspeaker then converts into sound.<br /> Another device that contains a DAC is an MP3 player. The music data stored in the player is all digital, but the player produces analogue signals which the headphones convert into sound.<br />MANOJ KUMAR CVSLONAVALA<br />17<br />
  32. 32. Question-1<br />A hospital uses computers to monitor the health of patients.<br /> Explain why analogue to digital conversion is needed when computers are used in monitoring and measuring. <br />Sensors (read analogue data) are used to generate data. Data are then sent to computer. Computers work with digital data only. Data needs to be converted so computers can process/understand data <br />MANOJ KUMAR CVSLONAVALA<br />18<br />
  33. 33. Database Terminology<br />What is a table?<br /> A single store of related information. A table consists of records, and each record is made up of a number of fields.<br />What is a record?<br /> A table consists of records, and each record is made up of a number of fields. A record contains all the information about a single 'member' of a table. In a students table, each student's details (name, date of birth, contact details, and so on) will be contained in its own record.<br />What is a field?<br /> Fields describe a single aspect of each member of a table. A student record, for instance, might contains a last name field, a first name field, a date of birth field and so on.<br />MANOJ KUMAR CVSLONAVALA<br />19<br />
  34. 34. Database Terminology<br />What is a Key Field?<br />Keys are crucial to a table structure for many reasons, some of which are identified below:<br />They ensure that each record in a table is precisely identified.<br />They help establish and enforce various types of integrity.<br />They serve to establish table relationships.<br />Primary key will uniquely identify each record. It may or may not provide information about the record it identifies. It must not be Null-able, that is if it exists in a record it cannot have the value Null. It must be unique. It cannot be changed.<br />MANOJ KUMAR CVSLONAVALA<br />20<br />
  35. 35. Question-2<br />MANOJ KUMAR CVSLONAVALA<br />21<br />Answer:<br />Numeric (Integer)<br />Alphanumeric<br />Boolean<br />Date<br />
  36. 36. Question-3<br />MANOJ KUMAR CVSLONAVALA<br />22<br />
  37. 37. How many records are there in the book file?<br />4 <br />How many fields are there in the borrower file?<br />5<br />What type of database do these two files form?<br />Relational database<br />Give reasons why this type of database system is used rather than having two flat files. <br />Data does not have to be typed in twice [referential integrity]. <br />So Quicker to enter new data. <br />So fewer errors are likely. <br />So less memory/storage capacity is used. <br />So it is easier to edit data.<br />MANOJ KUMAR CVSLONAVALA<br />23<br />Referential integrity is a database concept that ensures that relationships between tables remain consistent. When one table has a foreign key to another table, the concept of referential integrity states that you may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table.<br />
  38. 38. Which field is the primary key in the Book file?<br />Code <br />Which field is the foreign key?<br />Book Borrowed<br />Which field has the data type currency? <br />Cost <br />What data type would be most appropriate for the Due Back field?<br />Date<br />Name the most appropriate validation check for the Number in stock field.<br />Range check<br />Name the most appropriate validation check for the Form field. <br />Format<br />Picture<br />Input mask<br />MANOJ KUMAR CVSLONAVALA<br />24<br />Foreign keys are used to create relationships between tables. A foreign key is a field in a relational table that matches the primary key column of another table. The foreign key can be used to cross-reference tables.<br />
  39. 39. Data Processing<br />The most common data processing activity is data maintenance.<br />Data maintenance is the periodic processing of transactions to update stored data.<br />Data Processing refers to a class of programs that organize and manipulate data, usually large amounts of numeric data.<br />25<br />MANOJ KUMAR CVSLONAVALA<br />
  40. 40. Data Processing<br />Additions insert new records into a master file.<br />Deletions remove records from a master file.<br />Updates revise current balances in master files.<br />Changes modify the data values of other fields in master files.<br /> Two basic types of files are used to store data.<br />The master file, which is conceptually similar to a ledger in a manual system.<br />The transaction file, which is conceptually similar to a journal in a manual system.<br />26<br />MANOJ KUMAR CVSLONAVALA<br />
  41. 41. Batch Processing<br />Batch processing is updating master files periodically to reflect all transactions that occurred during a given time period.<br />The master file is updated at set times or whenever a manageable number of transactions are gathered.<br />Transaction data can either be entered as a batch or as each transaction occurs.<br />Producing Monthly Payrolls, Producing Gas Bills, Producing utility bills, Inputting details of new stock into a library’s database, Reading data from bank cheques and Scanning OMR Sheets are the examples of Batch Processing.<br />27<br />MANOJ KUMAR CVSLONAVALA<br />
  42. 42. Group source documents into batches.<br />Master<br />file<br />Batch Processing<br />28<br />MANOJ KUMAR CVSLONAVALA<br />
  43. 43. On-line Batch Processing<br />Enter transactions into system as they occur.<br />Master<br />file<br />29<br />MANOJ KUMAR CVSLONAVALA<br />
  44. 44. On-line, Real-Time Processing<br />In on-line, real-time processing, the computer captures data electronically,...<br />edits it for accuracy and completeness, and...<br />immediately processes it.<br />The computer also processes information requests from users.<br />30<br />MANOJ KUMAR CVSLONAVALA<br />
  45. 45. On-line, Real-Time Processing<br />Enter transactions into system as they occur.<br />Master<br />file<br />31<br />MANOJ KUMAR CVSLONAVALA<br />
  46. 46. Advantages of Each Method<br />The main advantage of batch processing was efficiency in processing.<br />On-line data entry is more accurate than periodic batch input because the system can refuse incomplete of erroneous entries.<br />Real-time processing ensures that the information in master files is always current.<br />32<br />MANOJ KUMAR CVSLONAVALA<br />