2. Database :-is collection of data or information that is organized so that it
can be easily accessed managed and updated.
example : clients ,students record, Products
IMPORTANT OF DATABASE
Data base is important because:-
i. It manage data efficiently and allow users to perform multiple tasks
with ease.
ii. Store ,organize and manage a large amount of information within a
single software application.
iii. Increase efficiency of business operations and reduce overall coats.
iv. Handle multiple types of data.
v. Data can be categorized and structured to suit the needs of the
company or organization.
vi. Multiple users can use the information at the same time in different
ways.
+225 716236593 || alphoncesteven@gmail.com
3. Database application:-
is a computer program whose primary purpose is
entering and retrieving information from a
computerized database.
Example
ADABAS
IBM DB2
Microsoft Access
Microsoft SQL Server
MySQL
Oracle RDBMS
Quick Base …….etc..
+225 716236593 || alphoncesteven@gmail.com
4. MICROSOFT ACCESS
what is Microsoft Access?
Is a database management system (DBMS) from
Microsoft that combines the relational Microsoft jet
database engine with graphical user interface and
software development tool.
What is relational database management system?
Is a collection of data items organized as a set of formally
described table from which data can be accessed or
resembled in many different ways without having to
recognize the database table
RDBMs was developed by Edger F. Codde in 1970.
+225 716236593 || alphoncesteven@gmail.com
5. Relational Database: in relational databases such as
Access, data is stored in tables made up of one or
more fields (Access calls a column a field).
The data stored in each column must be of a single
data type such as Character, Number or Date.
Collection of values from each column of a table is
called a record or a row in the table.
Different tables can have the same column in
common. This feature is used to explicitly specify a
relationship between two tables. Values appearing in
column A in one table are shared with another table.
+225 716236593 || alphoncesteven@gmail.com
6. Key terms to understand in ms-access
Table: tables are the main units of data storage in a database. A
table is a collection of data about a specific topic, it is made up of
one of more fields.
Field: a field is a column in a table and defines a data type for a
set of values in a table. For example, a mailing list table might
include fields for first name, last name, address, city, state,
zip code, and telephone number.
Record: a record is a row in a table and is a set of values defined
by fields. In a mailing list table, each record would contain the
data for one person as specified by the intersecting fields.
Data type: data types are the properties of each field. A field
only has one data type, such as Character, Number or Date.
Primary Key: a primary key is a value that can be used to
identify a unique record in a table.
Design View: it provides the tools for creating fields in a table.
Datasheet View: it allows you to update, edit, and delete
information from a table.
+225 716236593 || alphoncesteven@gmail.com
7. DIFFERENT AND SIMILARITIES BETWEEN MS-ACCESS AND MS-EXCEL
Access databases and Excel spreadsheets although originally very different, have
evolved to have similar functions. Although either type of program can do many,
but not all, of the things that the other one does, there are some things which are
easier in one program than the other.
Excel
Excel is not database management systems.
Excel spreadsheets store data in rows and columns called worksheets.
The areas within the worksheet where the rows and columns intersect are called
cells.
The most common use of spreadsheets is to manage basic information such as
telephone numbers, employee names, financial data, calculations, etc.
Access
Access stores data in tables that look similar to worksheets but function quite
differently.
Tables, the foundation of all relational databases function both independently
and interdependently with other tables to allow the database user to combine data
from multiple sources and analyze and/or report information in almost limitless
ways
+225 716236593 || alphoncesteven@gmail.com
8. Starting access and opening a
database.
Click start button and pointing to programs in the start
menu
Choose Microsoft office ,and then click Microsoft access
2003
When first opened ,the access main window display getting
started task pane offering you a choice of accessing
Microsoft office online, opening one of the existing
database files, or creating a new file, as shown in figure 1.
The opened panel contains the names for recently opened
databases. The access opening window is where your
session with access begins.
+225 716236593 || alphoncesteven@gmail.com
9. Figure 1: the access opening window with the getting started pane
+225 716236593 || alphoncesteven@gmail.com
10. Microsoft access interface
The access window shows title bar, a menu bar, and
toolbar.
The title bar contains buttons you can use to
manipulate the window.
Control menu
Status bar
Getting started pane
Resize handle
Minimize button
Maximize button
Close
button
+225 716236593 || alphoncesteven@gmail.com
11. Close button- Closes the program
Maximize button-Appears only when window is less
than maximum size and enlarges the window to fit the
screen.
Restore button –Replace the maximize button when
the window is maximized and returns the window to
its previous reduced size.
Minimize button-reduces the window to an icon on
the window taskbar.
NB : when the window is less than maximum size, you can move it to new
position by dragging it title bar. You can change it height and width by
dragging either its border or resize handle on the lower right-corner
when you see the three diagonal lines.
+225 716236593 || alphoncesteven@gmail.com
12. File menu – is a menu button that offers option to
create a new database, to open an existing one, or to
search for a specific file.
Toolbar –offer shortcuts to many of commonly used
menu commands
Status bar- located at the bottom of the access
window, provide running commentary about on going
tasks and the access working environment.
+225 716236593 || alphoncesteven@gmail.com
13. Steps to start and open Database
1. Click on the START button on your computer and
position your cursor over the PROGRAMS menu to
view a list of installed programs. Once you see the list,
position the cursor over Microsoft Office and then
click on Microsoft Access.
2. After opening Access, you will be presented with the
welcome and get started window.
+225 716236593 || alphoncesteven@gmail.com
15. 3. If you want to edit an existing database, you can either
go to File then click Open, or move your cursor to the
lower right-hand side to click on Open.
4. If you are creating a new database, you can also either
go to File then click New, or move your cursor to the
lower right-hand side to click on Create a new file.
You will be presented with five options on the right
side menu.
+225 716236593 || alphoncesteven@gmail.com
16. Five options of creating Database
+225 716236593 || alphoncesteven@gmail.com
17. 5. Unlike Word documents,
Excel spreadsheets, and
Power Point presentations,
you must save an Access
database before you start
working on it. After
selecting "Blank database",
you will first be prompted
to specify a location and
name for the database. In
the New Database dialog
box, type in a name for
the database and specify a
location and click on
Create.
+225 716236593 || alphoncesteven@gmail.com
18. 6.Now a new database is created ( as shown on the figure
below)
+225 716236593 || alphoncesteven@gmail.com
19. Database Components
An Access database consists of several different components. Each component listed is called
an object.
Listed below are the names and descriptions of the different objects you can use in Access.
This tutorial will focus on the first two objects: tables and queries.
Tables -Tables are where the actual data is defined and entered. Tables consist of Records
(rows) and fields (columns).
Queries -Queries are basically questions about the data in a database. A query consists of
specifications indicating which fields, records, and summaries you want to see from a
database. Queries allow you to extract data based on the criteria you define.
Forms -Forms are designed to ease the data entry process. For example, you can create a data
entry form that looks exactly like a paper form. People generally prefer to enter data into a
well designed form, rather than a table.
Reports -When you want to print records from your database, design a report. Access even
has a wizard to help produce mailing labels.
+225 716236593 || alphoncesteven@gmail.com
20. Database Components
Pages -A data access page is a special type of Web page
designed for viewing and working with data from the
Internet or an intranet. This data is stored in a Microsoft
Access database or a Microsoft SQL Server database.
Macros -A macro is a set of one or more actions that each
performs a particular operation, such as opening a form or
printing a report. Macros can help you automate common
tasks. For example, you can run a macro that prints a report
when a user clicks a command button.
Modules - A module is a collection of Visual Basic for
Applications declarations and procedures that are stored
together as a unit.
+225 716236593 || alphoncesteven@gmail.com
21. Creating Table
From Database window you will see three options
for creating tables:
1. Create table in Design view -If you choose this
option, you can name your fields, assign data type
for each field, and format your fields.
2. Create table by using wizard - Choosing this
option allows you to create a table by following
instructions in the Table Wizard dialog boxes.
3. Create table by entering data - If you decide to
use the Create table by entering data option, you
can enter data first, and then do all the formatting.
+225 716236593 || alphoncesteven@gmail.com
23. Creating table using wizard
#Steps
1. Select Tables from the Objects bar.
2. Double-click the Create table by using wizard
option. You will see the Table Wizard dialog box
+225 716236593 || alphoncesteven@gmail.com
24. Creating table using wizard….cont.
3. In the Table Wizard dialog box select your table
category, Business or Personal, by clicking one of
the radio buttons.
4. Choose the purpose of your database under Sample
Tables by clicking on one of the items in the list. You
will see that Sample Fields change or each sample
table.
5. Choose content fields for your database from the list
under Sample Fields To do this, double-click the
desired filed. You will see it appear in the Fields in my
new table list box
+225 716236593 || alphoncesteven@gmail.com
25. Creating table using wizard….cont.
6. Once you have selected all the fields for your table,
click Next.
7. The next step will ask you to name your table and set a
Primary Key. Type in the name for your table (do not
use spaces or special characters). Then, choose No, I’ll
set the primary key . Then Click Next.
+225 716236593 || alphoncesteven@gmail.com
26. Creating table using wizard….cont.
Type
database
Name here
Click here to continue+225 716236593 || alphoncesteven@gmail.com
27. Creating table using wizard….cont.
8. In the next dialog box, choose Numbers I enter
when I add new records. Click Next.
9. In the next dialog box, select Enter data directly into
the table. Click Finish. You will see your table in a
new window
+225 716236593 || alphoncesteven@gmail.com
28. Entering Data Start entering your data into the table by typing in the cells. To delete typing
mistakes, use the BACKSPACE key. To delete changes in the current field,
hit the ESC key.
NOTE: Only the latest changes will be deleted.
To move between cells or between records, use arrow keys or the Tab key.
To add a new record, click New Record in the toolbar.
NOTE: You cannot add records if your cursor is on the blank record.
To edit data in a field, click in that field and type in the new data.
To replace the entire value in the field, move the pointer to the left
corner of the field until it changes into the plus sign, and click.
Type in new data. Microsoft Access saves your data when you move
to another record.
New Record
+225 716236593 || alphoncesteven@gmail.com
29. Designing view
Once you have created a table you can format it in
Design View. Click on the Design
View button in the toolbar
Designing view Button
+225 716236593 || alphoncesteven@gmail.com
30. SETTING PRIMARY KEY
The Primary Key, which is assigned to one of the
fields, is a unique identifier of each record in a table.
#steps to set primary key
1. Select the field you want to be the Primary Key for
your table. This is usually a number, for example a
student ID, a product serial number, etc.
2. Click the Primary Key button in the toolbar. This is
now the unique identifier of the record.
Primary key
+225 716236593 || alphoncesteven@gmail.com
31. INSERTING COLUMNS
If you need to insert a column into your table, i.e. if
you need to add a field, you can do it from Design
View.
1. Click the Design View button ; in the table grid you
will see extra fields.
2. Type in a title in a blank field
Blank field
+225 716236593 || alphoncesteven@gmail.com
32. INSERTING COLUMNS………cont.
3. Click on the Data Sheet View button. You will see a
dialog box asking you to save the changes. Click OK.
4. Scroll all the way to the right to see the new column in
your table.
NOTE: You don’t need to insert rows; Access does
that automatically when you enter data.
+225 716236593 || alphoncesteven@gmail.com
33. FORMATTING DATA TYPE
In Design View you can also define the data type
for each of the fields. For example, if you have a
field that contains dollar values, you can define the
data type for this field as Currency. The field will
display the dollar sign and two decimal points.
+225 716236593 || alphoncesteven@gmail.com
34. FORMATTING DATA TYPE…cont
To format the data type in Design View, follow these
#steps
1. Click in the cell next to the field you wish to format the
data type for in Data Type column.
2. Choose the desired type from the dropdown menu
Select data type
here..
+225 716236593 || alphoncesteven@gmail.com
35. FORMATTING DATA TYPE…cont
3. Click on the Data Sheet View button. You will see a
dialog box asking you to save the changes. Click OK.
4. Type in the data in the field; you will see how the
formatting is applied.
+225 716236593 || alphoncesteven@gmail.com
36. Relationships.
A relational database allows the simultaneous use of
data from more than one table and the control on
data.
Advantages of Relationship in Access
1. Distributing data among individual tables (Flat –File)
2. Reduce data redundancy
3. Reduces required disk space
4. Speed the data processing process
5. Makes easy to locate and manage data in database.
+225 716236593 || alphoncesteven@gmail.com
37. Types of relationships
1.One-to-one relationship
In a one-to-one relationship, one record in a table is
associated with one and only one record in another table.
For example, in a school database, each student has only
one student ID, and each student ID is assigned to only one
person.
A one-to-one relationship looks like this in
the relationships graph:
+225 716236593 || alphoncesteven@gmail.com
38. 2.In a one-to-many
In a one-to-many relationship, one record in
a table can be associated with one or more records in
another table. For example, each customer can have
many sales orders.
A one-to-many relationship looks like this in
the relationships graph:
+225 716236593 || alphoncesteven@gmail.com
39. 3.Many-to-many relationships
A many-to-many relationship occurs when
multiple records in a table are associated with
multiple records in another table. For example, a
many-to-many relationship exists between customers
and products: customers can purchase various
products, and products can be purchased by many
customers.
+225 716236593 || alphoncesteven@gmail.com
40. Referential Integrity
Referential integrity – is an optional system of rules that
guarantees the relationship are valid and the database will
remain intact as data is entered, edited. Pr deleted.
Basic rules of referential integrity
1. For every record in a child table one and only matching
record must be in parent table.
2. You cannot enter child record for which no parent exists.
3. You can not delete a parent record if related child record
still exist.
4. You can not change a child record so its foreign key
doesn’t have match in parent table
5. You can not change the primary key value in a parent
table as long as related records are in the child table.
+225 716236593 || alphoncesteven@gmail.com
41. Before you set referential integrity , you
must make sure you meet the following
1. The matching field in parent table is the primary key
or at least has a unique value, such as an auto
number field.
2. Related field are the same data type
3. Both tables are in the same access database.
+225 716236593 || alphoncesteven@gmail.com
42. +225 716236593 || alphoncesteven@gmail.com
Data Types
Data type – are the properties of each field. a field only
has one data type, such as character, number or Date.
Some of most common data types you will find used
in typical Microsoft Access database are :-
43. +225 716236593 || alphoncesteven@gmail.com
Data Type Description Size
Short text Text or combination of text and numbers including
numbers that do not require calculation (eg .Phone
number)
Up to 255
character
Long Text Length text or combination of text and number Up to 63,999
character
Number Numeric data used in mathematical calculations 1,2,4 or 8 byte
(16 byte if set
to replication
ID)
Date /time Values for the years 100 through 9999 8 byte
Currency Values and numeric data used in mathematical
calculations involving data with one to four decimal
places.
8 byte
Auto
number
A unique sequential (increment by 1) number or
random number whenever a new record is added
4 byte (16 if
set to
replication
ID)
Ye/No(tru
e /false or
On/Off)
These are field which contains only one of two values 1 bit