Data Type & Organisation

What is Data?data_example1

In terms of ICT, data is simply any numbersletters or symbols that can be entered into a computer system. Data is a collection of facts, such as values or measurements.Information that is either digital or analogue and can be manipulated to produce a result.”

Data can exist in many forms. For example:

  • Text (letters/words)
  • Numbers (whole numbers, decimals, currency)
  • Date

datatype

There are two main categories of data:

  • Digital DataData that is stored and manipulated on a  computer.
  • Analogue DataData which is gathered without a computer.

NOTE!

Digital data is often stored in a database. Databases allow for easy access and searching of the data.

The main types of data found in a computer system are:
  • Boolean (True/False) – sometimes also called ‘logical’
  • Text/Alphanumeric
  • Numeric (Numbers)
  • Currency (Money)
  • Percentage
  • Date/Time
txt

Boolean Data

Boolean data can only have one of two values – true or false.

Booleans are used when there are only two possible responses to a question. Examples of responses that can be stored as a boolean are:

  • True / Falseboolean_header
  • Yes / No
  • On / Off
  • Male / Female
  • 1 or 0

NOTE! Booleans can also be shown using tick boxes:

  • A tick means ON
  • No tick means OFF

For example: “Tick if you agree to the terms of the website”    tick_box

 

Text/Alphanumeric

Text Dataabc

# Text data is used for data that is made up of letters only.

 For example:- a password using the word ‘JUPITER’ would be regarded as text.

 Alphanumeric Data:

# Alphanumeric data is used for data that is made up of letters AND numbers.

 For example:- a password of ‘JUPITER123’ would be regarded as alphanumeric.

txt

Numeric (number)

data can be in two forms:- Integer and Real.123

Integer Numbers:

# Integers are made up of whole numbers (numbers without decimals).

# Integers can be both positive and negative values.

For example:- the number 123 is an integer. -123 is also an integer.

Real Numbers:real_number

# Real numbers are those that include decimals.

# Real numbers can be both positive (above zero) and negative (below zero).

For example:- the number 33.5 is a real number. -33.5 is also a real number.

numeric real

Currency Numbers

# Currency numbers are real numbers (decimals) that have been formatted to include money symbols ($, £ etc).currency_datatypes_example

 # Currency values that use decimals are usually shown to 2 decimal places.

 For example:- £19.99 is a typical use of the currency value in England.

 # Currency values can be both positive (above zero) or negative (below zero)

 

Percentage

# Percentage numbers are real numbers (decimals) that have been formatted to show values out of 100. For example:

  • 0.6 would become 60%percentage_data_type
  • 0.01 would become 1%
  • 1.8 would become 180%

 # Percentage are usually shown with the percentage symbol (%).

 # Percentage values can be positive and negative.

percentage

Date and Time Data

date-time_data_type

# Date and Time data can be shown in many different ways.

The most common ways are shown in the table below:

date

Difference Between Data & Information

Data

  • Facts, statistics used for reference or analysis.

  • Numbers, characters, symbols, images etc., which can be processed by a computer.

  • Data must be interpreted, by a human or machine, to derive meaning

  • “Data is a representation of information” *

  • Latin ‘datum’ meaning “that which is given”

  • Data plural, datum singular (M150 adopts the general use of data as singular. Not everyone agrees.)

Information

  • Knowledge derived from study, experience (by the senses), or instruction.

  • Communication of intelligence.

  • “Information is any kind of knowledge that is exchangeable amongst people, about things, facts, concepts, etc., in some context.”

  • “Information is interpreted data”

What is database?

 

Databases are designed to offer an organized mechanism for storing, managing and retrieving information. They do so through the use of tables.

 database_example

In order for a database to be truly functional, it must not only store large amounts of records well, but be accessed easily. In addition, new information and changes should also be fairly easy to input.

Lets take the example of a phone book. The phone book contains several items of information – name, address and phone number – about each phone subscriber in a particular area. Each subscriber’s information takes the same form.

 

Example of the structure of a database.data_structure_example
Databases consist of the following:
1. Files / Tables
2. Records
3. Fields
4. Data

 

 

Database Terminology

 

What is a table?

A single store of related information. A table consists of records, and each record is made up of a number of fields

Database files are viewed as tables. The medical patients database is holding its data in a table. Lets have another look at it.
The patients table is made up of 8 columns and 5 rows. Column headings are known as fields and one complete row is a full record of data

database_example

What Is a record?

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.

 

database_record_example

What is a field?

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.

Each cell of a table indicates a single field. A single field can hold one piece of data.

 Fields are given field names so we know what kind of data they hold. Field names are found at the top of each column.

 For example:- I have highlighted in green all of the field names in the patient database and in red a single field holding individual data:

database_field_example

What is a Key Field?

Keys are crucial to a table structure for many reasons, some of which are identified below:

They ensure that each record in a table is precisely identified.

They help establish and enforce various types of integrity.

They serve to establish table relationships.

Key fields are used to differentiate one record from another

For example:-  In our patients database the key field is the Patient Id. Every patient has a different Id Number. This is vital so we can identify each patient uniquely and correctly. Imagine if the doctor mixed two patients up and gave them the wrong medicine!!

 key_field_example

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.

 

What is a foreign key and what are they used for?

A foreign key is a regular field in one table which is being used as the key field in another table.

 Foreign keys are used to provide the link (relationship) between the tables.

For example:-
In our patient database, Patient Id is a key field in the Doctor Table but is also being used in the Patient Table as a foreign key:

foreign_key_example

The foreign key (Doctor Id in the patient table) can then be used to match to the primary key (Doctor Id in the doctor table) and share the correct data.                        

For example:- A patient with a Doctor Id of 01 will be automatically assigned to Doctor Hyde and Room 03.

REMEMBER!
Now that we have linked our two tables we can update our doctor information very quickly.

For example If Dr Hyde changed his room number to 02, we only need to change this information once in the doctor table. The new room would automatically be assigned to every patient who was under the care of Dr Hyde.          

Types of Database

There are two main types of computer databases:
1. Flat-File
2. Relational

FLAT-FILE

A ‘flat-file‘ database is one that only contains a single table of data

They are only suitable for very simple databases.

The patient database is an example of a flat-file as all of the information is stored in one single table:

flat-file_example

LIMITATION OF FLAT DATABASE

  • Duplicated Data is often unnecessarily      entered.
  • Database space is wasted with this duplicated data.
  • Duplicated Data takes a long time to enter and      update (unnecessarily).

RELATIONAL DATABASE

A ‘relational‘ database is one that contains two or more tables of data, connected by links called relationships.

Relational Databases do not store all the data in the same table.
Repeated data is moved into it’s own table as shown in the image below:

relational_database_example

Benefits of using a Relational Database

The advantages of using a relational database instead of a flat-file database are as follows:

  • Duplicated Data is reduced.
  • Database space is not wasted (due to unnecessary duplicated data.
  • Quicker to enter Data as there are less duplicates.
  •  Quicker to update Data

 

2 thoughts on “Data Type & Organisation”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.