Download presentation
Presentation is loading. Please wait.
1
2.1 Data Input and Sources of Error
Can be done through: Keyboards Sensors Scanners Sound recorders Digital video cameras
2
2.1 Data Input and Sources of Error
Mistakes may be made during data entry. Three different sources of errors caused by manual input: Error Source of error Example Data source error Data source providers provide incorrect data. An interviewee reports an incorrect telephone number. Transcription error Data is read or typed in incorrectly. ‘1’ as ‘l’ or ‘o’ as ‘0’ Transposition error Two consecutive digits are swapped. Type 61 when you intend to type 16. Sources of error caused by manual input
3
2.1 Data Input and Sources of Error
Garbage-in-garbage-out (GIGO) Erroneous data always produces inaccurate information. Waste human resources while producing useless information. Steps must be taken to identify inaccurate data during the process of data input.
4
2.1 Data Input and Sources of Error
Garbage-in-garbage-out (GIGO) Garbage in Transcription error The position numbers in all exam reports are wrong. They are regarded as errors and they are garbage. Garbage out An example of garbage-in-garbage-out
5
2.1 Data Input and Sources of Error
Garbage-in-garbage-out (GIGO) Garbage in Transcription error The position numbers in all exam reports are wrong. They are regarded as errors and they are garbage. Garbage out An example of garbage-in-garbage-out
6
2.2 Data Control Data Validation Data validation Data verification
Two types of data control to reduce data errors: Data validation Data verification Data Validation The process of comparing data with a set of rules or values to make sure that the data is reasonable and valid Can detect some invalid data in the source documents
7
2.2 Data Control Data Validation Validity check Function Example
Field presence check Ensure that all necessary fields are present. The student number must be included in the student record. Field length check Ensure that the data has the correct number of characters or digits. A domestic telephone number in Hong Kong must have 8 digits. Range check Ensure that the data value is within a pre-determined range. The mark of a test should range from 0 to 100. Fixed value check Ensure that the data conforms to be one of the values in a predefined list. The gender of a student must be either ‘Male’ or ‘Female’. Format check Ensure that the form of data follows some known patterns. The address must be a combination of a user name and a domain name with the symbol in between. Different types of validity checks and their uses
8
2.2 Data Control Data Validation Validity check Function Example
Type check Ensure that the data types are correct. The students’ examination marks should be numbers but not characters, while their names should be characters but not numbers. Check digit It is used for self-checking. With numeric data, a check digit is calculated using a mathematical formula and this is then attached to the end of the number. When the check digit of the number matches the digit calculated from the number, the number is confirmed valid. Parity check is a common application of check digit in digital data transmission. The check digit of ISBN. Different types of validity checks and their uses
9
2.2 Data Control Data Verification Double data entry Input data twice
A control used to check whether the inputted data matches that in the source document Two methods commonly used for data verification: Input data twice Double data entry
10
2.2 Data Control Input Data Twice
An operator inputs the data twice and allows the computer system to check the second entry against the first one. It reports any discrepancies and the operator is required to correct the error manually. Example: When changing the password of your account, you have to re-enter the password for confirmation.
11
2.2 Data Control Input Data Twice Input data twice
12
2.2 Data Control Double Data Entry
Two operators enter the same source document into two different files. The computer compares the two files and reports any discrepancies between them. The discrepancies must be checked and corrected manually.
13
2.2 Data Control Double Data Entry Double data entry 1st operator
Check for discrepancies 2nd operator Double data entry
14
2.2 Data Control Double Data Entry Double data entry 1st operator
Check for discrepancies 2nd operator Double data entry
15
2.3 Data Hierarchy The data hierarchy of a database system can be divided into 4 levels: Field Record Table Database
16
2.3 Data Hierarchy Database Hierarchy Level Description
Example of usage Field It is the smallest unit of data that can be accessed by a user. Represent a specific fact of a record. Can be of type: numeric, text, date, Boolean, etc. Telephone number Mailing address Monthly income Marital status Record It is a collection of related fields. Contain information of one specific entity. The data in a key field can be used to uniquely identify one particular record from the others. Data hierarchy
17
2.3 Data Hierarchy Database Hierarchy Level Description
Example of usage Table It is a collection of related records with identical record structures. Contain the information of all entities stored in specific record format. All records in a table have unique and different values in key field. Database It is a collection of related tables. May link records from different tables dynamically with one or more key fields. Two tables can be linked with a key field. Data hierarchy
18
2.3 Data Hierarchy Hierarchical structure of data Database Record
Field Hierarchical structure of data
19
2.3 Data Hierarchy Hierarchical structure of data Database Record
Field Hierarchical structure of data
20
2.4 Database Management System (DBMS)
DBMS is a computer program that provides functions to: manage the database structure store, organize and retrieve data in a database Application of DBMS Example Database server MySQL, Oracle Enterprise Manager, Microsoft SQL Server Small office and personal use Microsoft Access, Microsoft Visual FoxPro, FileMaker Pro Examples of DBMS
21
Oracle Enterprise Manager
2.4 Database Management System (DBMS) MySQL Oracle Enterprise Manager Examples of database server
22
2.4 Database Management System (DBMS)
Microsoft Access Visual FoxPro Examples of DBMS for personal use
23
2.4 Database Management System (DBMS)
Basic Functions to Organize Tables Function Description Example Create table Create a new table and specify the record structure. To create a table ‘student’ with fields ‘Name’, ‘ID’ and ‘Age’: SQL command CREATE TABLE student (Name char(24), ID char(8), Age decimal(3,0)) Microsoft Access (in Design View) Basic DBMS functions for organizing a table
24
2.4 Database Management System (DBMS)
Basic Functions to Organize Tables Function Description Example Modify table Change the structure of an existing table. To remove the field ‘Age’ from table ‘student’: SQL command ALTER TABLE student DROP Age Microsoft Access (in Design View) Basic DBMS functions for organizing a table
25
2.4 Database Management System (DBMS)
Basic Functions to Organize Tables Function Description Example Delete table Remove a table from a database. All records in the table will also be deleted permanently. To remove table ‘student’: SQL command DROP TABLE student Basic DBMS functions for organizing a table
26
2.4 Database Management System (DBMS)
Basic Functions to Manage Records in a Table Function Description Example Add a new record Create a new record. Users are subsequently able to input information into it. To add a new record: SQL command INSERT TABLE student VALUES ("Ada Lee", "92001", 15) Visual FoxPro APPEND Basic DBMS functions for manipulating table records
27
2.4 Database Management System (DBMS)
Basic Functions to Manage Records in a Table Function Description Example Delete existing records Remove unwanted records from a table. Users can issue a delete command with a condition statement such that all records matching the condition will be deleted at one time. To delete all records of students who are younger than 14-year old: SQL command DELETE FROM TABLE student WHERE Age < 14 Visual FoxPro USE student DELETE FOR Age < 14 Note: All the matched records are marked for deletion They will be removed permanently by issuing the command PACK. Basic DBMS functions for manipulating table records
28
2.4 Database Management System (DBMS)
Basic Functions to Manage Records in a Table Function Description Example Modify existing records Change the field values of selected records. Users can issue an update command with a condition statement such that all records matching the condition will be changed at one time. To add 1 to all records in the ‘Age’ column for students whose age are 16 or above: SQL command UPDATE TABLE student SET Age = Age + 1 WHERE Age >= 16 Visual FoxPro REPLACE Age WITH Age + 1 FOR Age >= 16 Basic DBMS functions for manipulating table records
29
2.4 Database Management System (DBMS)
Basic Functions to Manage Records in a Table Function Description Example Browse records Display all or part of records of a table in a window. Users may also be allowed to add, modify or delete records in the browse window. To display all records in a browse window. Microsoft Access Visual FoxPro USE student BROWSE Double-click to open a browse window for the table ‘student’. Basic DBMS functions for manipulating table records
30
2.4 Database Management System (DBMS)
Essential Features for Database Management Provides features to: facilitate the data input in data entry forms display results in query forms and generate reports Filter Allows users to specify a filtering condition Only the records that satisfy the condition are accessible in the database table. The unmatched records are hidden temporarily until the filter constraint is released.
31
2.4 Database Management System (DBMS)
Essential Features for Database Management Filter Define a filter (e.g. logon is equal to "Y") on a table. Table containing all records Filtering records from a table
32
2.4 Database Management System (DBMS)
Essential Features for Database Management Filter Table shows records that satisfy the filtering condition. Filtering records from a table
33
2.4 Database Management System (DBMS)
Essential Features for Database Management Sort Change the order of records according to the value of one or more fields in a table. The sorted records are usually saved in a new table. Visual FoxPro command: Sort to sortedlist on fullname ascending Unsorted records in the table ‘Userlist’ Records are sorted by ‘Fullname’ and are stored in a new table ‘Sortedlist’. Sorting records in a table
34
2.4 Database Management System (DBMS)
Essential Features for Database Management Sort Allows records to be rearranged in a specific order permanently A slow process if the number of records is large Index A small file containing a number of index keys. The index keys are created and arranged according to the index expression. One index file refers to one instance of a specific table only. An index file must be re-indexed when values of the field involved in the index expression have been changed. The index files are usually small relative to the referred table. They can be loaded into the main memory for speeding up the access process.
35
2.4 Database Management System (DBMS)
Essential Features for Database Management Index Create an index file: Index on Fullname to user_index ascending Unsorted records in the table ‘Userlist’ Fullname Rec. No. Joyce Wong 2 Ko Ko Lo 4 Mark White 3 Ricky Mok 1 Records are accessed according to the order specified the index file. A Visual FoxPro example showing how to access records by using an index file
36
2.4 Database Management System (DBMS)
Essential Features for Database Management Index Stop using the index file: Set index to Records are accessed in the original order as stored in the table ‘Userlist’. A Visual FoxPro example showing how to access records by using an index file
37
2.4 Database Management System (DBMS)
Essential Features for Database Management Data Entry Forms Can be treated as the interfaces for adding or modifying records Advantages: Provide a user-friendly environment for data entry Perform data validation such as range check and type check of test marks Perform data verification such as double data entry of renewal password Simplify data entry with features like pull down menu, check box and list box Modify related records from two or more tables in one form
38
2.4 Database Management System (DBMS)
Essential Features for Database Management Data Entry Forms Data entry form of Microsoft Access
39
2.4 Database Management System (DBMS)
Essential Features for Database Management Query Forms Provide an interface for users to extract and display records which match the specified conditions The extracted data can further be modified, deleted or stored in a new table. Display selected records in query window temporarily. Define queries with selection criteria in the Design View. Extracting data by using query form
40
2.4 Database Management System (DBMS)
Essential Features for Database Management Query Forms Advantages: Can be stored and are reusable Able to show data from two or more tables Able to display calculated results using the extracted records Writing commands in Structured Query Language (SQL) is another way to enquire about results from a database. SELECT bookname, type, price FROM book WHERE ((type = 'IT') or (type = 'ENG'))
41
2.4 Database Management System (DBMS)
Essential Features for Database Management Reports Used to display results on the computer screen or produce hard copies with a printer in the defined format Advantages: Can be stored and are reusable Able to display data and calculated results from two or more tables. Able to print results in specified locations, styles and formats accurately
42
2.4 Database Management System (DBMS)
Essential Features for Database Management Reports Click the ‘Report’ button. Creating a report in Microsoft Access
43
2.4 Database Management System (DBMS)
Essential Features for Database Management Reports Click the ‘Report’ button. Creating a report in Microsoft Access
44
2.5 File Access Modes The access mode used to access database records depends on which media the database resides in. Sequential access mode Hard disk Optical disk Floppy disk Direct access mode Magnetic tape
45
2.5 File Access Modes Using magnetic tapes to back up data in a large organization Using hard disks in a server room
46
2.5 File Access Modes Sequential Access Mode Magnetic tape
Data records are stored one by one along the lengthy magnetic strip. Need to be rewound forward or backward until the desired record is just underneath the read/write head before the reading or writing operation can proceed The seek time is long and unpredictable when records are retrieved randomly. Not a common medium for storing frequently used data records Mainly used for backing up and recovering of database and data files in computer servers
47
2.5 File Access Modes Direct Access Mode Hard disk
The most common storage medium for secondary storage due to its high reliability, speed and capacity. During read/write operations, the magnetic disk plate (platter) rotates and the read/write head moves across the platter surface at the same time to the location containing the data. Once the target location is moved under the read/write head, the read/write operations can proceed. The seek time is much shorter and predictable, ranging from 8 ms to 20 ms. The most essential secondary storage device for a computer system
48
2.5 File Access Modes Direct Access Mode Hard disk
Read / write head moves across platter surface to the right track and waits for the arrival of target data. Target data Platter surface rotates to move the data to the read / write head. The working mechanism of a hard disk
49
2.5 File Access Modes Direct Access Mode Other examples:
Floppy disks DVD-RAM CD-RW They are limited in capacity and speed of data access. They are rarely used as the storage media for database systems and frequently used data files.
50
2.5 File Access Modes Direct Access Mode Other examples:
Floppy disks DVD-RAM CD-RW They are limited in capacity and speed of data access. They are rarely used as the storage media for database systems and frequently used data files.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.