METAS ADVENTIST SCHHOL
COMPUTER
CH: 7 INTRODUCTION TO MS ACCESS 2010
Introduction
Every organization maintains records of some or other kind.
For example,
A school keeps a record of the details of its students, teachers and the
administrative staff.
A chartered accountant’s office maintains a record of all its clients.
At home too, your parents keep a record of the phone numbers and addresses
of friends, family and utility stores. From time to time, we keep on adding
new addresses and also update the old addresses.
It is very difficult when there are thousands of records. To solve this problem, a
computerized record system to create, extract, sort, update data is there which is
known as a database management system [DBMS].
Database
A database is an organized collection of data. Maintaining databases is a basic
requirement of every organization. A database makes the data available easily so
that it can be used appropriately at any time.
Characteristics of a Database
The following example will help you understand the characteristics of a database.
A database has the following characteristics.
Value: A value is the smallest unit of a database. It can be numeric, alphanumeric or a special character (like underscore). Field: A collection of values of only one type forms a field. Here, in the example, ‘Name’ is a field. Record: A collection of fields forms a record. Here, in the example, each row forms a record. File: A collection of related records is called a file. Here, in the example, Roll No., Name, English, Maths, and Hindi can be recorded in a file. Database: A collection of files is called a database.
Designing a Database
Let us analyze and learn the fundamental building blocks of designing a database.
Before starting Microsoft Access 2010 to build tables, queries and other objects
that make up a database, it is important to learn the stepwise procedure of
designing a database. A good database is the keystone to create a database that
does what you want it to do effectively, accurately and efficiently.
Steps in Designing a Database
The basic steps of designing a database are given below.
Define the purpose and objectives of the database clearly.(School Database)
Identify the tables you need. (Students, Staff)
Identify the fields you require. (in Students Table—Gr. No., Name, Address)
Identify the field or fields with unique values in each record. (In Students
table Gr. No. because it will have unique number for each student)
Determine the relationships between tables.
Refine your design.
Enter data and create other database objects.
Database Management System (DBMS)
A database is a collection of information in an organized manner related to a
subject. For example, a telephone directory, dictionary, or a list of books in a
library – these are all stored in databases. A database should be managed
efficiently so that you can retrieve, sort, organize and edit as required. Software
that performs these functions is called a Database Management System (DBMS).
Microsoft Access, MYSQL, SQL and Oracle are few popular DBMS software.
A DBMS allows users to access, modify, delete, search, query, sort, design and
print data. It provides tools to create, maintain and retrieve data.
Advantages of a DBMS
There are many advantages of using a DBMS. A DBMS-
Reduces data duplication and data inconsistency.
Reduces programming effort.
Provides data independence.
Reduces cost.
Makes it easy to access information.
Provides distributed processing.
Provides security and integrity of information.
Is suitable for large and commercial organizations.
Uses of a Database
There are many uses of database in our daily lives. Some of them are as follows:
Airline and Railway Reservation System:
Database is required to keep record of ticket bookings, train and flight
departures, arrival and delay status. Also, if trains and flights get late then
people get to know it through database update.
Library Management System:
It is very difficult to keep record of thousands of books in a library with a
copy or register. So, a database is used to maintain all the information
related to book issue dates, name of the book, author and availability of the
book.
Banking:
We make thousands of electronic financial transactions daily without going
to banks. This is all possible with the use of database that manages all the
bank transactions and keeps the information secured.
Schools and Colleges:
E-learning platform provides anywhere and anytime easy access for
knowledge and skills. Again, this is all possible through database that
manages students’ records, registrations details, results, courses and grades.
All this information is stored in the database.
Social Media Sites:
Daily millions of users sign up for social media accounts like Facebook,
Twitter, Pinterest, Google Plus and so on, to share their views and connect
with their friends. All the information of users is stored and managed with
the help of the database.
Telecommunications:
Telecommunication business cannot run without database. Usage of
database is must for these companies to store the call details and monthly
post-paid bills of their customers.
Military:
Military and Army kept records of millions of soldiers and it has millions of
files that should be kept secured and safe. As database provides a big
security assurance to the military information so it is widely used in
militaries. One can easily search for all the information about anyone within
seconds with the help of databases.
Online Shopping:
Nowadays, online shopping has become a big trend. Everyone wants to shop
from home without wasting their time. So, the products are added and sold
through online shopping. Purchase information, invoice bills and payments,
all these are done only with the help of the databases.
Human Resources Management:
Human resource management departure keeps records of each employee’s
salary, tax and work details through the databases.
Manufacturing:
Manufacturing companies make products and sell them on a daily basis.
Database is used to keep records of all the details about the products like
quantity, bills, purchase, supply chain management and so on.
Microsoft Access 2010
Microsoft Access 2010 is a powerful DBMS to organize and manipulate data. It is a
component of the MS Office 2010 and is easy, user-friendly and capable of storing
huge amount of data. You use it to create and manage computer-based databases
on standalone computers as well as networked computers.
Microsoft Access allows users to carry out all the functions of a DBMS. It stores
information in the form of tables so that you can build your database. You can
create different tables and establish relationships between them. Special features
of MS Access 2010 are Forms, Reports and Queries which help the user in
retrieving the desired information as and when required.
Creating a Database with Microsoft Access 2010
To start Microsoft Access 2010, follow the steps given below.
Step 1: Click on the Start button.
Step 2: Click on All Programs (Fig. 1)
Step 3: Select Microsoft Office and click on the Microsoft Access 2010 (Fig. 2)
You will see the opening screen of Microsoft Access 2010 (Fig. 3)
Step 4: Click on the Blank database (it is selected by default when you start MS
Access 2010 for the first time). Type a name for the database file in the
File Name box on the right pane (Fig. 3).
Step 5: Click on the Create button. You will get the MS Access 201 window (Fig. 4).
Fig. 3 The Opening screen of Microsoft Access 2010
Components of MS Access 2010 Window
The opening window of MS Access 2010 is shown below (Fig. 4).
In this section, you will study the different components of MS Access window.
Title Bar:
It appears at the top of the window and contains the name of the database.
Quick Access Toolbar:
It has access to the most frequently used commands like Save, Undo and Redo.
You can add commands to it. On the right side of the Quick Access Toolbar, there
is a Customize button with a down arrow. If you click on his button, a menu would
appear.
Ribbon:
Under the Title Bar, there is the Ribbon from where you can choose commands.
Some sections of the Ribbon display a button. If you click on this button a dialog
box or a window will open.
Tabs:
The Ribbon is divided into tabs. The main tabs are Home, Create, External Data
and Database Tools. To access a tab, click its label or button, such as File, Home or
Create.
Groups:
Options in the Ribbon are organized in groups.
Navigation Pane:
It displays the database objects.
Status Bar:
It displays information about the database and includes buttons to change views.
Views:
You can directly access the various views by clicking on the icons.
Tabbed Bar:
Database objects (Tables, Query, Forms, Report) appear in the tabbed documents
rather than in overlapping windows.
Database Objects
There are different types of database objects:
Tables are used to store data in a database.
Forms make it easier to enter data in tables.
Query is used to retrieve data from one or more tables based on some criteria and
to display it on screen.
Report displays the data in a printed format.
Data Types in MS Access 2010
A field may store data of different types. Data type helps you to define the type of
data which you can enter into a field. The types of data available in MS Access
2010 are given in Table 1.
Field Description
Text Stores text, combination of text and numbers (like addresses A203) and numbers that will not be used in calculations (like phone numbers and postal codes). The default size is 50 but it can also store up to 255 characters.
Number Stores numeric data that will be used in calculations.
Currency Specifies various currencies and displays them in different formats.
Date/Time Stores date and time. You can display the date and time in various formats like DD/MM/YYYY or MM/DD/YYYY.
Yes/No This can have only two values—True or False.
Lookup & Relationships
Displays either a list of values that is retrieved from a table or query, or a set of values that you specified when you created the field. The Lookup Wizard helps you create a Lookup field. The data type of a Lookup field is either text or number, depending on the choices that you make in the wizard.
Memo Stores long text like notes and descriptions. It can store up to 65,536 characters.
Attachment This special data type allows you to attach external files to an Access database.
Hyperlink Text or combinations of text and numbers stored as text and used as a hyperlink address. It can store up to 2048 characters.
Calculated Field
Results of a calculation. The calculation must refer to other fields in the same table. You would use the Expression Builder to create the calculation
OLE object Stores pictures, graphs, sounds and word processing spreadsheet files.
Autonumber Stores an integer whose value increases or decreases automatically as you add or delete records. If the table does not have a Primary Key (Primary Key is a field which uniquely identifies a record For example, GRNO field will be Primary Key for the table Student), then Autonumber data type uniquely identifies the records.
Creating and Saving a Table in MS Access 2010
The Create tab contains commands that allow users to create database objects,
open the Create tab, and then click on the Table button. You will get the MS
Access window as shown in figure 4. This window contains an empty table named
as Table 1 in the Datasheet view. This table contains a field, called ID.
Adding More Fields and Saving
To add more fields to a table, follow the steps given below.
Step 1: Click on the Click to Add down arrow key. A list of data types will appear
(Fig. 5)
Fig. 5: A list of data types
Step 2: Select the data type and type the field name at field 1. Press the Enter key.
Create four fields called Student Name, Hindi, English and Mathematics (Fig. 6).
Fig. 6 Adding fields
Step 3: Click on the Save button in the Quick Access Toolbar. The Save As dialog
box appears. Type the table name there and click on OK (Fig. 7). A table with the
name Student appears in the navigation pane (Fig. 8).
Fig. 7: The Save As dialog box Fig. 8 The Student table in the navigation
pane
Rules for typing a field name are:
A field name can be from 1 to 64 characters long.
A field name can include letters, numbers and some special characters. The
underscore ( _ ) sign is allowed.
A field name cannot have [] symbols.
Field names cannot start with a blank space. They can be written in
uppercase, lowercase or both.
Defining a Primary Key in a Table
A Primary Key is a field which uniquely identifies a record. For example, Roll No is a
Primary Key for the table “Student”. To define a Primary key, follow the steps
given below.
Step 1: Click on the down arrow of the View option in the Views group under the
Fields tab. A list of views appears (Fig. 9).
Fig. 9 Views List
Step 2: Click on the Design View from the list.
Step 3: Select the field name ID.
Step 4: Click on the Primary Key button present on the Tools group under the
Design tab (Fig. 10). OR Right-click on the header of the column that will be the
Primary Key and then click on the Primary Key option from the context menu that
appears (Fig. 11).
Fig. 10: Selecting Primary Key in the Tools group Fig. 11: Selecting Primary key from the shortcut menu
Adding Data to a Table
To enter data to a table, first switch to the Datasheet View from the Design View.
To do so, follow the steps given below.
Step 1: Click on the View option of the Views group under the Design tab and click
on the Datasheet View.
Step 2: After opening the table in the Datasheet View, click on the first field and
enter data. Use arrow keys or the Tab key to move to the next column (Fig. 13).
Fig. 13: Adding data in a table
Opening an Existing Database
To open an existing database, follow the steps given below.
Step 1: Click on the File tab.
Step 2: Click on the Open. The Open dialog box appears (Fig. 14)
Step 3: Select the drive and folder that contains the database file. Select the
required database file and click on Open.
Fig. 14 The Open dialog box
Queries
Queries are a way of searching and collecting data from one or more tables. A
well-designed query can give information that you might not be able to find just by
examining the data in your tables. For example, you have a table for students, and
another table comprising addresses of students. You need to send an email to
each student using the student’s address. What you can do is a query to show each
contact, the student name, and the mailing address of the student.
A query allows you to view, insert, delete and calculate records and fields from
several tables in your database. Running a query is like asking a detailed question
to your database. When you build a query in MS Access 2010, you are describing
specific search conditions to find the data you want.
Creating a Query
After creating a table and entering data, you can work with queries. To begin
making a query choose an option either Query Design or Query Wizard on the
Create tab in the Queries group.
You will be prompted to select the tables and/or queries to include in your query.
Select each table and click on Add or Double-click on them. Remember to click
Close when you have finished adding your tables/queries.
There are two methods of creating a query:
Query Design
Query Wizard
Creating a Query Using Query Design
To create a query in Query Design, follow the steps given below.
Step 1: Click Query Design in the Queries group of the Create tab (Fig. 15). MS
Access will switch to the Query Design view. The Show table dialog box displays all
tables and queries in your database (Fig. 16).
Fig. 15: Selecting Query Design on the Create tab
Fig. 16: The Show Table dialog box
Fig. 17: The Query Design screen
Step 2: Double-click on a table to add it to Query Design. Click on the Add button.
You can repeat this step to add several related tables.
Step 3: Close the Show Table dialog box after adding the table(s). the Query Design
screen appears (Fig. 17).
Here, you can select fields to include in the query, using one of the following
methods:
Double-click on the field. It will be placed in the first vacant column of the
grid.
Click on the field and drag it to the required column in the grid.
Double-click the asterisk (*) to include all the columns of the table.
Type the field name directly in the required column in the grid.
Using the second method and drag columns to the grid (Fig. 18)
Fig. 18: Field in Query Design
Step 4: set the search criteria by clicking on the cell in the Criteria: row of each
field you would like to filter. Typing criteria into more than one field in the Criteria:
row will set your query to include only results that meet all the criteria. If you want
to set multiple criteria but don’t need the records shown in your results to meet
them all, type the first criteria in the Criteria: row and the additional criteria in the
Or: row and the rows beneath it.
Creating a Query Using Query Wizard
To create a query in Query Wizard follow the steps given below.
Step 1: Click on Query Wizard in the Queries group of the Create tab (Fig. 19).
Fig. 19: Query Wizard in the Queries group
Step 2: MS Access will switch to the Query Wizard view. A new Query dialog box
will appear (Fig. 20). Select Simple Query Wizard and click on OK.
Fig. 20: The New Query dialog box
Step 3: Select the field names you want to display by clicking on the button or
add all fields at once by clicking on the button. Remove fields by selecting
them in the Selected Fields and clicking on the button, or remove all the
fields in the Selected Fields by clicking on the button. The Field names will
appear in the right-side box. Click on Next (Fig. 21).
Fig. 21: The steps for creating a query using Query Wizard
Follow the directions on the pages of the Query Wizard.
Step 4: On the last page of the wizard, click on Finish (Fig. 21).
You will get the query output (Fig. 22).
Fig. 22: The Query output
Saving a Query
To save a query, click on Save in the Quick Access Toolbar or click on Save in the
File menu. When you save a query for the first time, a Save As dialog box appears
(Fig. 23). Type the query name and click on OK.
Fig. 23: The Save As dialog box
Running a Query
To run a query, follow the steps given below.
Step 1: click on Run in the Results group of the Query Tools Design tab (Fig. 24).
Step 2: The query result (Fig. 25) will be displayed in the query’s Datasheet View,
which looks like a table. You can save your query by clicking on Save command in
the Quick Access Toolbar.
Step 3: To close the query, click on the Close button on the Query Design screen.
Fig. 24: Running a Query
Fig.25: Query output
Extra Points:
The advantages of a DBMS are that it reduces data redundancy, data
inconsistency, programming effort, and cost. It eases accessing information,
and provides security and integrity of information.
Criteria determine how to filter records in the query output.
WORKSHEET [QUESTIONS]
1. ________ is the smallest unit of a database.
2. A collection of files is called a ________.
3. What are Home, Create, External Data, Database Tools, etc. called in MS
Access?
4. ________ is used for unique identification of a record.
5. Which database object allows you to view, insert, delete and calculate records
and fields from several tables?
6. ________ is a way to ask questions about a particular record in a table.
7. A ________ is an organized collection of data.
8. A collection of ________ is called a file.
9. ________ stores text and numbers up to ________ characters.
10. ________ stores numeric data for calculations.
11. Write true or false. Rewrite the false statements correctly.
a. The extension .mdb is used to name a database file.
b. There are eleven data types in MS Access.
c. The Query Design button is present in the Queries group on the Home tab.
d. Memo can store up to 65,555 characters.
e. A field name can be changed in the Datasheet View.
12. Define Primary key.
13. What is DBMS?
14. What are the characteristics of a database?
15. Write steps to define a field as the Primary Key.
16. Differentiate between design view and Datasheet view.
17. Give two advantages of using a Query.
18. Explain three uses of different kind of databases.
WORKSHEET [SOLUTION]
1. Value
2. Database
3. Tabs
4. Primary key
5. Query
6. Query
7. Database
8. Records
9. Text, 255
10. Number
11. Write true or false. Rewrite the false statements correctly.
a. False. The extension .accdb is used to name a database file.
b. False. There are twelve data types in MS Access.
c. False. The Query Design button is present in the Queries group on the Home
tab.
d. False. Memo can store up to 65,536 characters.
e. True
12. Primary Key:
A Primary Key is a field in a table which uniquely identifies a record.
13. DBMS:
A database should be managed efficiently so that we can retrieve, sort,
organize and edit as required. Software that performs these functions is
called a Database Management System (DBMS). It is an interface between
the user and the database stored on our computer.
14. A database has the following characteristics.
Value: A value is the smallest unit of a database. It can be numeric,
alphanumeric or a special character.
Field: A collection of values of only one type forms a field
Record: A collection of fields forms a record.
File: A collection of related records is called a file
Database: A collection of files is called a database.
15. To define a Primary key, follow the steps given below.
16. Step 1: Click on the down arrow of the View option in the Views group under
the Fields tab. A list of views appears
Step 2: Click on the Design View from the list.
Step 3: Select the field name ID.
Step 4: Click on the Primary Key button present on the Tools group under the
Design tab.
17. Advantages of using a Query:
a. Query is used to retrieve data from one or more tables.
b. Queries are used to view, summarize and analyse data.
18. Uses of different kind of databases are:
Airline and Railway Reservation System:
Database is required to keep record of ticket bookings, train and flight
departures, arrival and delay status.
Library Management System:
A database is used to maintain all the information related to book issue
dates, name of the book, author and availability of the book.
Human Resources Management:
Human resource management departure keeps records of each employee’s
salary, tax and work details through the databases.