GST214-Study Session 15
GST214-Study Session 15
Introduction
Data is the common name that we give to a specific element for easy identity e.g. name, sex,
address, occupation. Data generally refers to an object, a place, a portion, time, event, and so on.
Data itself has no meaning until it is processed. When data is processed it becomes information
Every organization needs to generate information for decision making from time to time. To
generate that information data must be collected, stored and processed. When data (singular =
Creating a database
Programmability of Access
1
15.1 - Database Management
A database is an organized collection of logically related data for one or more uses. It is mainly
stored in digital form for easy search and other form of accesses. Database is essentially good for
storing and managing large volume of data and data accessing in multi-user environment.
Purpose of Database
Once created and well maintained, the database becomes a precious commodity which can be
accessed by those who possess the right. The importance of databases is well known in the
Management Information Systems. The Database is often regarded as the core of Management
Information System. Other Information Systems where the use of databases is prominent are:
When the database is accessed, the data or information obtained is used to make very vital
decisions.
Types of Database
Based on structures, databases can be categorized into three broad groups as follows:
a. Hierarchical database
2
b. Network database
c. Relational database
In a hierarchical database, data is organized in a tree structure i.e. one datum is consisting of other
data, each of which consists of other data. Principally, it has a structure resembling a tree uprooted
with its root upwards and the branches pointing down thus:
R is the root. Other boxes below R are called nodes, and each node can be regarded as a child.
Each child can have more than one child, but has only one parent.
The root is linked to data elements or nodes- on a lower level, each is called a child. The higher
level node to which the child is linked is the parent. Note that in a hierarchical structure, there is
only one parent for a child, but it is possible for a parent to have more than one child.
Data that occupy contiguous or adjacent locations in storage are called physical data. They are
stored next to each other in the same proximity. Accessing them is a matter of moving from one
3
PHYSICAL
In logical data however, the data elements are not necessarily located at the same physical place,
rather they can be at different places on different devices, but there are indicators or pointers to
Logical data
Employee
Employee # Employee – Name
Salary
Salary Position
Employee History
In this arrangement, data records are related through logical entities or sets. In a network, any data
element can be connected to any other element. This allows for more flexibility than in the
hierarchical formation.
4
In the database network environment the entire database is described conceptually using a term
called "SCHEMA". The schema includes the name and definition of all files, areas, records,
element, and data set relationships. "SUBSCHEMA" is a subset or component of the schema.
While Data Definition Language (DDL) is used to define the schema, Data Manipulation
A To H are data items. Each of them can link to one another from the front or back. E for example,
has a link from the back through C; it also has a forward link to F and G.
The hierarchical and network database structures have their limitations; they define data by their
relationship to applications. However, Relational database technology separates data from the
application and uses a simplified data model. Information in the relational database is presented in
tabular form in the form of rows and columns. Columns are called domains or attributes and corre-
spond to fields. Rows, called tuples, correspond to records. Due to the relative ease of construction
and accessing relational databases, it has gained popularity in the last several years. Common
examples of relational database software packages include Oracle, Sybase, Paradox, Dbase, Access,
etc. A common feature of these mentioned packages is that they can be worked upon using
5
(i) DDL - Data Definition Language.
SQL above is used to query an existing database. Below is a typical layout for a relational database
A database is made up files. A file is a collection of records, while a record is in turn a collection
Data name
A data name typically consists of 10 characters or less, always beginning with any alphabet A-Z |
a-z, and does not contain any blank(s). It may contain a digit, but following an alphabet. It must
6
VALID INVALID
MAXI 2-DAY
ADDRESS $-DAY
XX2 2X
DEPARTMENT D EPARTMENTS
TWO-PACK 2-PACK
Field type
Most database software are sensitive to the contents of each data item. The following are the
The character field consists mainly of letters A-Z | a-z, but in certain cases, digits may be specified
such fields.
The logical field accepts only one character Y (Yes) or N (No). The memo field is a special field
where additional comment are stored in coded form and can be displayed for viewing only on
request.
The database software requires adherence to the field type rules, in addition it is necessary to state
In the database structure, the field type and the width -i.e. no of characters must be stated, for
numeric fields- the number of decimal, places if any is stated. Creating a database structure
7
therefore involves the following simple steps:
Define the fields as having character, numeric, logical, Memo or date fields
Entering data
As your enter data, the cursor moves to the next logical data item on the screen as soon as you
press the ENTER key. At the end of every record, a new record with its appropriate record number
appears prompting you to continue. In this way you enter data in as many records as you need to.
Microsoft Access 2007 is a Database Management System (DBMS) used for storing, processing
and retrieving data as well as for information presentation, automation of repetitive tasks and
managing the stored data. It assist user to create easy-to-use relational database based on the
needs of the user either for personal use or for satisfying organizational needs. Access is a very
Corporation.
8
Access as DBMS stores data in many related tables. A user can query one or more of the Access
tables with the response (or output) as forms or reports. These are called Access database objects.
They are objects for assisting user to create, edit and manage database for various applications.
In relational databases, each table contains one specific type of information. The table structure
reduces the amount of duplicate data contained within the database by ensuring that data is stored
only once through the use of the primary and foreign key fields. Hence, the integrity of the data is
There are two possible ways of getting into Microsoft Office Access 2007:
If a shortcut icon is on the windows desktop, simply double click it and Microsoft Access
will be loaded.
Under all programs highlight and click on Microsoft Office Access 2007.
By using any of the itemized ways stated above, Microsoft Office Access 2007 will be loaded and
the window displaying “Getting Started with Microsoft Office Access” opens. The window is
9
The Template Categories section on the left pane of the window for previewing
predefined templates,
New Blank Database section at the center of the window used for starting a new database,
and
Open Recent Database section on the right pane of the window used for opening an
existing database.
10
Starting a New Blank Database
With this option the user will follow instructions and create a new database. To do this:
Click on Blank Database. A window that looks like the one below will be displayed.
Enter the name of your database in the File Name field and then click Create
A new table is created with temporary name called Table 1 having a user interface window similar
to the one shown below. The Access user interface has the following features are stated in table 1.
The table opens in Datasheet View. In this view, you can add a field by typing the name of the
field in Add New Field. While Datasheet View is used for entering data, Design View, another
form of table view is used for inserting, naming, deleting fields, setting fields’ data type among
other operations.
11
B
A
F
G
The table below shows some of the features of the Access user interface window.
12
Table 1: THE ACCESS USER INTERFACE
13
THE DATABASE OBJECTS
The database objects are mainly contained in the Navigation pane categories.
QUERIES To query the database i.e. set criteria to find out particular information on a field or
fields
FORMS A user can use a pre-determined format to collect data, is similar to the normal
REPORTS A database report comes in the form of a table with headings. Facts are stated under
MACROS With macros, frequently performed functions are coded and condensed into very
short formats, when such coded formats re executed a whole lot of manually
performed instructions are executed at once, this saving time and efforts.
14
Creating a New Table in Access 2007
Activity
A new table with default name Table 1 is created in Design View. The View enables user to enter
Fields’ name, set the data type for each field, type description for each field and setting design
properties for each active field. The overall table structure is defined in this View. Datasheet View
Open already created table in Design View and perform the following tasks:
1. Type the name of the first attribute into the first field in the table (With reference to the
3. Type a description for the field (Student Matriculation Number). Press Enter
15
4. Modify the properties of the field as you desired.
6. Save the table by clicking on Save icon on the Quick Access Toolbar or click on Office
Primary key is the field or set of fields in the table that uniquely identify each record. For example,
Matriculation number can be used to uniquely identify the record of each student in a table.
Place your mouse cursor on the field to be used for uniquely determining each record, then
16
Click the Primary Key button on the Ribbon
Enter data into the data. Move from one cell to another by pressing tab key on your
keyboard
One of the most interesting features of Access is that it is programmable. After collating-the
database as previously explained, objects and entities that are defined can be used as references.
Conventional programming in high level languages such as Fortran, Cobol PUI, are procedural in
nature i.e. standard programming methods are their features Programming in Access is referred to
Objects are entities such as forms, charts, tables, and data groups that are inseparable and which
Another useful feature of Access is that it allows the user to code a series of frequently or
repetitively performed tasks into a single a command called macro. When such a routine is coded,
17
it is given name of the macro is simply used and the entire steps in the routine are executed.
Access software has such features that allow the user to easily create macros.
Click Macro
Click New
You are then required to select a/some particular action(s) you record as macro. It consists of two
columns ACTION which must, from the table, and COMMENT if any to explain the action.
Create a database
Programmability of Access
18
15.9 - Self Assessment Questions for study session 15 (SAQs)
Given below table, create a new table and save it as Student Table. Type the field names below
Surname Surname
Firstname Firstname
Sex Sex
Department Department
19