Computer Term 1 Questions
Computer Term 1 Questions
Buzz
1 Networking Concepts 2
Computer Network
Advantages of Networking
Types of Network — PAN, LAN, MAN, WAN
Network Components, Architecture, Topology and Security
2 Log on to Access 13
Types of Databases
Components of MS Access 2016
Starting Access 2016
Creating a Database
Views of a Table
Rules for Naming Fields
Data Types in Access
Adding Tables
Primary Key
Sorting a Table
Filtering Data
Searching in a Database
Closing Access 2016
COMPUTER NETWORK
When a number of computers are connected in order to communicate or share information,
they form a network and this is defined as a computer network.
Internet is an example of a computer network. The purpose of computer networking is to
build communication between computers. This communication includes exchange of data and
information with the help of software applications installed in computer systems.
A computer network can be formed between two or more computers linked together in
a room or a building, a town, a city, and across the globe. A computer network can also
include peripheral devices, such as printer, scanner, and so on.
The computers or devices within a network that originate, route, and terminate the data are
called Nodes. The computers in a network can work independently and communicate with
each other too. Hosts, such as personal computers, mobile phones, servers, and networking
hardware are different types of nodes. The computers are interconnected through different
media, such as cables, telephone lines, radio waves, or infrared light beams. Every network
has a control centre, which allows the different nodes to communicate.
A network can be of two types:
2 Intranet: It refers to a network that is private to an organisation.
Internet: This network is open to all. Anyone can connect to it.
ADVANTAGES OF NETWORKING Info Box
There are many advantages of computer networking. An Intranet that is partially accessible
to authorised outside users is called
Some of them are given below.
Extranet. Here, the users are usually the
▶▶ Cost-effective: Besides software, hardware
trusted partners of the organisation, who
devices, such as printer, scanner, and modem have access to relevant information.
can be shared by all the computers on a
network. Thus, it saves a good amount of money by eliminating the need of buying
additional hardware and software for each computer in a network.
▶▶ Backup: Suppose a computer in a network faces some technical issues or hardware
failure, in this case, the work can be allocated to another computer in the same network.
Networking helps to look for lost data at one place.
▶▶ Communication Tool: It is a convenient mode of communication for any organisation
that has branches at different locations.
▶▶ Easy Access to Remote Database: One can instantly book railway or airline tickets
from anywhere. Hence, it saves time and effort.
▶▶ Accelerates Efficiency: It allows the upgradation of software and data from a single
point, thus enhancing the efficiency of a working system.
▶▶ Reduces the Need of Hard Copies: There are times when a copy of some document is
to be circulated among the members of an organisation. In such a scenario, a soft copy
of the document can be shared among the members over the network.
▶▶ Real Time Delivery: One can instantly share data and information across the globe.
TYPES OF NETWORKS
The computer network can be classified into various categories based on the coverage of
geographical areas. The various categories are discussed below.
Branch office 1
Warehouse 1 Factory 3
Warehouse 3
Central office
Factory 1
Factory 2
Warehouse 2
Branch office 2
4
Fig. 1.3 Metropolitan Area Network
Wide Area Network (WAN)
A WAN connects two or more computers located at distant locations. They are interconnected
through telecommunication or satellite signals. The use of WAN is majorly restricted to large
establishments and government agencies that are spread across a country, continent, or even
across the globe. It uses public telecommunication media to transfer data. ATMs, customer
services of national and multinational banks rely heavily on WAN to transfer data.
Satellite relay
TV network satellite uplink
NETWORK COMPONENTS
To set-up wired networking in a group of computers for data sharing, some additional
components, such as interface cards, and other equipment are required. The hardware
components that are required for establishing wired networking are given below.
Network Cable
Registered Jack 45 (RJ45) is an eight-wire network cable.
It is a connector which is commonly used to link the Network
Interface Card (NIC) with a hub. It is also used to connect and
5
transfer data and information between computers and switch. Fig. 1.6 Network cable
Hub
It is a network device which connects computers and computing devices to exchange data
between them. Each hub has some ports which determine the number of devices that can
be connected to it. For example, 6, 8, 12, 24, and so on. A hub can also be linked to NIC
through RJ45 cable. It primarily broadcasts the message, which increases data traffic over the
network. The information is received by the intended computer(s) and automatically rejected
by other computers over the network.
or
gef A fro
m
ssa uter se
on er
A
Me mp Computer A
esp put Computer A
Message for Co Response from
R om
C
Message for Response from
Computer A Computer A Computer A Computer A
Hub Hub
Me Computer B Re Computer B
Co ssag sp
mp e f Co ons
ute or mp e fr
rA ute om
rA
Computer C Computer C
Fig. 1.7 Message for Computer A sent to all Fig. 1.8 Response from Computer A through a Hub
connected devices through a Hub
Switch
The function of a switch is similar to or
gef A
r
ssa ute
that of a hub, but it is more intelligent Me mp m
Co ro Computer A
as compared to hub. It not only checks sef rA
on te
Message for sp pu
data packets as they arrive, but also Computer A Re om
C
determines the source and destination
Response from Switch Computer B
of each packet, before sharing them. Computer A
Switches are preferred over hubs due
to their efficiency. In addition, a switch
prevents data collision and reduces Computer C
network congestion. Fig. 1.9 Function of a Switch
Let’s Review
Answer in one word.
1. It refers to a network that is private to an organisation.
2. These are the devices connected over a network.
6 3. It is an eight-wire network cable.
NETWORK ARCHITECTURE
Network architecture refers to the overall framework of an organisation’s computer
network. To establish network communication, it is important to have a detailed view of all the
accessible resources in it. Network architecture includes the following:
▶▶ Hardware components used for communication
▶▶ Topology
▶▶ Wired or wireless connection
▶▶ Protocols
There are two types of network architecture. They are listed below.
Peer-to-Peer
This type of network architecture is suitable for
a small environment, usually having up to 10
computers. Each computer connected over the
network has equal capability. These computers
must have specific rights to use or share the
available resources.
In Peer-to-Peer network, there is no dedicated
network administrator or central server. That
means all the computers can act as a server
as well as a client. This network is easy to set Fig. 1.10 Peer-to-Peer model
up and inexpensive.
Client-Server
It is a network in which several computers
called clients are connected to the main Client Client
Bus Topology
In this type of topology, all the devices are connected to a linear cable called bus or trunk.
The bus acts as a backbone of this network. This topology is the simplest way to connect
multiple devices. It uses cables for connections. This network is easy and inexpensive to
implement for small networks. In this topology, one of the computers in the network acts as
a server, and provides data to all the clients. The advantage of this network is that if one
computer system breaks down, it does not affect the other systems over the network. However,
if the main cable fails, the entire network becomes unusable.
Bus
8
Fig. 1.13 Bus topology
Ring Topology
In this topology, all the nodes in a network are connected
to one another in the form of a ring. Each node is linked to
two other nodes, forming a single continuous pathway for
signals. In this network, data travels in a circular manner.
Ring shaped networks offer high bandwidth and can
span large distances. This topology is losing its popularity
because it offers only unidirectional data flow. Like Bus
topology, in Ring topology too, addition and removal of
systems could cause network disruption. Moreover, a single
break in the connection could disrupt the entire network. Fig. 1.14 Ring topology
Star Topology
In this type of structure, all the devices are connected to a central device which acts as a hub
or switch. Each device is linked to the central hub through a separate connection, and thus
it requires more connections. But, the benefit of using separate connections is that if there is
a connection failure, it would affect only the functioning of a single system on the network.
Unlike the Bus and Ring topologies, no disruption is
caused at the time of addition or removal of a system
from the network. Here, all the information or data first
goes to the central device, that is, a hub or switch, and
then to the respective systems. Therefore, a hub or switch
controls the network communication. Since all the data Hub
passes through the central dervice, it increases the threat
of a single point failure, which means that if the hub or
central device fails, then the entire network goes down.
NETWORK SECURITY
It is important to secure data and resources from unauthorised
access and misuse. Therefore, it is advisable to protect your
data and secure the network. Info Box
The purpose of network security is to secure information Internet is controlled by 75
million servers.
of an individual or organisation, and also to protect the
computers on a network from any attack.
There are various methods to keep your network secure. Some of them are as follows:
▶▶ Access Control: It is used to block unauthorised users.
▶▶ Application Security: It always protects the applications stored in a computer system.
▶▶ Data Loss Prevention: There is always a fear that any member of the organisation may
send or upload sensitive information outside the network. This can be stopped by Data
Loss Prevention (DLP) technologies.
▶▶ Firewall: Firewall is a security system that protects a computer from unauthorised
access over a network. A firewall can be implemented using hardware or software, or a
combination of both. Firewall follows a set of rules that determines which data can enter
and leave a network.
Flashback
Exercises
A. Tick (✓) the correct answers.
1. It is not an advantage of networking.
a. Cost-effective b. Real time delivery c. Very expensive
2. Which of the following computer networks is built using USB cable?
a. PAN b. WAN c. MAN
3. Which network among the following is connected to a central device that acts as a hub?
a. Star topology b. Ring topology c. Mesh topology
4. This network topology is formed with a group of star networks.
a. Mesh topology b. Tree topology c. Ring topology
5 It is a network security system.
a. Hub b. Switch c. Firewall
Group Discussion
Divide the class into three groups, each group will discuss the following topics:
▶▶ Computer Networking has revolutionised the communication technology.
▶▶ A Switch is smarter than a Hub.
▶▶ Topology is the blueprint of computer networking.
Teacher’s Notes
Relational Database
This type of database stores the data and information in multiple tables with rows and
columns. A Relational Database establishes a relationship between different database
tables. Examples: Microsoft Access, MySQL (Structured Query Language), and Oracle.
ELEMENTS OF A DBMS
The elements of MS Access database are as follows:
▶ Table: A table is the basic unit of a database. It is used to store the data in rows and
columns. It is the primary location where data gets stored. A table is formed with three
basic elements, which are described below:
◆ Field: A column in a table is called a field. A field contains a specific category of
data. For example, a field named ‘First Name’ will only be used to store the first
name of the students (Table 2.1).
◆◆ Record: A row in a table is known as a record. It is formed with two or more fields,
and contains the data and information about a single person or an entity in a
database. For example, a record for Roll No. 102 is highlighted in Table 2.1.
◆◆ Data: A collection of facts and information is known as data.
Fields
ADVANTAGES OF DBMS
Some benefits of using DBMS are mentioned below:
▶▶ Eliminates Duplication of Data: It reduces data redundancy or duplication.
For example: A company may have multiple files storing the details of its employees,
such as personal details, official details, and so on. A DBMS integrates multiple files into a
single database file. Hence, the data is centralised and eliminates the duplication of data.
▶▶ User Friendly: DBMS manages data, saves time and energy since it lets a user to
access, search, and retrieve information quickly and effectively.
▶▶ Data Sharing: DBMS facilitates the users by allowing them to share and extract data
from the centralised database as per their requirements.
▶▶ Data Security: In a DBMS, the complete control over the database is in the hands of the
database administrator. It ensures that the data is accessible only to the authorised users.
▶▶ Data Integrity: A DBMS ensures that the data stored in it follows certain standards of
an organisation. For example: A database of a company contains information about
the salaries of its employees. If the minimum and maximum salary is set at ` 5,000
and ` 25,000, respectively, then you can set a criterion to make sure that the database
accepts numeric values only in the range of 5,000 to 25,000.
Title Bar
It is present at the top of the window and displays the name of the active database. At the
extreme right side of the Title bar, the Help, Minimize, Restore Down/Maximize, and
Close buttons are present.
Close
File tab
Ribbon
Tab Bar
Navigation
Work area
Pane
Navigation
buttons
Status bar
Fig. 2.1 Components of MS Access 2016 window
Ribbon
It is present right below the Title bar. The top area of the Ribbon contains various tabs.
Each tab has several groups of associated commands.
File Tab
It is located at the top left corner of the Ribbon. It contains commands, like Info, New,
16 Open, Save, Save As, Print, Close, Account, and Options. These commands help the
user in managing Access and its database.
Navigation Pane
This pane is located on the left side of the Access window. It displays the objects of the current
database. These objects could be Tables, Queries, Forms, and Reports.
Navigation Buttons
Navigation buttons are present at the bottom of the work area. These buttons let the users
navigate through the records. The current record number is displayed in the box between the
navigation buttons.
Tab Bar
In MS Access, database objects open in the tabbed form on the Tab bar. To view the contents
of an object, click on its corresponding tab. The content is displayed in the work area. Clicking
on the cross button present on the extreme right end of the Tab bar closes the current tab.
Status Bar
This bar is present at the bottom of the Access window.
Apart from displaying the information about the current Info Box
database, it also displays the name of the active view Database Schema is the overall
on the left side. On its right side, it contains buttons to design structure or blueprint of
switch the view of the active database object. the database. It describes how
the data is organised, and the
relations among them.
STARTING MS ACCESS 2016
To start MS Access 2016, follow these steps:
1. Click on Start > Access 2016.
2. The Start Screen of Access 2016 appears (Fig. 2.2).
Template options
17
Fig. 2.2 Start Screen of MS Access 2016
CREATING A DATABASE
When MS Access opens (Fig. 2.2), you can see various options on the right pane. These
options can be used to create a new database. MS Access offers two options to create a new
database, which are as follows:
▶▶ Using Templates (This option is active only when your computer is connected to the Internet.)
▶▶ Creating a Blank desktop database
3. In the File Name box, enter a suitable name for the database.
4. By default, Access defines a location for the database, which is displayed right below
the File Name box. You can also browse and select another location by clicking on
the Folder icon.
5. Click on the Create
button. Access
creates the requested
database and
displays the table
in Form View. It
contains the field
names that are
relevant to the
18 Personal Contacts
database (Fig. 2.5). Fig. 2.4 Personal contact manager task pane
Fig. 2.5 Personal Contacts database
Note: In the SECURITY WARNING message, click on the Enable Content button only when
you are sure that the source of the template is secure.
6. You can add more fields to the current template database by following these steps:
a. On the Home tab, click on the View button in the Views group.
b. Select the Datasheet View option in the
drop-down menu.
OR
Click on the Datasheet View button on the
Status bar.
7. A new contextual tab called Form Tools appears on
the Ribbon (Fig. 2.6).
8. On the Datasheet tab, click on the Add Existing
Fields button in the Tools group. The Field List task
pane (Fig. 2.7) appears on the right side of the screen.
9. Select the required fields from the list. Then, drag the
selected field to the table and drop it at the desired
position when the red insertion line appears.
19
Fig. 2.6 Selecting Add Existing Fields Fig. 2.7 Field List task pane
Creating a Blank Database
In case you want to create your own customised database, it is recommended to use the
Blank desktop database option. To create a blank database, follow these steps:
1. On the right pane of the
Start Screen, click on the
Blank desktop database
option (Fig. 2.2).
2. The Blank desktop database
task pane appears (Fig. 2.8).
Replace the default database
name with a suitable name
in the File Name box. Fig. 2.8 Blank desktop database task pane
3. Access defines a default location
for the database, which is shown right below the File Name box. You can select
another location by clicking on the Folder icon.
4. Click on the Create button.
5. A new database with a blank table named Table1 appears in the Datasheet View
(Fig. 2.9). Here, you can add the desired Field names and data.
Notice that the first field in the table is named as ID, by default.
Datasheet View
By default, a blank database opens in the Datasheet View. This view is used to enter data
in a table. In this view, the table is displayed as a grid, which form rows and columns. Each
row is regarded as a record and each column is regarded as a field. The field names are
treated as column headers. The Datasheet View appears as shown in figure 2.9.
Note: Double-clicking on the table name in the Navigation pane opens the table in the
Datasheet View.
Design View
In this view, you can enter the field names, specify their data types, and add the relevant
description. This Design View is mainly divided into two sections (Fig. 2.10):
be in uppercase, lowercase, or
combination of both.
22 Currency This data type lets you specify various currencies. You can also display the
currencies in different formats.
AutoNumber It stores an integer that increments automatically whenever you add a
new record to a table. You cannot change the value in the field that
has AutoNumber data type. Moreover, when you delete a record, its
AutoNumber value cannot be reused. By default, the ID field in a new
table has AutoNumber data type.
Note: MS Access allows only one AutoNumber field per table. It is
basically used to uniquely identify the records.
Yes/No It is used in the fields where there can be only one of two values,
Yes or No. You can adjust the format setting to display as True/False
or On/Off.
OLE Object It stores graphics or objects created in other applications, such as
MS Word, MS Excel or MS PowerPoint.
Hyperlink It stores links to a file/folder on your hard disk, over a network location
or a website.
Attachment It attaches an image file, spreadsheet, word document, or any other
supported files to a record. It is quite similar to the way a file is attached
to an email.
Calculated This data type is used to store the results of calculations that include values
from other fields in the same table.
Lookup This creates a lookup field, which displays a list of values from which you
Wizard can choose. The values could be taken from another table or query, or
you can type as well.
Let’s Review
Look at the given table and answer the following questions.
1. How many records are there in the table?
2. Which element of the table is ‘Name’?
3. What is the data type of the following?
a. Roll No :
b. Name :
c. Total Marks :
d. Date of Birth :
4. In which view is the table displayed?
23
ADDING TABLES IN DESIGN VIEW
By default, a blank database displays a single table. MS Access allows you to add new tables
to an existing database. Let us learn how to add tables in Design View.
On the Create tab, click on the Table Design option in the Tables group (Fig. 2.11). Access
creates a new table and opens it in the Design View.
Once the table is added in a database, you can assign field names and set the data type for
each field.
24 4. In the Description column, add a relevant description for each field, if required. The
description is displayed in the Status bar when the field is selected.
Fields added
to the table
Data Type list
Saving a Table
Keyboard Shortcuts
Once all the field names and their properties
Press Ctrl + W key combination to save the
are defined, and data type is set for each
changes and close the Table in MS Access.
field, save the table. To save the table,
follow these steps:
1. Click on the Save button on the Quick Access Toolbar.
OR
Click on the File tab > Save option.
2. In the Save As dialog box, assign a suitable
table name. Click on OK (Fig. 2.13).
Now, switch to Datasheet View to enter data in
the table.
Fig. 2.13 Save As dialog box
Renaming a Field
Double-click on the label Field1 (Fig. 2.16)
and rename it to First Name. Similarly,
add two more fields and rename them to
Last Name and Class. Fig. 2.16 Renaming a field
PRIMARY KEY
In every database, there is a ‘primary key’, which
contains the value(s) that helps the users to uniquely Info Box
identify each record in a table. The primary key Once a table is added in a database,
field in a table cannot contain the duplicate value. it is displayed in the Navigation pane.
By right-clicking on the table icon, you
Remember, the field set as a primary key cannot be
can perform various actions, such as
left blank while entering data.
renaming or deleting it.
Let us understand the concept of primary key with
the help of the following example:
Suppose, you have created a table containing the data of all the students of your class.
You found that more than one student shares the same name. Therefore, you cannot set
Name field as the primary key. In such a case, you can set Roll No or Enrollment No as
28 the primary key, since there are no chances of duplicate values in these fields. Thus, each
record will be identified uniquely.
Setting the Primary Key Method 1 Step 2 Method 1 Step 1
Editing Data
To edit data in a field, follow these steps:
1. First of all create a database as shown in figure 2.19 and save it with the name
Teachers’ Info. For partial editing, click on the cell in which you wish to modify the
content. Bring the cursor to the point where you want to edit. For replacing data,
double-click on the cell. The cell content gets highlighted. Then start typing the new
29
content, which will replace the existing one.
Pencil icon
2. Once the editing is done, click anywhere outside the current cell.
3. While editing the cell content, a Pencil icon appears in the record selector, which
indicates the Edit mode is active.
Moving a Field
To move a field, follow these steps:
1. Click on the column header of the field that you wish to move to a new location.
(Here, we have selected the ‘Mobile No’ field in figure 2.22.)
2. Click and drag the selected field to
the desired position. Notice, while
dragging a thick line appears
indicating the position where the
field can be placed (Fig. 2.22).
Release the mouse button at the
Fig. 2.22 Field moved to a new location
desired position.
SORTING A TABLE
You can sort the data in a table on the basis of values stored in a field either in ascending or
descending order.
To sort data, follow these steps:
1. Open the table in which you wish to
sort the data in the Datasheet View.
2. Click on the drop-down button next
to the field header, say, Grade.
A drop-down menu displaying
sorting and filtering options appears 31
(Fig. 2.23). Fig. 2.23 Sorting data
3. Select either Sort A to Z or Sort Z to A option (Fig. 2.23).
4. Observe the data in the selected field, that is, Grade, is sorted. Moreover, the rest of
the data in the table is also sorted accordingly (Fig. 2.24).
Access lets you display the specific records in a database using the Filter option.
To filter data, follow these steps:
1. Click on the drop-down button next to the field header on the basis of which you wish
to filter the table. For example, Grade. A drop-down menu appears (Fig. 2.26).
2. Clear the Select All checkbox. (By default, Access selects all the checkboxes.) Notice,
all the checkboxes are cleared at once.
3. Now, select the checkbox of the grade that you wish to display in the database. You
can select as many as you want. Here, we have selected A (Fig. 2.26).
4. Click on OK. Access now displays only those record(s) which contain the
corresponding value(s), and hides the rest (Fig. 2.26).
32
Fig. 2.26 Defining filter criteria
The filtered data appears (Fig. 2.27).
To remove the filter, click on the Toggle Filter button in the Sort & Filter group on the
Home tab. Access will display the original database.
SEARCHING IN A DATABASE
While working in a database, you often search for some data. It is quite challenging to search
for a particular data in a huge database. In such a situation, you can search data quickly
using the Search box, which is available at the bottom of the Access screen. To search data,
follow these steps:
1. In the Search box, enter part or the whole word, phrase, number, or date that you
want to look for in the database.
Press Enter. Notice that Access Matched value
Flashback
▶▶ Database Management System (DBMS) is a software to create, store, organise, manipulate, and
retrieve data whenever required.
▶▶ The two most common types of databases are Flat File database and Relational database.
▶▶ Tables, Queries, Forms, and Reports are the elements of MS Access database.
▶▶ Queries are used to retrieve data or information from the data table(s) based on certain conditions.
▶▶ A form is an object that is used to enter and display data in the tables.
▶▶ Reports are used to display or get an output of the data in a desired format for printing.
▶▶ MS Access lets you work on a table in two views — Datasheet View and Design View.
▶▶ Data type lets you control what type of data can be entered in a field. Some of the data types
are — Short Text, Long Text, Number, Date/Time, Currency, AutoNumber, Yes/No, and so on.
▶▶ Primary key contains the value(s) that helps the users to uniquely identify each record in a table.
34 The Primary key field in a table cannot contain duplicate values.
Exercises
A. Tick (✓) the correct answers.
1. Which of the following is not a type of database?
a. Relational database b. Flat file database c. Folder database
2. RDBMS stands for
a. Random Database Management System.
b. Rational Database Management Server.
c. Relational Database Management System.
3. This data type stores a link to a website.
a. Hyperlink b. OLE c. AutoNumber
4. This component of MS Access window displays the objects of the current database.
a. Status bar b. Navigation pane c. Work area
5. Which of the following icons indicates that the particular field is set as the Primary key?
a. Pencil icon b. Lock icon c. Key icon
Lab Activity
Create a table in MS Access 2016, displaying the details of the residents of a society.
1. Open MS Access 2016 by clicking on the Start > Access 2016.
2. The Start Screen of Access 2016 appears. Select the Blank desktop database option in
the right pane.
3. Type the name ‘Residents of ABC Society’ for the database in the File Name box.
4. Click on the folder icon to select the desired location for the database. Click on the
Create button.
5. By default a blank table opens in the Datasheet View. Switch the view to the Design
View. Access prompts to save the table. In the Save As dialog box, type ‘Residents info’,
and click on OK. The table opens in the Design View.
6. Now, enter the field names — House No, First Name, Last name, Age, and Occupation.
At the same time, define the suitable data type for each. Add description for the required
fields as shown in figure a.
7. Set House No field as the Primary Key.
8. In the ‘Field Property’ pane, set the Default Value ‘21’ for the field Age.
9. Now, switch to Datasheet View to enter the records.
10. Enter at least 5 records. Make sure you do not leave any field blank. (The sample records
are shown in figure b.)
11. Sort the table in ascending order on the basis of ‘Age’ field.
12. Filter the table and display only the residents whose age is between 35 and 50.
13. Add a new field named ‘Gender’ after the ‘Age’ field, and enter data for this field.
14. Save the changes in the table, and exit MS Access application.
36
Fig. a
Fig. b
Group Discussion
Teacher’s Notes
37
Queries, Forms, and
3 Reports in Access
Hello Friends! In the previous chapter, you Let’s Learn About
have learnt the basics of MS Access. Do ♦♦ Setting a Relationship
you know that you can also link multiple between Tables
tables in Access? This feature increases the ♦♦ Query
efficiency of your work and also lets you ♦♦ Forms
easily share the required information with ♦♦ Reports
multiple departments in the form of reports.
A database contains thousands of records with multiple tables in it, which may even increase
over time. Extracting specific information from such a huge database is a challenge.
MS Access offers features, such as queries, forms, and reports to make this task easier.
Let us learn about them in detail.
Fig. 3.1 Students’ info table Fig. 3.2 Guardian’s info table
Fig. 3.6 Edit Relationships dialog box Fig. 3.7 Relationship defined between the tables
Once the relationship is defined between the tables, data from both the tables can be used
for queries, forms, or reports.
QUERY
The general meaning of a query is ‘question’. In MS Access, query is a database object.
It is used to retrieve data or information from data table(s) based on certain conditions
(or criteria). These conditions are specified by the users.
Microsoft Access provides different types of queries such as:
▶▶ Select ▶▶ Crosstab ▶▶ S tructured Query Language (SQL)
▶▶ Parameter ▶▶ Action
Some examples of queries can be:
▶▶ the list of winners who belong to the same school
▶▶ the list of students who scored above 90 in all the subjects
▶▶ the list of people whose age is above 60
The result of a query is displayed in the form of a table. This table shows the set of records
that match the specified criteria. Access saves each query as a separate table called
Query table in a database. You can run a saved query anytime in the future.
Let us learn how to create a simple query based on a single table.
The two methods to create a query in MS Access are:
▶▶ Query Wizard ▶▶ Query Design
These two methods are available on the Create tab in the Queries group (Fig. 3.8). Here,
we will use the Teachers’ Info table (Fig. 3.9) to create a query.
40
Fig. 3.8 Query Options Fig. 3.9 Teachers’ info table
Creating a Query using Query Wizard
To create a query using the Query Wizard, follow
these steps:
1. On the Create tab, click on the Query Wizard
option in the Queries group.
2. The New Query dialog box opens (Fig. 3.10).
3. On the right pane, the Simple Query Wizard
option is selected by default. Click on OK.
4. The Simple Query Wizard screen (1 of 3) Fig. 3.10 New Query dialog box
appears (Fig. 3.11). If the current database has
multiple tables, click on the drop-down arrow
of the Tables/Queries box, and select the table
that contains the required data.
5. The data of the selected table appears in the
Available Fields pane (Fig. 3.11). Now, add
the field that you wish to see in the query results.
6. To add fields, follow these steps:
a. In the Available Fields pane, select the
required field.
Fig. 3.11 Simple Query Wizard screen (1 of 3)
b. Either click on the button or
double-click on the field. The selected
field moves to the right pane, that is, the
Selected Fields pane. Add the required
fields one-by-one.
c. If you wish to remove a field from the
Selected Fields pane, click on the
button. The selected field will reappear
in the Available Fields pane.
d. After selecting the required fields, click on
Fig. 3.12 Selected Fields
Next (Fig. 3.12).
Fig. 3.14 Simple Query Wizard Screen 3 of 3 Fig. 3.15 Result of Teachers’ Info Query
Adding Fields:
6. Select the fields to be included in the query from the Teachers’ Info table to the grid.
Use any of the following methods:
▶▶ Double-click on the field name in the table. Notice that the field is automatically
inserted in the first vacant column in the grid.
▶▶ Click and drag the field to the required column in the grid.
▶▶ Directly type the name of the field in the required column.
7. After adding the fields, the grid will look as shown in figure 3.18.
8. The fields appear in the Field row followed by the table name in the Table row.
Rearranging the Order:
Suppose you want to rearrange the order of fields as you want them to appear in the query
result. Then, follow these steps:
9. Place the pointer over the selector bar (Fig. 3.19) right above the column that you
43
want to move to a new position.
Selector bar
10. Click as soon as a tiny downward facing arrow appears. The entire column gets
selected (Fig. 3.19).
11. Click and drag it to the desired position.
Hiding the Field:
The Show row displays a checkbox in each column. Clearing the checkbox of a particular
field hides it while you run the query. Click on a checkbox to deselect it. In figure 3.20, the
Show checkbox of Subject is clear.
Setting Criteria:
44 This row lets you set a condition on the basis of which the data of the table will be filtered in
the Query result.
14. Click on the Criteria box of the Salary field, and type >=30000. This criterion will
display only those records in the Query output where salary is equal to or greater
than 30000.
Running a Query
Running a query means to perform the actions specified in that query. To run a query, follow
these steps:
1. On the Design tab, click on the Run button in the Results group (Fig. 3.23).
2. The query result appears in the Datasheet View (Fig. 3.24).
Saving a Query
To save a query, follow these steps:
1. Click on the File tab > Save option.
OR
Click on the Save button on the
Quick Access Toolbar.
2. The Save As dialog box appears if the
query is being saved for the very first time.
3. Enter a suitable name in the Query Name
45
text box, and click on OK (Fig. 3.25). Fig. 3.25 Saving a query
Let’s Review
Consider the Query Design Grid given below, and answer the questions that follow.
2. Name the source table of the fields.
3. Which component of the Query Design Grid lets you rearrange the order of data?
4. In which row of the grid you can set a condition?
FORMS
A form is a database object that facilitates the users to enter, edit, delete, and view data in a
table. Certain users might need to see only some fields in a table having many fields. A form
that contains only required fields makes it easier for users to use the database. Let us learn
how to create a form using the Form command and Form Wizard option. Here we will use
the Teachers’ Info table (Fig. 3.9).
46 View displaying all the fields used in the table (Fig. 3.27). By default, it opens the first
record of the table.
Fig. 3.27 Form in Layout View
4. Three additional tabs named Design, Arrange, and Format appear on the Ribbon
under the Form Layout Tools contextual tab (Fig. 3.27).
5. Select the first or any text box in the Form, and resize it using the resizing handle. The
rest of the text boxes resize as well.
To make any modifications in the data, first open it in the Form View.
To do so, follow these steps:
1. Click on the View button on the
Home tab. Select the Form View
in the drop-down menu
(Fig. 3.28).
2. Make the required changes in the
data. Use the Navigation buttons
present at the bottom of the work
area to move through the records.
To change the appearance of the form,
use the various options available on the
Design and Format tabs. First, switch
the view from the Form View to the
Layout View.
Fig. 3.28 Editing data in Form View
Using the Design Tab
1. Adding a Logo:
a. Click on the Logo button in the Header/Footer group (Fig. 3.29).
47
Fig. 3.29 The Design tab
b. The Insert Picture dialog box appears (Fig. 3.30). Locate and choose a suitable
picture. Click on OK.
Fig. 3.30 Insert Picture dialog box Fig. 3.31 Date and Time dialog box
49
Fig. 3.36 Selecting a layout for Form Fig. 3.37 Entering a name for Form
7. The formatted form appears (Fig. 3.38). Now, you can edit the data.
REPORTS
A Report is a database object used to display or get an output of the data in a desired
format. It collects the data and generates the reports as per the user’s required format. It
is an effective method to organise, view, and present data. You can control the size and
appearance of a report along with its components in MS Access. Let us discuss two methods
of creating reports:
▶▶ Report Command ▶▶ Report Wizard
50
Fig. 3.40 Report created using the Report command
4. The four additional tabs named Design,
Arrange, Format, and Page Setup
appear on the Ribbon under the
Report Layout Tools contextual tab.
5. Apply formatting effects to the report to
change its appearance. Here, we have
applied some effects using the Design
and Format tabs as displayed in
figure 3.41. Observe that the size of the
field boxes is reduced, text formatting,
and background color is applied to the
report’s heading.
6. Click on the Save button on the
Quick Access Toolbar. In the Save As
dialog box, assign a suitable name to Fig. 3.41 Formatted Report
your report. The newly created report is displayed in the Navigation pane.
7. Click on the File tab > Print > Print Preview to view how the report will look on a
sheet of paper.
51
Fig. 3.43 Report Wizard screen 1 of 5 Fig. 3.44 Report Wizard screen 2 of 5
4. The next screen of Report Wizard (3 of 5) asks you to set the type of sorting order
and summary information for the Report. Click on the first text box, and select the
Salary field. By default, Ascending option is selected. Change it to Descending and
click on Next (Fig. 3.45).
5. The Report Wizard screen 4 of 5 opens (Fig. 3.46). Select the desired layout and
orientation for your report in the corresponding sections.
6. Click on Next.
Fig. 3.45 Report Wizard screen 3 of 5 Fig. 3.46 Report Wizard screen 4 of 5
7. The final screen of Report Wizard (5 of 5) appears (Fig. 3.47). Assign a suitable title
for the report. Ensure that Preview the report radio button is selected.
8. Click Finish.
The report appears as shown in figure 3.48.
52
Fig. 3.47 Report Wizard screen 5 of 5 Fig. 3.48 Report created using the Report Wizard
Flashback
Lab Activity
A. Create a table named ‘Student Details’ with the fields as shown in the figure given below.
Create a query and report using this table.
54
Solution:
1. Start a new blank database with a table named Table1 in the Datasheet View.
2. Switch the view to the Design View using the View drop-down menu. Access prompts
to save the table. In the Save As dialog box, assign a suitable name, say, ‘Student Details’
and click on OK.
3. The Design View opens. Type in the Field Names, select Data Types, and add
Description (Optional) as shown in the figure above.
4. Set the Roll No field as the Primary Key. Now, switch back to the Datasheet View.
5. Enter at least 15 records in the table.
6. Create a form using the Form command in the Forms group on the Create tab.
The form opens in the Layout View.
a. Using the Design tab, add a relevant Logo, edit the Title, and insert the
Date and Time in the header of the form.
b. Apply font formatting and background color using the Format tab.
c. Save the form as Student Details Form using the Save button.
7. Create a query using the Query Design option in the Queries group on the Create tab.
a. In the Show Table dialog box, select the Student Details table. Click on Add, and
then click on Close.
b. Add the Roll No, Student Name, DOB, and Home State fields from the table to the
Query Design Grid.
c. Set DOB as Sort field, and select the Ascending option.
d. Run the query by clicking on the Run button in the Results group on the
Design tab.
e. Save the query as Student Details Query.
8. Finally, create a report on the Student Details Query.
a. Select the Student Details Query in the Navigation pane.
b. On the Create tab, click on the Report button in the Reports group.
c. Access creates a report on the basis of selected query and opens it on the screen.
d. Save the report with the name Student Details Report.
e. To see the print preview of the report, click on the File tab > Print Preview. 55
B. Create a table named Holiday Destination to store the details of top ten holiday
destinations of India. The table must consist of the fields mentioned in the given figure.
Do the following:
1. Open MS Access 2016.
2. Define the fields, data types, and description in the Design View.
3. Enter minimum 10 records in Datasheet View.
4. Create a Query, and Sort the data in Descending order on the basis of No of Tourists
Visited field. Run the query.
5. Save the query with the name Popular holiday destinations.
6. Create and print a report on the basis of the above query. Save it.
Group Discussion
Teacher’s Notes
▶▶ emonstrate to the students how to set a relationship between the tables. Describe the utility
D
of setting relationship between the tables.
▶▶ Discuss the term query with the help of real-life examples. Tell the students why queries are
used in a database.
56
GF-3, Virat Bhavan, Commercial Complex,
Mukherjee Nagar, Delhi 110009
Phone: (011) 43158350