0% found this document useful (0 votes)
12 views8 pages

Cambridge Ict Notes Ch5

Chapter 5 introduces databases, focusing on data types such as numeric, alphanumeric, date/time, and boolean data, and explains the structure of databases including fields, records, and files. It distinguishes between flat-file and relational databases, detailing how relationships between data are established through primary and foreign keys. Additionally, the chapter covers data verification and validation techniques to ensure data accuracy and integrity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

Cambridge Ict Notes Ch5

Chapter 5 introduces databases, focusing on data types such as numeric, alphanumeric, date/time, and boolean data, and explains the structure of databases including fields, records, and files. It distinguishes between flat-file and relational databases, detailing how relationships between data are established through primary and foreign keys. Additionally, the chapter covers data verification and validation techniques to ensure data accuracy and integrity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Ch.

5: Introduction to databases  
I.C.T.
 

Chapter 5
Introduction to databases

Eng. Mustafa El-Komy 51 Theory Notes


Eng.   Omar El Safty
Ch.5: Introduction to databases  
I.C.T.
 

5.1 Data types


Before we enter data into a computer system, we usually need to tell the computer
what type of data it is. This is because the computer stores and processes different
types of data in different ways.

1.  Numeric  Data    
Numeric data simply means numbers. However, numbers come in a variety of
different types.
• Integers
An integer is a whole number - it has no decimal or fractional parts. Integers can be
either positive or negative.
Examples: 12, 45, 1274, 1000000, -3, -5735.

• Real Numbers
Real numbers include whole numbers (integers) and numbers with decimal/fractional
parts. Real numbers can be positive or negative.
Examples: 1, 1.4534, 946.5, -0.0003, 3.142.

• Currency
Currency refers to real numbers that are preceded by a currency symbol.
Examples: £12.45, -£0.01, €999.00, $5500.

• Percentage
Percentage refers to fractional real numbers that are followed by a percent symbol.
So, the real value 0.5 would be shown as 50%, the value 0.01 would be shown as
1% and the number 1.25 would be shown as 125%. Inside the computer the 50% is
stored as a real number: 0.5, But when it is displayed it is shown formatted as a
percentage.
Examples: 100%, 25%, 1200%, -5%.

2.  Alphanumeric/Text  Data  
Alphanumeric (often simply called 'text') data refers to data made up of letters
(alphabet) and numbers (numeric). Usually symbols ($%^+@, etc.) and spaces are
also allowed.
Examples: DOG, "A little mouse", ABC123, [email protected].

Eng. Mustafa El-Komy 52 Theory Notes


Eng.   Omar El Safty
Ch.5: Introduction to databases  
I.C.T.
 

3.  Date/Time  Data  
Date (or time) data is usually formatted in a specific way. The format depends upon
the setup of the computer, the software in use and the user's preferences.
Date Examples: 25/10/2007, 12 Mar 2008, 10-06-08.
Time Examples: 11am, 15:00, 3:00pm, 17:05:45.

4.  Boolean/Logical  Data  
Boolean data is sometimes called 'logical1 data (or in some software, 'Yes/No' data).
Boolean data can only have two values: TRUE or FALSE.
Note that TRUE and FALSE can also be shown as YES / NO, ON / OFF, or even
graphically as tick boxes (ticked / unticked).
Examples: TRUE, FALSE, YES, NO, ON, OFF.

Selecting  Data  Types  


When we are presented with data to be input into a computer system, we must
analyze it and select appropriate data types for each value.

Student Name : Ben Smith Alphanumeric


Student Number: 1234 Numeric (integer)
Date of Birth: 10 July 1998 Numeric (Date)
Year Group: 6 Numeric (Integer)
Telephone: (0232) 744 6574 Alphanumeric
Special Diet: Yes Boolean
Exam Score: 78% Numeric (Percentage)
Height: 1.67 Numeric (Real)
Fees Paid: $ 1500 Numeric (Currency)

Note that the telephone number in the example to the left has a data type of
alphanumeric. You might think that it should be numeric, however phone numbers
often have spaces, dashes, etc. which numeric data cannot have.

5.2 Definition of Database


A database is an organized collection of data. A database program is software,
which stores and retrieves data in a structured way. This includes the data that is
stored and the links between the data items. All databases store data using a

Eng. Mustafa El-Komy 53 Theory Notes


Eng.   Omar El Safty
Ch.5: Introduction to databases  
I.C.T.
 
system of files, records and fields. The following section describes some database
terminologies.

5.3 Database terminologies


Field  
A field is an area of a record reserved for one particular type of data. Each field
contains one data item.

Record  
A record is a group of related items of data, which together can be treated as a unit.

File  
A file is an organized collection of related records

Field  name  
A field name is the title given to each field and is always present at the top row of
table.

Primary  key/Key  field  


A primary key is a field that uniquely identifies a record and may never be repeated
for more than one record.

Databases have two types: flat-file databases and relational databases.

Eng. Mustafa El-Komy 54 Theory Notes


Eng.   Omar El Safty
Ch.5: Introduction to databases  
I.C.T.
 

5.4 Database types

Flat-­‐file  databases  
A flat-file system refers to a database where all the date is held in a single table or
file. An example of a flat file database is given below.

Relational  databases  
A relational database stores data in more than one linked table, stored in a file.
Relational databases are designed so that the same data is not stored many times.
Each table within a relational database will have a primary key. Most tables will have
a primary key field that holds unique data (no two records are the same in this field)
and is the field used to identify this record.

For this example, all the data associated with the customer is held in one file and all
the data associated with each job is held in another file. In order to create a
connection between the two sets of data, a relationship must be created by using
two key fields.

Eng. Mustafa El-Komy 55 Theory Notes


Eng.   Omar El Safty
Ch.5: Introduction to databases  
I.C.T.
 

Foreign  keys  
The foreign key is the destination point of the relationship. It remains a unique
identifier as regards the customer file but it may occur more than once in the job file
because the customer may have more than one job.

As you can see, the 'Customer ID' field acts as the primary key in the customer file
and foreign key in the job file, thus enabling a relationship between the two tables.

Relationships  
A relationship is a term used with relational databases to indicate a link or
association between fields. The relationship between the tables can be:
• one-to-one
o Like the relationship between a person and their ID card. One person
has only one ID card and the ID card is associated only to one person.
• one-to-may
o Like the relationship between a father and his children. One father has
many children but each child only has one father.
• many-to-many
o Like the relationship between students and courses. One student can
take several courses and each course can be taken by several
students. Thus the relationship is many to many.

Eng. Mustafa El-Komy 56 Theory Notes


Eng.   Omar El Safty
Ch.5: Introduction to databases  
I.C.T.
 

5.5 Data Verification


Verification is a way of preventing errors when data is copied from one medium to
another. There are two common ways that verification checks are carried out:

Visual  check  
This is checking for errors by the person who is entering the data. They compare the
entered data with the original document (i.e, what is on the screen is compared to
the data on the original paper documents – note that this is not the same as
proofreading).

Double  data  entry  


In this method, data is entered twice, using two people, and is then compared (either
after data entry or during the data-entry process).

5.6 Data Validation


Validation is a process where data is checked to see if it satisfies certain criteria
when input into a computer. A number of validation techniques exist.

Validation check Description Example(s)


Range check Checks whether data is within e.g. To check if a person’s
given/acceptable values age is > 0 but is also < 150
Length check Checks if the input data e.g. If a field needs six digits
contains the required number then inputting a five-digit or
of characters seven-digit number should
cause an error message
Type check Checks that the input data e.g. A person’s age should
has the appropriate data type be numeric integer not
alphanumeric, for example
Format check Checks the data is in a e.g. A date which should be
specific format or fixed in the form of dd/mm/yyyy
pattern
Presence check Checks if data is actually e.g. In an electronic from a
present and hasn’t been person’s telephone number
missed out may be a required field so, if
no data is entered, an error
message will be produced

Eng. Mustafa El-Komy 57 Theory Notes


Eng.   Omar El Safty
Ch.5: Introduction to databases  
I.C.T.
 
Existence check Checks if data from a list has e.g. When signing up to a
been chosen and not left social networking website,
blank the country list may contain
existence check. If the user
doesn’t choose a country
from the list then an error
message will be displayed
Boolean check Checks that the input data is e.g. If a database admin
from only two options. wishes to restrict the users
to enter only ‘M’ or ‘F’ in the
Gender field, then the admin
should put Boolean check on
the Gender field that accepts
only characters ‘M’ or ‘F’
Check digit A validation check used in e.g. Validating the
barcodes to validate the correctness of a barcode
correctness of the barcode.
This is done by adding an
extra digit to the left that is
calculated from the rightmost
digits using some formula.

5.7 Testing data


Testing data is the data entered to the computer to check that the computer program
(the database in our case) will respond correctly to correct and incorrect data.
Testing data has three main categories:
Normal  data  
This is data that is acceptable/reasonable and has an expected outcome. For
example, the month can be any whole number in the range of 1 to 12.
Abnormal  data  
This is data outside the limits of acceptability, or wrong type of data, and should be
rejected or cause an error message. For example, all the following values are not
allowed as inputs for the month:
• Negative numbers.
• Any value greater than 12.
• Letters or non-numeric data.
• Non-integer values (e.g., 3.5,10.75, etc.).
Extreme  data  
This is data at the limits or acceptability. For example, the extreme values of month
can be either 1 or 12.

Eng. Mustafa El-Komy 58 Theory Notes


Eng.   Omar El Safty

You might also like