0% found this document useful (0 votes)
29 views411 pages

Book Class Ix and X

Uploaded by

bsanta04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views411 pages

Book Class Ix and X

Uploaded by

bsanta04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 411

SAYANTAN BERA

BARRACKPORE SENATE PUBLIC


SCHOOL(H.S.)

INTRODUCTION TO COMPUTER
UNIT I: INTRODUCTION TO COMPUTER
Computer is an advanced electronic device that takes raw data as
an input from the user and processes it under the control of a set
of instructions (called program), produces a result (output), and
saves it for future use.

Computer - Overview
Today’s world is an information-rich world and it has become a necessity for everyone to know
about computers. A computer is an electronic data processing device, which accepts and stores data
input, processes the data input, and generates the output in a required format.
The purpose of this tutorial is to introduce you to Computers and its fundamentals.
Functionalities of a Computer
If we look at it in a very broad sense, any digital computer carries out the following five functions −
Step 1 − Takes data as input.
Step 2 − Stores the data/instructions in its memory and uses them as required.
Step 3 − Processes the data and converts it into useful information.
Step 4 − Generates the output.
Step 5 − Controls all the above four steps.

Advantages of Computers
Following are certain advantages of computers.
High Speed
Computer is a very fast device.
It is capable of performing calculation of very large amount of data.
The computer has units of speed in microsecond, nanosecond, and even the picosecond.
It can perform millions of calculations in a few seconds as compared to man who will spend many
months to perform the same task.
Accuracy
In addition to being very fast, computers are very accurate.
The calculations are 100% error free.
Computers perform all jobs with 100% accuracy provided that the input is correct.
Storage Capability
Memory is a very important characteristic of computers.
A computer has much more storage capacity than human beings.
It can store large amount of data.
It can store any type of data such as images, videos, text, audio, etc.
Diligence
Unlike human beings, a computer is free from monotony, tiredness, and lack of concentration.
It can work continuously without any error and boredom.
It can perform repeated tasks with the same speed and accuracy.
Versatility
A computer is a very versatile machine.
A computer is very flexible in performing the jobs to be done.
This machine can be used to solve the problems related to various fields.
At one instance, it may be solving a complex scientific problem and the very next moment it may be
playing a card game.
Reliability
A computer is a reliable machine.
Modern electronic components have long lives.
Computers are designed to make maintenance easy.
Automation
Computer is an automatic machine.
Automation is the ability to perform a given task automatically. Once the computer receives a
program i.e., the program is stored in the computer memory, then the program and instruction can
control the program execution without human interaction.
Reduction in Paper Work and Cost
The use of computers for data processing in an organization leads to reduction in paper work and
results in speeding up the process.
As data in electronic files can be retrieved as and when required, the problem of maintenance of
large number of paper files gets reduced.
Though the initial investment for installing a computer is high, it substantially reduces the cost of
each of its transaction.
Disadvantages of Computers
Following are certain disadvantages of computers.
A computer is a machine that has no intelligence to perform any task.
Each instruction has to be given to the computer.
A computer cannot take any decision on its own.
Dependency
It functions as per the user’s instruction; thus, it is fully dependent on humans.
Environment
The operating environment of the computer should be dust free and suitable.
No Feeling
Computers have no feelings or emotions.
It cannot make judgment based on feeling, taste, experience, and knowledge unlike humans.

COMPUTER – APPLICATIONS AREAS


Fundamentals
A computer has high speed of calculation, diligence, accuracy, reliability,
or versatility which has made it an integrated part in all business organizations.
Computer is used in business organizations for −
Payroll calculations
Budgeting
Sales analysis
Financial forecasting
Managing employee database
Maintenance of stocks, etc.
Banking
Computer Banking
Today, banking is almost totally dependent on computers.
ATM machines which are completely automated are making it even easier for customers to deal
with banks.
Insurance
Computer Insurance companies are keeping all records up-to-date with the help of computers.
Insurance companies, finance houses, and stock broking firms are widely using computers for their
concerns.
Computer Educational
The computer helps in providing a lot USE OF COMPUTER IN VERIOUS FIELD
Business
Computer of facilities in the education system.
The computer provides a tool in the education system known as CBE (Computer Based Education).
CBE involves control, delivery, and evaluation of learning.
Computer education is rapidly increasing the graph of number of computer students.
There are a number of methods in which educational institutions can use a computer to educate the
students.
It is used to prepare a database about performance of a student and analysis is carried out on this
basis.
Marketing
In marketing, uses of the computer are following −
Computer Marketing
Advertising − With computers, advertising professionals create art and graphics, write and revise
copy, and print and disseminate ads with the goal of selling more products.
Home Shopping − Home shopping has been made possible through the use of computerized
catalogues that provide access to product information and permit direct entry of orders to be filled
by the customers.
Healthcare
Computers have become an important part in hospitals, labs, and dispensaries. They are being used
in hospitals to keep the record of patients and medicines. It is also used in scanning and diagnosing
different diseases. ECG, EEG, ultrasounds and CT scans, etc. are also done by computerized
machines.
Following are some major fields of health care in which computers are used.
Computer Healthcare
Diagnostic System − Computers are used to collect data and identify the cause of illness.
Lab-diagnostic System − All tests can be done and the reports are prepared by computer.
Patient Monitoring System − These are used to check the patient's signs for abnormality such as in
Cardiac Arrest, ECG, etc.
Pharma Information System − Computer is used to check drug labels, expiry dates, harmful side
effects, etc.
Surgery − Nowadays, computers are also used in performing surgery.
Engineering Design
Computers are widely used for Engineering purpose.
One of the major areas is CAD (Computer Aided Design) that provides creation and modification of
images. Some of the fields are −
Computer Engineering
Structural Engineering − Requires stress and strain analysis for design of ships, buildings, budgets,
airplanes, etc.

Industrial Engineering − Computers deal with design, implementation, and improvement of


integrated systems of people, materials, and equipment.
Architectural Engineering − Computers help in planning towns, designing buildings, determining a
range of buildings on a site using both 2D and 3D drawings.
Military
Computer Military
Computers are largely used in defence. Modern tanks, missiles, weapons, etc. Military also employs
computerized control systems. Some military areas where a computer has been used are −
Missile Control,Military Communication,Military Operation and Planning
Communication is a way to convey a message, an idea, a picture, or speech that is received and
understood clearly and correctly by the person for whom it is meant. Some main areas in this
category are −
Computer Communication
E-mail
Chatting
Usenet
FTP
Telnet
Video-conferencing
Government
Computers play an important role in government services. Some major fields in this category are −
Computer Government
Budgets
Sales tax department
Income tax department
Computation of male/female ratio.
Computer - Generations
Generation in computer terminology is a change in technology a computer is/was being used.
Initially, the generation term was used to distinguish between varying hardware technologies.
Nowadays, generation includes both hardware and software, which together make up an entire
computer system.
There are five computer generations known till date. Each generation has been discussed in detail
along with their time period and characteristics. In the following table, an approximate date against
each generation has been mentioned, which are normally accepted.

Following are the main five generations of computers.


S.No Generation & Description
1 First Generation
The period of first generation: 1946-1959. Vacuum tube based.
Vacuum tube

What is a Vacuum Tube?


The vacuum tube is a device that was developed by English physicist John Ambrose Fleming for the first time in
1904, which contains electrodes to control electron flow. Generally, in a sealed container, it is used to control flow
with the help of a vacuum. In early computers, it was also used as a switch or an amplifier, and it is also known as
a valve or an electron tube.

The below picture shows a different kind of vacuum tubes.


What is a Vacuum Tube?
During the first half of the 1900s, it was used in televisions, sound recording, industrial automation reproduction,
radar equipment, radios, and telephone network systems and is the predecessor of the modern transistor that
means, as transistors may be used today, the vacuum tube was used in creative ways as electronically controlled
rectifiers, oscillators, switches, and amplifiers.

In older computer monitors and televisions, the CRT (cathode ray tube) was widely used as a screen is a kind of
vacuum tube. First, it was invented as a basic component for electronic devices and most commonly used in the
evolution of analog as well as digital computers in the first half of the twentieth century.

The vacuum tube produces electrons and an anode as it was made of a cathode, and the anode collects the
electrons called a diode. However, there were other kinds of vacuum tubes available, which were categorized on
the basis of the number of electrodes presented. Then, these electrodes are surrounded typically in glass, in a
casing; when energized enough, it can act as a conductor with all the air detached. As lightning travels through the
air, in the same way, a pathway becomes for electrons. Therefore, it is commonly known as the vacuum tube due
to the shape of the vacuum.

Also, the vacuum tube produced a lot of heat as it needed massive amounts of power; because it required a heating
filament for producing electrons. Due to a lot of heat, the components were quickly degraded; therefore, they
burned out quickly. In order to work, three different power sources are also required by vacuum tubes, which are
based on capacities and ratings. The power consumption and size became smaller with the progress of vacuum
tube technology. Also, they were cost-effective, and transistors work effectively only for low frequencies. With
the transistors in a cascade, a hundred transistors in parallel and wired together will be required for high
frequencies. That led to the need for heat sinks, which creates massive heat.

An equivalent transmitter needs significantly less power and only uses a single tube. Also, it can be coded with the
help of forced air or water cooling. The speaker damping effect of vacuum tubes and solid-state amplifiers cannot
repeat the peculiar distortion; hence, in sound amplifiers, the vacuum tubes are more common. The vacuum tube
started to replace by the transistor in the 1950s. Due to the size of the transistors, they were become much ideal to
use as the size of computing devices started to become smaller. In smaller computing devices, vacuum tubes did
not fit as they were large in size, which led to becoming less useful.

Additionally, today vacuum tubes are still used in high-end audio equipment and big radio stations, especially
those using frequencies more than 50 MHz and energy levels more than 10,000 W; hence, the vacuum tube
technology is not completely obsolete.
2 Second Generation
The period of second generation: 1959-1965. Transistor based.

What is a Transistor? A transistor is a type of a semiconductor device that can be used to both conduct and
insulate electric current or voltage. A transistor basically acts as a switch and an amplifier. In simple
words, we can say that a transistor is a miniature device that is used to control or regulate the flow of
electronic signals.

Transistors are one of the key components in most of the electronic devices that are present today.
Developed in the year 1947 by three American physicists John Bardeen, Walter Brattain and William
Shockley, the transistor is considered as one of the most important inventions in the history of science.

Parts of a Transistor
A typical transistor is composed of three layers of semiconductor materials or more specifically terminals
which helps to make a connection to an external circuit and carry the current. A voltage or current that is
applied to any one pair of the terminals of a transistor controls the current through the other pair of
terminals. There are three terminals for a transistor. They are:

Base: This is used to activate the transistor.


Collector: It is the positive lead of the transistor.
Emitter: It is the negative lead of the transistor.

3 Third Generation
The period of third generation: 1965-1971. Integrated Circuit based.
What is an Integrated Circuit (IC)?
The circuits that were made previously were large and
bulky, consisting of circuit components like resistor,
capacitor, inductor, transistor, diodes, etc., which were
connected with copper wires. This factor limited the use
of the circuits to big machines. It was not possible to
create small and compact appliances with these big
circuits. Moreover, they were not entirely shockproof
and reliable.

As it is said, necessity is the mother of all inventions. So


there was a need to develop smaller size circuits with
more power and safety to incorporate them into devices.
Three American scientists invented transistors that
simplified things to quite an extent, but the development
of integrated circuits changed electronics technology’s face.
Definition of IC?
An integrated circuit or an IC is a small chip of a semiconductor material that mounts an entire circuit on
itself. It is very small when compared to the standard circuits, which are made of independent circuit
components. The most commonly used IC is the monolithic integrated circuit.

Integrated Chip
Integrated circuits can function as an oscillator, amplifier, microprocessor or even as a computer memory.

Integrated Circuits or an IC is defined as a microchip on which


thousands and hundreds of electrical components, such as resistors,
capacitors and transistors, are fabricated. An IC functions as an
oscillator, amplifier, microprocessor, timer or as computer
memory.
4 Fourth Generation
The period of fourth generation: 1971-1980. VLSI microprocessor based.
The period of fourth generation was from 1971-1980. Computers of fourth generation used Very Large
Scale Integrated (VLSI) circuits. VLSI circuits having about 5000 transistors and other circuit elements
with their associated circuits on a single chip made it possible to have microcomputers of fourth
generation.

5 Fifth Generation
The period of fifth generation: 1980-onwards. ULSI microprocessor based.
The history of the computer dates back to several years. There are five prominent generations of
computers. Each generation has witnessed several technological advances which change the functionality
of the computers. This results in more compact, powerful, robust systems which are less expensive.

The period of fifth generation: 1980-onwards. ULSI microprocessor based.

The history of the computer dates back to several years. There are five prominent generations of
computers. Each generation has witnessed several technological advances which change the
functionality of the computers. This results in more compact, powerful, robust systems which are
less expensive. The brief history of computers is discussed below −
First Generation (1940-1956)
The first-generation computers had the following features and components −
Hardware
The hardware used in the first generation of computers was: Vacuum Tubes and Punch Cards.
Features
Following are the features of first generation computers −
It supported machine language.
It had slow performance
It occupied large size due to the use of vacuum tubes.
It had a poor storage capacity.
It consumed a lot of electricity and generated a lot of heat.
Memory
The memory was of 4000 bits.
Data Input
The input was only provided through hard-wired programs in the computer, mostly through
punched cards and paper tapes.
Examples
The examples of first generation computers are −
ENIAC
UNIVACTBM 701
Second Generation (1956-1963)
Several advancements in the first-gen computers led to the development of second generation
computers. Following are various changes in features and components of second generation
computers −
Hardware
The hardware used in the second generation of computers were −
Transistors
Magnetic Tapes
Features
It had features like −
Batch operating system
Faster and smaller in size
Reliable and energy efficient than the previous generation
Less costly than the previous generation
Memory
The capacity of the memory was 32,000 bits.
Data Input
The input was provided through punched cards.
Examples
The examples of second-generation computers are −
Honeywell 400
CDC 1604
IBM 7030
Third Generation (1964-1971)
Following are the various components and features of the third-generation computers −
Hardware
The hardware used in the third generation of computers were −
Integrated Circuits made from semi-conductor materials
Large capacity disks and magnetic tapes
Features
The features of the third-generation computers are −
Supports time-sharing OS
Faster, smaller, more reliable and cheaper than the previous generations
Easy to access
Memory
The capacity of the memory was 128,000 bits.
Data Input
The input was provided through keyboards and monitors.
Examples
The examples of third generation computers are −
IBM 360/370
CDC 6600
PDP 8/11
Fourth Generation (1972-2010)
Fourth generation computers have the following components and features −
Hardware
The Hardware used in the fourth generation of computers were −
ICs with Very Large-Scale Integration (VLSI) technology
Semiconductor memory
Magnetic tapes and Floppy
Features
It supports features like −
Multiprocessing & distributed OS
Object-oriented high-level programs supported
Small & easy to use; hand-held computers have evolved
No external cooling required & affordable
This generation saw the development of networks and the internet
It saw the development of new trends in GUIs and mouse
Memory
The capacity of the memory was 100 million bits.
Data Input
The input was provided through improved hand held devices, keyboard and mouse.
Examples
The examples of fourth generation computers are −
Apple II
VAX 9000
CRAY 1 (super computers)
Fifth Generation (2010-Present)
These are the modern and advanced computers. Significant changes in the components and
operations have made fifth generation computers handy and more reliable than the previous
generations.
Hardware
The Hardware used in the fifth generation of computers are −
Integrated Circuits with VLSI and Nano technology
Large capacity hard disk with RAID support
Powerful servers, Internet, Cluster computing
Features
It supports features like −
Powerful, cheap, reliable and easy to use.
Portable and faster due to use of parallel processors and Super Large Scale Integrated Circuits.
Rapid software development is possible.
Memory
The capacity of the memory is unlimited.
Data Input
The input is provided through CDROM, Optical Disk and other touch and voice sensitive input
devices.
Examples
The examples of fifth generation computers are −
IBM
Pentium
PARAM
Computer - Types
Computers can be broadly classified by their speed and computing power.
S.No. Type Specifications
PC (Personal It is a single user computer system having
1
Computer) moderately powerful microprocessor
It is also a single user computer system,
2 Workstation similar to personal computer however has
a more powerful microprocessor.
It is a multi-user computer system,
3 Mini Computer capable of supporting hundreds of users
simultaneously.
It is a multi-user computer system,
capable of supporting hundreds of users
4 Main Frame
simultaneously. Software technology is
different from minicomputer.
5 Supercomputer It is an extremely fast computer, which
can execute hundreds of millions of
instructions per second.

PC (Personal Computer)
A PC can be defined as a small, relatively inexpensive computer designed for an individual user.
PCs are based on the microprocessor technology that enables manufacturers to put an entire CPU on
one chip. Businesses use personal computers for word processing, accounting, desktop publishing,
and for running spreadsheet and database management applications. At home, the most popular use
for personal computers is playing games and surfing the Internet.
Although personal computers are designed as single-user systems, these systems are normally
linked together to form a network. In terms of power, now-a-days high-end models of the
Macintosh and PC offer the same computing power and graphics capability as low-end workstations
by Sun Microsystems, Hewlett-Packard, and Dell.
Workstation
Workstation is a computer used for engineering applications (CAD/CAM), desktop publishing,
software development, and other such types of applications which require a moderate amount of
computing power and relatively high quality graphics capabilities.
Workstations generally come with a large, high-resolution graphics screen, large amount of RAM,
inbuilt network support, and a graphical user interface. Most workstations also have mass storage
device such as a disk drive, but a special type of workstation, called diskless workstation, comes
without a disk drive.
Common operating systems for workstations are UNIX and Windows NT. Like PC, workstations
are also single-user computers like PC but are typically linked together to form a local-area
network, although they can also be used as stand-alone systems.
Minicomputer
It is a midsize multi-processing system capable of supporting up to 250 users simultaneously.
Mainframe
Mainframe is very large in size and is an expensive computer capable of supporting hundreds or
even thousands of users simultaneously. Mainframe executes many programs concurrently and
supports many simultaneous execution of programs.
Supercomputer
Supercomputers are one of the fastest computers currently available. Supercomputers are very
expensive and are employed for specialized applications that require immense amount of
mathematical calculations (number crunching).
For example, weather forecasting, scientific simulations, (animated) graphics, fluid dynamic
calculations, nuclear energy research, electronic design, and analysis of geological data (e.g. in
petrochemical prospecting).
Computer – Components
All types of computers follow the same basic logical structure and perform the following five basic
operations for converting raw input data into information useful to their users.
S.No. Operation Description
The process of entering data and instructions
1 Take Input
into the computer system.
Saving data and instructions so that they are
2 Store Data available for processing as and when
required.
3 Processing Performing arithmetic, and logical
operations on data in order to convert them
Data
into useful information.
The process of producing useful information
Output
4 or results for the user, such as a printed
Information
report or visual display.
Control the Directs the manner and sequence in which
5
workflow all of the above operations are performed

BLOCK DIAGRAM OF COMPUTER


Input Unit
This unit contains devices with the help of which we enter data into the computer. This unit creates
a link between the user and the computer. The input devices translate the information into a form
understandable by the computer.
CPU (Central Processing Unit)
CPU is considered as the brain of the computer. CPU performs all types of data processing
operations. It stores data, intermediate results, and instructions (program). It controls the operation
of all parts of the computer.
CPU itself has the following three components −
ALU (Arithmetic Logic Unit)
Memory Unit
Control Unit
Output Unit
The output unit consists of devices with the help of which we get the information from the
computer. This unit is a link between the computer and the users. Output devices translate the
computer's output into a form understandable by the
users.
Computer - CPU(Central Processing Unit)
Central Processing Unit (CPU) consists of the
following features −
CPU is considered as the brain of the computer.
CPU performs all types of data processing operations.
It stores data, intermediate results, and instructions (program).
It controls the operation of all parts of the computer.

CPU itself has following three components.


Memory or Storage Unit
Control Unit
ALU(Arithmetic Logic Unit)

Memory or Storage Unit


This unit can store instructions, data, and intermediate results. This unit supplies information to
other units of the computer when needed. It is also known as internal storage unit or the main
memory or the primary storage or Random Access Memory (RAM).
Its size affects speed, power, and capability. Primary memory and secondary memory are two types
of memories in the computer. Functions of the memory unit are −
It stores all the data and the instructions required for processing.
It stores intermediate results of processing.
It stores the final results of processing before these results are released to an output device.
All inputs and outputs are transmitted through the main memory.
Computer - CPU

Control Unit
This unit controls the operations of all parts of the computer but does not carry out any actual data
processing operations.
Functions of this unit are −
It is responsible for controlling the transfer of data and instructions among other units of a
computer.
It manages and coordinates all the units of the computer.
It obtains the instructions from the memory, interprets them, and directs the operation of the
computer.
It communicates with Input/Output devices for transfer of data or results from storage.
It does not process or store data.
ALU (Arithmetic Logic Unit)
This unit consists of two subsections namely,
Arithmetic Section
Logic Section
Arithmetic Section
Function of arithmetic section is to perform arithmetic operations like addition, subtraction,
multiplication, and division. All complex operations are done by making repetitive use of the above
operations.
Logic Section
Function of logic section is to perform logic operations such as comparing, selecting, matching, and
merging of data.
Computer - Input Devices
Following are some of the important input devices which are used in a computer −
Keyboard
Mouse
Joy Stick
Light pen
Track Ball
Scanner
Graphic Tablet
Microphone
Magnetic Ink Card Reader(MICR)
Optical Character Reader(OCR)
Bar Code Reader
Optical Mark Reader(OMR)
Keyboard
Keyboard is the most common and very popular input device which helps to input data
to the computer. The layout of the keyboard is like that of traditional typewriter, although
there are some additional keys provided for performing additional functions.

Keyboards are of two sizes 84 keys or 101/102 keys, but now keyboards with
104 keys or 108 keys are also available for Windows and Internet.
The keys on the keyboard are as follows –

S.N Keys & Description


o
Typing Keys
1 These keys include the letter keys (A-Z) and digit keys (09)
which generally give the same layout as that of typewriters.
Numeric Keypad
It is used to enter the numeric data or cursor movement.
2 Generally, it consists of a set of 17 keys that are laid out in the
same configuration used by most adding machines and
calculators.
Function Keys
The twelve function keys are present on the keyboard which are
3
arranged in a row at the top of the keyboard. Each function key
has a unique meaning and is used for some specific purpose.
Control keys
These keys provide cursor and screen control. It includes four
4 directional arrow keys. Control keys also include Home, End,
Insert, Delete, Page Up, Page Down, Control(Ctrl),
Alternate(Alt), Escape(Esc).
Special Purpose Keys
Keyboard also contains some special purpose keys such as
5
Enter, Shift, Caps Lock, Num Lock, Space bar, Tab, and Print
Screen.
Mouse
Mouse is the most popular pointing device. It is a very famous
cursor-control device
having a small palm size box with a round ball at its base, which
senses the movement
of the mouse and sends corresponding signals to the CPU when the
mouse buttons are
pressed.
Generally, it has two buttons called the left and the right button and a wheel is present
between the buttons. A mouse can be used to control the position of the cursor on the
screen, but it cannot be used to enter text into the computer.

Advantages
Easy to use
Not very expensive
Moves the cursor faster than the arrow keys of the keyboard.
Joystick
Joystick is also a pointing device, which is used to move the cursor
position on a monitor
screen. It is a stick having a spherical ball at its both lower and upper ends. The lower spherical
Ball moves in a socket. The joystick can be moved in all four directions.
The function of the joystick is similar to that of a mouse. It is mainly used in
Computer Aided Designing (CAD) and playing computer games.

Light Pen
Light pen is a pointing device similar to a pen. It is used to select a
displayed menu item or
draw pictures on the monitor screen. It consists of a photocell and an
optical system placed
in a small tube.

When the tip of a light pen is moved over the monitor screen and the pen button is pressed, its
photocell sensing element detects the screen location and sends the corresponding signal to the
CPU.
Track Ball
Track ball is an input device that is mostly used in notebook or
laptop computer, instead of a mouse.
This is a ball which is half inserted and by moving fingers on the
ball, the pointer can be moved.

Since the whole device is not moved, a track ball requires less
space than a mouse. A track ball comes in various shapes like a
ball, a button, or a square.

Scanner
Scanner is an input device, which works more like a photocopy
machine. It is used when some information
is available on paper and it is to be transferred to the hard disk of
the computer for further manipulation.

Scanner captures images from the source which are then


converted into a digital form that can be stored on the disk. These
images can be edited before they are printed.

Digitizer
Digitizer is an input device which converts analog information into digital form. Digitizer can
convert a signal from the television or camera into a series of numbers that could be stored in a
computer. They can be used by the computer to create a picture of whatever the camera had been
pointed at.
Digitizer is also known as Tablet or Graphics Tablet as it converts
graphics and pictorial data into binary inputs. A graphic tablet as
digitizer is used for fine works of drawing and image
manipulation applications.
Microphone
Microphone is an input device to input sound that is then stored in
a digital form.
The microphone is used for various applications such as adding sound
to a multimedia presentation or for mixing music.

Magnetic Ink Card Reader (MICR)


MICR input device is generally used in banks as there are large number of
cheques to be processed every day. The bank's code number and cheque
number are printed on the cheques with a special type of ink that contains
particles of magnetic material that are machine readable.

This reading process is called Magnetic Ink Character Recognition (MICR).


The main advantages of MICR is that it is fast and less error prone.
Optical Character Reader (OCR)
OCR is an input device used to read a printed text.

OCR scans the text optically, character by character, converts them into
a machine readable code, and stores the text on the system memory.
Bar Code Readers
Bar Code Reader is a device used for reading bar coded data (data in the
form of light and dark lines). Bar coded data is
generally used in labelling goods, numbering
the books, etc. It may be a handheld scanner or may be embedded in a
stationary scanner.

Bar Code Reader scans a bar code image, converts it into an alphanumeric
value, which is then fed to the computer that the bar code reader is
connected to.
Optical Mark Reader (OMR)
OMR is a special type of optical scanner used to recognize the type of mark made by pen or pencil.
It is used where one out of a few alternatives is to be
selected and marked.

It is specially used for checking the answer sheets of


examinations having multiple choice questions.

Computer - Output Devices


Following are some of the important output devices used in a computer.
Monitors
Graphic Plotter
Printer
Monitors
Monitors, commonly called as Visual Display Unit (VDU), are the main output device of a
computer. It forms images from tiny dots, called pixels that are arranged in a rectangular form. The
sharpness of the image depends upon the number of pixels.
There are two kinds of viewing screen used for monitors.

Cathode-Ray Tube (CRT)


Flat-Panel Display
Cathode-Ray Tube (CRT) Monitor
The CRT display is made up of small picture elements called pixels. The
smaller the pixels, the better the image clarity or resolution. It takes more
than one illuminated pixel to form a whole character, such as the letter ‘e’
in the word help.

A finite number of characters can be displayed on a screen at once. The screen can be divided into a
series of character boxes - fixed location on the screen where a standard character can be placed.
Most screens are capable of displaying 80 characters of data horizontally and 25 lines vertically.
There are some disadvantages of CRT −
Large in Size
High power consumption
Flat-Panel Display Monitor
The flat-panel display refers to a class of video devices that have
reduced volume, weight and power requirement in comparison to the
CRT. You can hang them on walls or wear them on your wrists.
Current uses of flat-panel displays include calculators, video games,
monitors, laptop computer, and graphics display.

The flat-panel display is divided into two categories −


Emissive Displays − Emissive displays are devices that convert electrical energy into light. For
example, plasma panel and LED (Light-Emitting Diodes).
Non-Emissive Displays − Non-emissive displays use optical effects to convert sunlight or light from
some other source into graphics patterns. For example, LCD (Liquid-Crystal Device).
Printers
Printer is an output device, which is used to print information on paper.
There are two types of printers −
Impact Printers
Non-Impact Printers
Impact Printers
Impact printers print the characters by striking them on the ribbon, which is then pressed on the
paper.
Characteristics of Impact Printers are the following −
Very low consumable costs
Very noisy
Useful for bulk printing due to low cost
There is physical contact with the paper to produce an image
These printers are of two types −
Character printers
Line printers
Character Printers
Character printers are the printers which print one character at a time.
These are further divided into two types:
Dot Matrix Printer(DMP)
Daisy Wheel
Dot Matrix Printer
In the market, one of the most popular printers is Dot Matrix
Printer. These printers are popular because of their ease of printing
and economical price. Each character printed is in the form of
pattern of dots and head consists of a Matrix of Pins of size (5*7,
7*9, 9*7 or 9*9) which come out to form a character which is why
it is called Dot Matrix Printer.

Advantages
Inexpensive
Widely Used
Other language characters can be printed
Disadvantages
Slow Speed
Poor Quality
Daisy Wheel
Head is lying on a wheel and pins corresponding to characters
are like petals of Daisy (flower) which is why it is called
Daisy Wheel Printer. These printers are generally used for
word-processing in offices that require a few letters to be sent
here and there with very nice quality.

Advantages
More reliable than DMP
Better quality
Fonts of character can be easily changed
Disadvantages
Slower than DMP
Noisy
More expensive than DMP
Line Printers
Line printers are the printers which print one line at a time.

These are of two types −


Drum Printer
Chain Printer
Drum Printer
This printer is like a drum in shape hence it is called drum printer. The surface of the drum is
divided into a number of tracks. Total tracks are equal to the size of the paper, i.e. for a paper width
of 132 characters, drum will have 132 tracks. A character set is embossed on the track. Different
character sets available in the market are 48 character set, 64 and 96 characters set. One rotation of
drum prints one line. Drum printers are fast in speed and can print 300 to 2000 lines per minute.
Advantages
Very high speed
Disadvantages
Very expensive
Characters fonts cannot be changed
Chain Printer
In this printer, a chain of character sets is used, hence it is called Chain Printer. A standard character
set may have 48, 64, or 96 characters.
Advantages
Character fonts can easily be changed.
Different languages can be used with the same printer.
Disadvantages
Noisy
Non-impact Printers
Non-impact printers print the characters without using the ribbon. These printers print a complete
page at a time, thus they are also called as Page Printers.
These printers are of two types −
Laser Printers
Inkjet Printers
Characteristics of Non-impact Printers
Faster than impact printers
They are not noisy
High quality
Supports many fonts and different character size
Laser Printers
These are non-impact page printers. They use laser lights to produce
the dots needed to form the characters to be printed on a page.

Advantages
Very high speed
Very high quality output
Good graphics quality
Supports many fonts and different character size
Disadvantages
Expensive
Cannot be used to produce multiple copies of a document in a single printing
Inkjet Printers
Inkjet printers are non-impact character printers based on a
relatively new technology. They print characters by spraying small
drops of ink onto paper. Inkjet printers produce high quality output
with presentable features.

They make less noise because no hammering is done and these have
many styles of printing modes available. Color printing is also
possible. Some models of Inkjet printers can produce multiple
copies of printing also.
Advantages
High quality printing
More reliable
Disadvantages
Expensive as the cost per page is high
Slow as compared to laser printer
Computer - Memory
Computer - Memory
A memory is just like a human brain. It is used to store data and instructions. Computer memory is
the storage space in the computer, where data is to be processed and instructions required for
processing are stored. The memory is divided into large number of small parts called cells. Each
location or cell has a unique address, which varies from zero to memory size minus one. For
example, if the computer has 64k words, then this memory unit has 64 * 1024 = 65536 memory
locations. The address of these locations varies from 0 to 65535.
Memory is primarily of three types −
Cache Memory
Primary Memory/Main Memory
Secondary Memory
Cache Memory
Cache memory is a very high speed semiconductor memory which can speed up the CPU. It acts as
a buffer between the CPU and the main memory. It is used to hold those parts of data and program
which are most frequently used by the CPU. The parts of data and programs are transferred from the
disk to cache memory by the operating system, from where
the CPU can access them.

Advantages
The advantages of cache memory are as follows −
Cache memory is faster than main memory.
It consumes less access time as compared to main memory.
It stores the program that can be executed within a short
period of time.
It stores data for temporary use.
Disadvantages
The disadvantages of cache memory are as follows −
Cache memory has limited capacity.
It is very expensive.
Primary Memory (Main Memory)
Primary memory holds only those data and instructions on which the computer is currently working.
It has a limited capacity and data is lost when power is switched
off. It is generally made up of semiconductor device. These
memories are not as fast as registers. The data and instruction
required to be processed resides in the main memory. It is divided
into two subcategories RAM and ROM.

Characteristics of Main Memory


These are semiconductor memories.
It is known as the main memory.
Usually volatile memory.
Data is lost in case power is switched off.
It is the working memory of the computer.
Faster than secondary memories.
A computer cannot run without the primary memory.
Secondary Memory
This type of memory is also known as external memory or
non-volatile. It is slower than the main memory. These are
used for storing data/information permanently. CPU directly
does not access these memories, instead they are accessed via
input-output routines. The contents of secondary memories are
first transferred to the main memory, and then the CPU can
access it. For example, disk, CD-ROM, DVD, etc.

Characteristics of Secondary Memory


These are magnetic and optical memories.
It is known as the backup memory.
It is a non-volatile memory.
Data is permanently stored even if power is switched off.
It is used for storage of data in a computer.
Computer may run without the secondary memory.
Slower than primary memories.

Computer – RAM
RAM (Random Access Memory) is the internal memory of the CPU for storing data, program, and
program result. It is a read/write memory which stores data until the machine is working. As soon as
the machine is switched off, data is erased.

Access time in RAM is independent of the address, that is,


each storage location inside the memory is as easy to reach as
other locations and takes the same amount of time. Data in
the RAM can be accessed randomly but it is very expensive.
RAM is volatile, i.e. data stored in it is lost when we switch
off the computer or if there is a power failure. Hence, a
backup Uninterruptible Power System (UPS) is often used
with computers. RAM is small, both in terms of its physical
size and in the amount of data it can hold.
RAM is of two types −
Static RAM (SRAM)
Dynamic RAM (DRAM)
Static RAM (SRAM) :-The word static indicates that the memory retains its contents as long as
power is being supplied. However, data is lost when the power gets down due to volatile nature.
SRAM chips use a matrix of 6-transistors and no capacitors. Transistors do not require power to
prevent leakage, so SRAM need not be refreshed on a regular basis.
There is extra space in the matrix, hence SRAM uses more chips than DRAM for the same amount
of storage space, making the manufacturing costs higher. SRAM is thus used as cache memory and
has very fast access.
Characteristic of Static RAM
Long life
No need to refresh
Faster
Used as cache memory
Large size
Expensive
High power consumption
Dynamic RAM (DRAM)
DRAM, unlike SRAM, must be continually refreshed in order to maintain the data. This is done by
placing the memory on a refresh circuit that rewrites the data several hundred times per second.
DRAM is used for most system memory as it is cheap and small. All DRAMs are made up of
memory cells, which are composed of one capacitor and one transistor.
Characteristics of Dynamic RAM
Short data lifetime
Needs to be refreshed continuously
Slower as compared to SRAM
Used as RAM
Smaller in size
Less expensive
Less power consumption
ROM
ROM stands for Read Only Memory. The memory from which we can
only read but cannot write on it. This type of memory is non-volatile.
The information is stored permanently in such memories during
manufacture. A ROM stores such instructions that are required to start a
computer. This operation is referred to as bootstrap. ROM chips are not
only used in the computer but also in other electronic items like washing
machine and microwave oven.

Let us now discuss the various types of ROMs and their characteristics.
MROM (Masked ROM)
The very first ROMs were hard-wired devices that contained a pre-programmed set of data or
instructions. These kind of ROMs are known as masked ROMs, which are inexpensive.
PROM (Programmable Read Only Memory)
PROM is read-only memory that can be modified only once by a user. The user buys a blank
PROM and enters the desired contents using a PROM program. Inside the PROM chip, there are
small fuses which are burnt open during programming. It can be programmed only once and is not
erasable.
EPROM (Erasable and Programmable Read Only Memory)
EPROM can be erased by exposing it to ultra-violet light for a duration of up to 40 minutes.
Usually, an EPROM eraser achieves this function. During programming, an electrical charge is
trapped in an insulated gate region. The charge is retained for more than 10 years because the
charge has no leakage path. For erasing this charge, ultra-violet light is passed through a quartz
crystal window (lid). This exposure to ultra-violet light dissipates the charge. During normal use,
the quartz lid is sealed with a sticker.
EEPROM (Electrically Erasable and Programmable Read Only Memory)
EEPROM is programmed and erased electrically. It can be erased and reprogrammed about ten
thousand times. Both erasing and programming take about 4 to 10 ms (millisecond). In EEPROM,
any location can be selectively erased and programmed. EEPROMs can be erased one byte at a
time, rather than erasing the entire chip. Hence, the process of reprogramming is flexible but slow.
Advantages of ROM
The advantages of ROM are as follows −
Non-volatile in nature
Cannot be accidentally changed
Cheaper than RAMs
Easy to test
More reliable than RAMs
Static and do not require refreshing
Contents are always known and can be verified
Motherboard
The motherboard serves as a single platform to
connect all of the parts of a computer together. It
connects the CPU, memory, hard drives, optical
drives, video card, sound card, and other ports and
expansion cards directly or via cables. It can be
considered as the backbone of a computer.

Features of Motherboard
A motherboard comes with following features −
Motherboard varies greatly in supporting various types of components.
Motherboard supports a single type of CPU and few types of memories.
Video cards, hard disks, sound cards have to be compatible with the motherboard to function
properly.
Motherboards, cases, and power supplies must be compatible to work properly together.
Popular Manufacturers
Following are the popular manufacturers of the motherboard.
Intel
ASUS
AOpen
ABIT
Biostar
Gigabyte
MSI
Description of Motherboard
The motherboard is mounted inside the case and is securely attached via small screws through pre-
drilled holes. Motherboard contains ports to connect all of the internal components. It provides a
single socket for CPU, whereas for memory, normally one or more slots are available.
Motherboards provide ports to attach the floppy drive, hard drive, and optical drives via ribbon
cables. Motherboard carries fans and a special port designed for power supply.
There is a peripheral card slot in front of the motherboard using which video cards, sound cards, and
other expansion cards can be connected to the motherboard.
On the left side, motherboards carry a number of ports to connect the monitor, printer, mouse,
keyboard, speaker, and network cables. Motherboards also provide USB ports, which allow
compatible devices to be connected in plug-in/plug-out fashion. For example, pen drive, digital
cameras, etc.
Computer - Memory Units
Memory unit is the amount of data that can be stored in the storage unit. This storage capacity is
expressed in terms of Bytes.
The following table explains the main memory storage units −
S.No. Unit & Description
Bit (Binary Digit)
1 A binary digit is logical 0 and 1 representing a passive or an
active state of a component in an electric circuit.
Nibble
2
A group of 4 bits is called nibble.
Byte
3 A group of 8 bits is called byte. A byte is the smallest unit,
which can represent a data item or a character.
Word
A computer word, like a byte, is a group of fixed number of
bits processed as a unit, which varies from computer to
computer but is fixed for each computer.
4
The length of a computer word is called word-size or word
length. It may be as small as 8 bits or may be as long as 96 bits.
A computer stores the information in the form of computer
words.
The following table lists some higher storage units −
S.No. Unit & Description
Kilobyte (KB)
1
1 KB = 1024 Bytes
Megabyte (MB)
2
1 MB = 1024 KB
GigaByte (GB)
3
1 GB = 1024 MB
TeraByte (TB)
4
1 TB = 1024 GB
PetaByte (PB)
5
1 PB = 1024 TB
Computer - Ports
A port is a physical docking point using which an external device can be connected to the computer.
It can also be programmatic docking point through which information flows from a program to the
computer or over the Internet.
Characteristics of Ports
A port has the following characteristics −
External devices are connected to a computer using cables and ports.
Ports are slots on the motherboard into which a cable of external device is plugged in.
Examples of external devices attached via ports are the mouse, keyboard, monitor, microphone,
speakers, etc.
Let us now discuss a few important types of ports −
Serial Port
Used for external modems and older computer mouse
Two versions: 9 pin, 25 pin model
Data travels at 115 kilobits per second
Parallel Port
Used for scanners and printers
Also called printer port
25 pin model
IEEE 1284-compliant Centronics port
PS/2 Port
Used for old computer keyboard and mouse
Also called mouse port
Most of the old computers provide two PS/2 port, each for the mouse and keyboard
IEEE 1284-compliant Centronics port
Universal Serial Bus (or USB) Port
It can connect all kinds of external USB devices such as external hard disk, printer, scanner, mouse,
keyboard, etc.
It was introduced in 1997.
Most of the computers provide two USB ports as minimum.
Data travels at 12 megabits per seconds.
USB compliant devices can get power from a USB port.
VGA Port
Connects monitor to a computer's video card.
It has 15 holes.
Similar to the serial port connector. However, serial port connector has pins, VGA port has holes.
Power Connector
Three-pronged plug.
Connects to the computer's power cable that plugs into a power bar or wall socket.
Firewire Port
Transfers large amount of data at very fast speed.
Connects camcorders and video equipment to the computer.
Data travels at 400 to 800 megabits per seconds.
Invented by Apple.
It has three variants: 4-Pin FireWire 400 connector, 6-Pin FireWire 400 connector, and 9-Pin
FireWire 800 connector.
Modem Port
Connects a PC's modem to the telephone network.
Ethernet Port
Connects to a network and high speed Internet.
Connects the network cable to a computer.
This port resides on an Ethernet Card.
Data travels at 10 megabits to 1000 megabits per seconds depending upon the network bandwidth.
Game Port
Connect a joystick to a PC
Now replaced by USB
Digital Video Interface, DVI port
Connects Flat panel LCD monitor to the computer's high-end video graphic cards.
Very popular among video card manufacturers.
Sockets
Sockets connect the microphone and speakers to the sound card of the computer.
Computer - Hardware
Hardware represents the physical and tangible components of a computer, i.e. the components that
can be seen and touched.
Examples of Hardware are the following −
Input devices − keyboard, mouse, etc.
Output devices − printer, monitor, etc.
Secondary storage devices − Hard disk, CD, DVD, etc.
Internal components − CPU, motherboard, RAM, etc.
Relationship between Hardware and Software
Hardware and software are mutually dependent on each other. Both of them must work together to
make a computer produce a useful output.
Software cannot be utilized without supporting hardware.
Hardware without a set of programs to operate upon cannot be utilized and is useless.
To get a particular job done on the computer, relevant software should be loaded into the hardware.
Hardware is a one-time expense.
Software development is very expensive and is a continuing expense.
Different software applications can be loaded on a hardware to run different jobs.
A software acts as an interface between the user and the hardware.
If the hardware is the 'heart' of a computer system, then the software is its 'soul'. Both are
complementary to each other.

MCQ

1. Which of the following languages is more suited to a structured program?


A. PL/1
B. FORTRAN
C. BASIC
D. PASCAL
E. None of the above

2. A computer assisted method for the recording and analyzing of existing or hypothetical systems
is
A. Data transmission
B. Data flow
C. Data capture
D. Data processing
E. None of the above

3. The brain of any computer system is


A. ALU
B. Memory
C. CPU
D. Control unit
E. None of the above

4. What difference does the 5th generation computer have from other generation computers?
A. Technological advancement
B. Scientific code
C. Object Oriented Programming
D. All of the above
E. None of the above
5. Which of the following computer language is used for artificial intelligence?
A. FORTRAN
B. PROLOG
C. C
D. COBOL
E. None of the above

6. The tracks on a disk which can be accessed without repositioning the R/W heads is
A. Surface
B. Cylinder
C. Cluster
D. All of the above
E. None of the above

7. Which of the following is the 1's complement of 10?


A. 01
B. 110
C. 11
D. 10
E. None of the above

8. A section of code to which control is transferred when a processor is interrupted is known as


A. M
B. SVC
C. IP
D. MDR
E. None of the above

9. Which part interprets program instructions and initiate control operations.


A. Input
B. Storage unit
C. Logic unit
D. Control unit
E. None of the above

10. The binary system uses powers of


A. 2
B. 10
C. 8
D. 16
E. None of the above

11. Codes consisting of light and dark marks which may be optically read is known as
A. Mnemonics
B. Bar code
C. Decoder
D. All of the above
E. None of the above

12. A type of channel used to connect a central processor and peripherals which uses multipling is
known as
A. Modem
B. Network
C. Multiplexer
D. All of the above
E. None of the above
13. The first generation of computers available was based on the bit micro processors.
A. 4
B. 8
C. 16
D. 64
E. None of the above
14. The complete picture of data stored in database is known as
A. Record
B. Schema
C. System flowchart
D. DBMS
E. None of the above
15. Which of the following is intended to be used in all applications runs on mainframe computers.
A. LOGO
B. APL
C. PL/1
D. OCCAM
E. None of the above
16. A language which is close to that used within the computer is
A. High-level language
B. Assembly language
C. Low-level language
D. All of the above
E. None of the above
17. Which is a unit representing the no bits of discrete.
A. Baud
B. Byte
C. Bit
D. All of the above
E. None of the above
18. The device that can both feed data into and accept data from a computer is
A. ALU
B. CPU
C. Input-Output device
D. All of the above
E. None of the above
19. The personnel who deals with the computer & its management put together are called
A. Software
B. Humanware
C. Firmware
D. Hardware
E. None of the above
20. A modern digital computer has
A. Extremely high speed
B. Large memory
C. Almost unlimited array
D. All of the above
E. None of the above
21. Backing storage is so named because it
A. is always kept at the back of the CP.U.
B. is slow and backward
C. backs up the computer's main memory
D. lags behind the main memory
E. None of the above
22. The ASCII code for the character J is:
A. 1001 0001
B. 1001 1010
C. 0100 1010
D. 1010 0001
E. None of the above
23. Off-line operation is the operation of devices without the control of
A. Memory
B. CPU
C. ALU
D. Control unit
E. None of the above
24. What is meant by a dedicated computer?
A. Which is used by one person only
B. Which is assigned one and only one task
C. Which uses on kind of software
D. Which is meant for application software only
E. None of the above
25. Which of the following is the user programmed semiconductor memory?
A. SRAM
B. DRAM
C. EPROM
D. All of the above
E. None of the above
26. An instruction that transfers program control to one or more possible paths is known as
A. Utility program
B. System software
C. Broadband channel
D. Application program
E. None of the above
27. The two kinds of main Memory are:
A. Primary and secondary
B. Random and sequential
C. ROM and RAM
D. All of the above
E. None of the above
28. Name of the first guided weapon in the world which used a programmable digital computer:
A. Sting Ray Torpedo
B. Mk 46 Torpedo
C. Air-Launched Cruise Missile (ALCM)
D. Tomahawk Missile
E. None of the above
29. Programs designed to perform specific tasks is called known as
A. System software
B. Application software
C. Utility programs
D. Operating system
E. None of the above
30. What is the name given to the weapons which use computerised guidance system?
A. Guided weapons
B. Smart weapons
C. Dumb weapons
D. Starwars weapons
E. None of the above

QUESTION :-
1 What is a Computer? Write the functions of computer?
2 Write the advantages and disadvantages of computer?
3 Discuss about 1st and 2nd generation of computer?
4 Discuss about 3rd and 4th generations of computer?
5 Discuss about fifth generation of computer? What is AI?
6 Short note :- Workstation , mini, supercomputer, mainframe, CPU ,ALU,RAM,
ROM,EPROM.EROM.STATIC RAM, DIANAMIC RAM?
7. Discuss about various type of monitor and printer?
8. What if cache memory? write advantage and disadvantage?
9. What is motherboard? write the name of its components?
10. what is port? Discuss about various ports of computer?

IDENTIFY THE PORTS


UNIT II: DATA REPRESENTATION
Number System :- The technique to represent and work with numbers is called number system.
Decimal number system is the most common number system. Other popular number systems include
binary number system, octal number system, hexadecimal number system, etc.

LETS DISCUSS ABOUT VERIOUS NUMBER SYSTEM AND CONVERT THEM TO


DECIMAL number system and vice-versa

Decimal number SYSTEM , also called Hindu-


Arabic, or Arabic, number system, in mathematics,
positional numeral system employing 10 as
the base and requiring 10 different numerals, the
digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. It also requires a dot
(decimal point) to represent decimal fractions. In
this scheme, the numerals used in denoting a
number take different place values depending upon
Decimal to Binary
To convert a decimal number into an equivalent binary number we have to divide the original number system by 2
until the quotient is 0, when no more division is possible. The remainder so obtained is counted for the required
number in the order of LSB (Least significant bit) to MSB (most significant bit). Let us go through the example.

Binary to Decimal
In this conversion, a number with base 2 is converted into number with base 10. Each binary digit
here is multiplied by decreasing power of 2. Let us see one example:
Octal to Decimal
In this conversion, a number with base 8 is converted into number with base 10. Each digit of octal
number here is multiplied by decreasing power of 8. Let us see one example:

Decimal to Octal
Here the decimal number is required to be divided by 8 until the quotient is 0. Then, in the same way,
we count the remainder from LSB to MSB to get the equivalent octal number.

Hexadecimal to Decimal
In this conversion, a number with base 16 is converted into number with base 10. Each digit of hex
number here is multiplied by decreasing power of 16. Let us understand with the help of an example:

Decimal to Hexadecimal
The given decimal number here is divided by 16 to get the equivalent hex. The division of the
number continues until we get the quotient 0.
Binary Arithmetic Operations
; Like we perform the arithmetic operations in numerals, in the same way, we can perform addition, subtraction,
multiplication and division operations on Binary numbers. Let us learn them one by one.

Binary Addition
Adding two binary numbers will give us a binary number itself. This is the simplest method. Addition
of two single-digit binary number is given in the table below.

Let us take an example of two binary numbers and


add them.
For example: Add 11012 and 10012.
Solution:

Binary Subtraction
Subtracting two binary numbers will give us a binary
number itself. This is also an easy method. Subtraction of
two single-digit binary number is given in the table
below.
Let us take an example of two binary numbers and
subtract them.
Example: Subtract 11012 and 10102.
Solution:
Binary Multiplication
The multiplication process is the same for the Binary Division
binary numbers as it is for numerals. Let us The binary division is similar to the decimal number
understand it with example. division method. We will learn with an example
Let’s multiply 1101 x 1010 here.
Example: Divide 10102 by 102
Solution:

INTRODUCTION TO LOGIC GATES

Logic gates are the basic building blocks of any digital system. It is an electronic circuit having one or more than
one input and only one output. The relationship between the input and the output is based on certain logic. Based
on this, logic gates are named as AND gate, OR gate, NOT gate etc.

The AND gate(logical multiplication)


• An AND gate accepts two input signals
• If the two input values for an AND gate are
both 1, the output is 1; otherwise, the
output is 0

OR GATE(Logical addition
• If the two input values are both 0, the
output value is 0; otherwise, the output is 1

NOT Gate
NOT gate is also known as Inverter. It has one
input A and one output Y.
XOR Gate
• XOR, or exclusive OR, gate
– An XOR gate produces 0 if its two inputs are
the same, and a 1 otherwise
– Note the difference between the XOR gate
and the OR gate; they differ only in one
input situation
– When both input signals are 1, the OR gate
produces a 1 and the XOR produces a 0

The NAND gate operates as an AND gate followed


by a NOT gate. It acts in the manner of the logical
operation "and" followed by negation. The output is
"false" if both inputs are "true." Otherwise, the
output is "true."

The NOR gate is a combination OR gate followed by an


inverter. Its output is "true" if both inputs are "false."
Otherwise, the output is "false.
A. MULTIPLE CHOICE QUESTIONS :-
1. Which of the following is not a type of number system?
a) Positional
b) Non-Positional
c) Octal
d) Fractional
2. How is the number 5 represented in non-positional number system?
a) IIIII
b) 5
c) V
d) v
3. The base is the total number of digits in a number system.
a) True
b) False
4. The LSB and MSB of 1243247 are ____ and ____
a) 1, 7
b) 4, 7
c) 7, 1
d) 4, 1
5. A device that uses positional notation to represent a decimal number.
a) Abacus
b) Calculator
c) Pascaline
d) Computer
6. The 2’s complement of 5 is ______________
a) 1011
b) 0101
c) 1010
d) 0011
7. What does BCD stand for?
a) Bitwise coded decimal
b) Binary coded decimal
c) Binary converted decimal
d) Bitwise Converted Decimal
8. 1 zettabyte = ______________
a) 1024 TB
b) 1024 EB
c) 1024 ZB
d) 1024 PB
9. Perfrom BCD addition: 2+3= _______________
a) 0010
b) 0011
c) 0101
d) 1010
10. ASCII stands for _____________________
a) American standard code for information interchange
b) American scientific code for information interchange
c) American scientific code for international interchange
d) American standard code of international interchange
11. The value of base in a decimal number system is ____________
a) 8
b) 2
c) 10
d) 16
12. Convert : (110)2 = ( __ )10.
a) 4
b) 5
c) 6
d) 9
13. The 2’s complement of 15 is ____________
a) 0000
b) 0001
c) 0010
d) 0100
14. Another name for base is __________
a) root
b) radix
c) entity
d) median
15. The decimal equivalent of (0.101)2 will be ____________
a) 0.5
b) 0.625
c) 0.25
d) 0.875
16. The signed magnitude for -3 will be ___________
a) 00000011
b) 10000011
c) 11111101
d) 11111100
17. A number with both integer and a fractional part has digits raised to both positive and negative powers of 2 in a decimal
number system.
a) True
b) False
18. The hexadecimal representation of 14 is _______________
a) A
b) F
c) D
d) E
19. Which of the following is not a decimal number?
a) 114
b) 43.47
c) 99.9A
d) 10101
20. Which of the following is not a positional number system?
a) Roman Number System
b) Octal Number System
c) Binary Number System
d) Hexadecimal Number System
21. The value of radix in binary number system is _____________
a) 2
b) 8
c) 10
d) 1
22. The binary equivalent of the decimal number 10 is __________
a) 0010
b) 10
c) 1010
d) 010
23. A computer language that is written in binary codes only is _____
a) machine language
b) C
c) C#
d) pascal
24. The octal equivalent of 1100101.001010 is ______
a) 624.12
b) 145.12
c) 154.12
d) 145.21
25. The input hexadecimal representation of 1110 is _______________
a) 0111
b) E
c) 15
d) 14

B. PRACTICE QUESTIONS :-
I- BINARY ADDITION :- 10110+10100+111010 , 1011101+10111+110101 , 101101010+1111110
II- Binary Substruction:- 101010-101010 , 1011010-101010 , 10111-1010
III- Binary Multiplication:- 1011010*101000 , 10101011*1110101 , 10111*101
IV- Divition:- 110101/1101 , 1011011/110 , 10110/10 , 10111/10 , 101111/111
V- Describe :- AND ,OR ,NOR, XOR ,NAND , NOR Gates with a proper logic diagram and truth table,
VI-What is negative number give example
VII -Add the number using 1’s and 2’s compliment 101101+101010 , 10110+10111, 101+101 , 1010111+1011,1010+1111
UNIT: III INTRODUCTION TO DOS AND
WINDOWS
Disk Operating System
DOS (Disk Operating System) is an operating system that runs from a hard disk drive. The term
can also refer to a particular family of disk operating systems, most commonly MS-DOS
(Microsoft Disk Operating System).

Features of Dos
* It is the primary system where the user will get an environment about the input and output
deviates, e.g. Monitor, Keyboard, Printers etc.
* It is helpful in performing file management e.g., creating, editing, deleting files etc.
* It is a single user operating system. ...
* It is Character Based interface system.

Booting: When we start our Computer then there is an operation which is performed
automatically by the Computer which is also called as Booting. In the Booting, System
will check all the hardware’s and Software’s those are installed or Attached with the
System and this will also load all the Files those are needed for running a system.

There are two Types of Booting


1) Warm Booting: when the System Starts from the Starting or from initial State
Means when we Starts our System this is called as warm Booting. In the Warm
Booting the System will be Started from its beginning State means first of all, the user
will press the Power Button , then this will read all the instructions from the ROM and
the Operating System will b Automatically gets loaded into the System.
2) Cold Booting: The Cold Booting is that in which System Automatically Starts
when we are Running the System, For Example due to Light Fluctuation the system
will Automatically Restarts So that in this Chances Damaging of system are More.
and the System will no be start from its initial State So May Some Files will b
Damaged because they are not Properly Stored into the System.
COMPARISON BETWEEN DOS AND WINDOWS:-
*Dos is only single tasking while Windows is multitasking.
*Dos is based on plain interface while Windows is based on Graphical user interface (GUI).
*Dos is difficult to learn and understand while Windows is easy to learn and understand.
*Dos is less preferable by users while Windows is more preferable operating system.
*Limited users can work on dos while in Windows there are many users.
*We cannot see mouse in Dos while in Windows we can see and use mouse to click on icons or links.
*In Dos we cannot Play games, watch movies and listen songs while in Windows we can enjoy playing
games, watching movies and listening songs.
*In Dos new hardware cannot work properly while in Windows it can detect and installs software
automatically.
*Application and system software¡¦s did not work properly in Dos while in Windows it runs at a great
speed.
*Dos is not user friendly while Windows operating system is user friendly.
*Dos performs operations speedily as compared with Windows operating system.
To switch between open programs on your
The MS-DOS file-system is very computer:
straightforward. It is a 16-bit system based on Open two or more programs. ...
a File Allocation Table, or FAT16 (FAT for Press Alt+Tab. ...
short). The purpose of the file allocation table Press and hold Alt+Tab. ...
is to keep track of where to find files on the Release the Tab key but keep Alt pressed down; press
disk. In MS-DOS, every DOS based partition Tab until you reach the program you want. ...
Release the Alt key. ...
has a letter: (A: or B: or C:)
To switch back to the last program that was active,
simply press Alt+Tab.

STARTING DOS
Step 1 : click on start button
Step 2 : Search for Command Prompt And click on it
Method 2
Step1 :-Press Windows + R key together
Step 2 : Type CMD in the run box
Step 3 : hit enter button and command prompt will open

DOS commands are small programs, which are made to perform a particular job. Every
DOS command performs different task. It is not possible to work on the computer
without these commands. There are two types of DOS command.

Internal Commands : These commands enter into the computer memory during
computer booting. These commands are not in the form of any file; so neither they can
be viewed nor can be edited or detected. For example : MD, CD, TIME, DATE,
COPY, COPR CON, TYPE ETC.
External Commands : These commands are stored in the computer list in the form of
files. These Commands can be viewed, copied, changed or deleted. For example :
FORMAT, COPY, PRINT, SYS, EDIT, TREE, SORT, PROMPT etc.
SOME DOS COMMANDS AND THERE TYPES:-

cd : Change directory or display current directory path.


cls : Clear the window.
dir : Display list of contents of current directory.
help : Display list of commands or help about a command.
notepad : Run the Windows Notepad text editor.
type : Displays the contents of a text file.
assoc : Displays or modifies filename extension associations.
attrib : Displays or changes file attributes.
call : Calls one batch program file from another.
chkdsk : Checks a disk and displays a status report.
chkntfs : Displays or modifies the checking of disk at startup.
color : Sets the text and background colors.
comp : Compares the contents of two files or sets of files.
copy : Copies one or more files to another location. See also: xcopy
date : Displays or sets the computer's date. See also: time
del (or erase) : Deletes one or more files.
defrag : Defragment the specified storage device.
echo : Displays messages, or turns command echoing on/off.
edit : Runs the MS-DOS text editor. See also: notepad
exit : Closes the MS-DOS window.
fc : Compares two files or sets of files and displays the differences.
find : Searches for a text string in a file or files.
findstr : Search for a regular expression text string in a file or files.
goto : Used in a batch program file to jump to a particular line.
if : Used in a batch program file to perform conditional testing.
md (or mkdir) : Creates a directory.
more : Displays the contents of a file one screen at a time.
move : Moves one or more files from one directory to another
directory.
rd (or rmdir) : Removes a directory.
rem : Used in a batch program file to identify comments.
ren (or rename) : Renames a file or files.
sort : Sorts input.
start : Starts a new window to run a specified program or
command.
time : Displays or sets the computer's time. See also: date
tree : Graphically displays the directory structure of a drive or
directory.
xcopy : Copies files and directory trees. See also: copy
The following internet related commands are not part of MS-DOS but
can be
typed at the MS-DOS command prompt:
arp : Displays ARP (address resolution protocol) translation tables.
ftp : FTP (file transfer program) to transfer files to/from server.
ipconfig : Displays internet configuration, including IP address.
netsh : Network services shell.
nslookup : Lookup IP address to/from domain name.
netstat : Displays current TCP/IP network connections and statistics.
ping : Ping the specified internet IP address or host name.
telnet : Starts a text-based telnet session to the specified host.
tftp : Transfers files to/from remote computer running TFTP service.
tracert : Traces the route to the specified IP address or host.
The following command are not part of MS-DOS and do not come
with
Windows but are available from third-parties. Some are equivalent to
the Linux utility by the same name.
config : Defragment one or more files (rather than entire drive).
clip : Copy command output to Windows clipboard. See: paste
du : Displays disk usage for selected files or directories.
lynx : Text based web browser.
paste : Paste Windows clipboard to command input. See: clip
strings : Find all strings of a specified minimum length.
whois : Lookup domain ownership information.
Copying a single file
Using the cd command, move to the directory that contains the file
you want to copy.
Type a command similar to the following command.
copy myfile.txt c:\my\location
In the example above, you would substitute "myfile.txt" with the
name of the file you want to copy, and "c:\my\location" with the
destination directory. To see files available in the current directory
use the dir command.
Copying multiple files to another location
Below are the steps on how to copy multiple files from one directory
to another directory.
Using the cd command, move to the directory that contains the files
you want to copy.
Once in the directory that contains the files you want to copy, type a
command similar to one of the following commands.
copy *.* c:\mydir
In the example above, the command would copy every file in the
current directory to the "mydir" directory.
copy *.txt c:\mydir
In the example above, the command would copy every txt, or text file,
in the current directory into the "mydir" directory.

What is Windows Operating System?


By definition, an Operating System is a group of several GUIs
(Graphical User Interface) families, all of which are developed, sold
and marketed by Microsoft.
The latest version of Microsoft Operating System which is being
widely used across the world is Windows 10.
History and Development of Windows
It was 1983 when work on “Interface Manager” was started by
Microsoft but it was in November 1995, when the first Windows 1.0
was introduced. Later on, with developments in technology, the
requirement of the people and increased demand for Graphical User
Interface, Microsoft kept releasing revised versions of Operating
Systems.
Versions of Windows Operating System
Let us understand the different versions of Windows Operating System along with the features
of each of them individually.
1. Windows 1.0
It was released on November 20, 1985
Pure Operating Environment
Used Graphical User Interface
Simple Graphics
Offered limited multi-tasking was expected to have a better future potential
2. Windows 2.0
It was released on December 9, 1987
16-bit Graphic User Interface (GUI) based operating environment
Introduced Control Panel, and the first version of MS Word and Excel
Unlike Windows 1.0, it had the capacity to allow applications to overlap each other
It was also the last Windows OS which did not require a hard disk
Hardware played an important role
3. Windows 3.0
It was released in 1990
It was better at multitasking
Used 8086 microprocessors
It has both, conventional and extendable memory
First version of Windows to gather critical appreciation
Better memory/ storage
Note* – None of the above mentioned Windows was Operating Systems. They all came under
the category of Windows, working based on a graphical operating environment. It was
Windows 95, which was the first Operating System released by Microsoft.
4. Window 95
It was the first complete Operating System
It was released on August 15, 1995
It merged MS-DOS and Windows products
It simplified plug and play features
Taskbar and Start menu was introduced with this Windows OS
Advanced from 16 bit GUI to 32 bit GUI
Long file names could be saved
Initially, computers with Windows 95 did not have Internet Explorer installed but by the release
date of Windows 95, the first version of Internet Explorer was installed in the software
On December 31, 2001, Windows declared this version of OS outdated and ended its support
for the same
5. Windows 98
It was released to manufacturing on May 15, 1998
It was a 16 bit and 32 bit product based on MS DOS
It was not an entirely new version but just a tuned-up version to Windows 95
Internet Explorer 4.01 was released along with this Windows version
It did not support USB printers or mass storage devices
An update to this version “Windows SE” was released in 1999
6. Windows 2000
It was officially released on February 17, 2000. However, its manufacturing had begun in late
1999
A core set of features was followed for manufacturing Windows 2000 but 4 different editions,
targeting different sectors of the market were released. These included: Server, Professional,
Advanced Server and Datacenter Server
It was considered as one of the most secure OS ever
A local disk manager was introduced with these Windows
Multilingual User Interface – it supported many different languages
7. Windows XP
While the manufacturing started on August 24, 2001, the official product was released on
October 25, 2001
Advanced portable PC support
Automatic wireless connection support
Fast start-up
Better Graphical User Interface (GUI)
Help and support centre
8. Windows Vista
It was released on January 30, 2007
It had an upgraded version of Graphical User Interface
It was the first operating system to use DVD-ROM for installation
9. Windows 7
It was released on October 22, 2009
A large number of new features were introduced
Redesigned Windows shell with an updated taskbar
Incremental upgrade to the Windows line
Libraries were added in the file management system
A few features from the past Windows were removed
Extended hardware support
10. Windows 8
It was released for retail on October 26, 2012
Optimisations for touch-based
Installed in new devices like Laptops, Mobile phones, tablets, etc.
Increased integration with cloud services
Windows Store service for software distribution
Task manager had been redesigned
New security features were introduced
Online Applications could be directly downloaded
11. Windows 10
It was released on July 29, 2015
Addresses shortcomings in the user interface first introduced with Windows 8
A virtual desktop system
It had the ability to run windows store apps within windows on the desktop rather than in the
full-screen mode
Included new icons
To reduce storage shortcomings, Windows 10 automatically compresses the file size

Introduction to WINDOWS 10 Operating system:-

1. To switch on a computer you use the power button, this is a


universal symbol for how to power on devices.
When you press this button your computer
will start “booting up”. This means your
computer is getting ready to be used and
can take anything from 30 seconds to 5
minutes depending on the computer.
2. Once the computer powers up after a
short period of time you will come to a
screen with a random artistic image as
the background.

3. Press the left mouse button once and


it will disappear and be replaced
with this. Click on “Sign in” with
the left mouse button. If you have a
password type it into the box that
appears and click the arrow button.
(If there isn’t a password created it
will just sign in straight away).

4. Windows will now load up and you will eventually come to a screen called the

Desktop.

The Desktop is split into two areas. The


strip at
the bottom, with the clock to the right
and the
square, window shaped Start button
to the left,
is called the Taskbar. We will explore this area
in a different section. But here's a closer look at it.

The rest of the Desktop is the space where all


your programmes will appear when you start them
up. This space contains default background wallpaper, but it can also contain
shortcuts to programmers, documents and folders.

Desktops can be customized and can look different depending on which


computer you’re using. For example a public network like the library may have
a computer setup to use their own logo on the Desktop and use different
software to access the internet. What is best to do is take your time to
familiarise yourself with the computer you are using.

Imagine your Desktop is just that the top of a desk, computers are designed
around the working world the office in particular. The Desktop was designed so
you have everything at hand just like sitting at your desk.

Icons and folders

1. You can customise your Desktop by adding


Icons or keeping the files you are currently
working with on the Desktop. But for the
moment you will have to get familiar what
these Icons and files look like.

Icons are symbols for what programs you


want
to launch from your Desktop,

There should be some Icons and folders on your Desktop

Let’s have a look at some Icons you may have in more detail:

2. These are Web Browsers we use for browsing the internet so we can visit
websites and search for information – we’ll look at these in detail in another
lesson.

Check the computer you are using to see what is on the Desktop, it may even
have them all

3. There are also other Icons, you can create Icons “ Also Known As Shortcuts”
they are shortcuts on the Desktop so we don’t have to delve deeper into the
computer to find the programs we want to launch.

This is an Icon and shortcut to access Microsoft Word, “A word processing


program for creating CVs, writing letters, and creating brochures
The Desktop you are using may have folders; folders are usually used to keep a bunch
of files all in the one place and can be a good way of organising all your
documents.

This is a Microsoft Word File, a file you create when using Microsoft Word. For
example if you create a
letter called Hello Katie using Microsoft Word and then saved it on your Desktop the file
would look like this.

The Taskbar

1. The Taskbar is the thin strip that runs across the bottom of your screen. It is split
into a number of different areas: a Start button, Quick Launch icons, a notification
area, and a clock. All other areas are the Taskbar itself. The image below shows
the left hand side of the taskbar.

Connecting To Wi-Fi

In this lesson we will look at connecting to the internet using Wi-Fi or wireless internet. Before going ahead
make sure you are in an area where there is Wi-Fi available, you know the name of the network and that you
have the password to access it

1. Click once on the wireless icon at the bottom right of the


taskbar.

2. Click once on the network you want to access


3. Click once on “Connect”.
(Keep the box for “Connect Automatically” checked as
it means you won’t have to do this procedure again to
connect to this network.)It may say “Checking Network
Requirements” for a few seconds.

2. Type in the password (sometimes known


as “The Key” or the “WEP”).
You will see that it comes up as little dots.
This is for security so that no one looking
over your
shoulder can see what you’re typing.
The click on “Next”

3. If all the details are correct it should


connect in a few seconds

4. Press the “ESC” key at the top right of the keyboard to come out of the network
connections. You are now connected to the internet!

Exercise 2: Shutting Down The Computer

1. Click on the Start Menu at the bottom left hand corner of


your screen.
2. Now click on Power at the bottom left

3. A drop down with three options should appear. Click


on Shut Down. Your computer should power down
in a few minutes.
A. MULTIPLE CHOICE QUESTIONS:-
1. In which version of DOS. CHKDSK command has been changed to SCANDISK?
a. 5.0
b. 6.2
c. 6.0
d. 6.2
2. MS-DOS developed in
a. 1991
b. 1984
c. 1971
d. 1961
3. CHKDSK command is used to
a. Analyze the hard disk error
b. Diagnose the hard disk error
c. Report the status of files on disk
d. All of the above
4. Which command be used to clear the screen and display the operating system prompt on the first line of the
display?
a. Cd
b. Md
c. Rename
d. Cls
5. internal command in Dos are
a. Cls, rd label
b. Dir, ren, sys
c. Time, type, dir
d. Del, disk copy, label
6. Which command is used to copy files?
a. Copy
b. Diskcopy
c. Type
d. All of the above
7. Which keys can be pressed quit without saving in DOS
a. Ctrl + A
b. Ctrl + B
c. Ctrl + C
d. Ctrl + D
8. Which command is used to get the current date only?
a. Date
b. Time
c. Second
d. All of the above
09. Generally, the DATE is entered in the form
a. DD-YY-MM
b. YY-DD-MM
c. MM-YY-DD
d. MM-DD-YY
10. DEL command is used to
a. Delete files
b. Delete directory
c. Delete labels
d. Delete contents of file
11. CHKDSK can be used to find
a. Disk’s bad portion
b. Occupied space
c. Free space
d. All of above
12. DIR command is used to
a. Display a list of files in a directory
b. Display contents of files in directory
c. Display type of files in a sub directory
d. All of above
13. While working with MS-DOS which key is used to get the previous command used:
a. F3
b. F1
c. F6
d. F9
14. FAT stands for
a. File Accomodation Table
b. File Access Tape
c. File Allocation Table
d. File Activity Table
15. Which command is used to make a new directory?
a. Md
b. Cd
c. Rd
d. None of above
16. Full form of MS-DOS is
a. Micro System Disk Operating System
b. Micro Simple Disk Operating System
c. Micro Soft Disk Operating System
d. Micro Sort Disk Operating System
17. Windows 10 was launched in which year?
a. 2015
b. 2012
c. 2014
d. 2013
18. _____ is a Window utility program that locates and eliminates unnecessary fragments and rearranges files and
unused disk space to optimize operations.
(A) Disk Defragmenter
(B) Restore
(C) Disk Cleanup
(D) Backup
19. The input device to be used to get a printed diagram into a computer, is
(A) Touch pad
(B) Scanner
(C) Mouse
(D) Printer
20. The basic operation performed by a computer is
(A) Storage and retrieval operations
(B) Logic operations
(C) Arithmetic operations
(D) All of the above
21. Which of the following operating systems is not owned and licensed by a company?
(A) Windows
(B) Mac
(C) Linux
(D) Unix
22. ___ are graphical objects used to represent commonly used application.
(A) Windows
(B) Icons
(C) Drivers
(D) GUI

SOLVE BY YOUR SELF:-

1. DEFINE DOS? WRITE THE FEATURES OF DOS?


2. WHAT IS BOOTING EXPLAIN ITS TYPES?
3. WRITE THE STEPS TO START DOS?
4. WHAT IS THE LATEST VERSION OF WINDOWS OPERATING SYSTEM?
5. HOW WE CAN CONNECT WIFI IN WINDOWS 10?
6. WRITE THE FUNCTIONS OF DATE ,TIME, MD, RD, TREE,COPY, FORMAT
COMMANDS IN DOS?
7. WHAT DO YOU KNOW ABOUT EXTERNAL AND INTERNAL COMMANDS IN DOS?

UNIT IV: INTRODUCTION TO NETWORKING


Network, a group of computers and associated devices that
are connected by communication facilities. Network is an
Types of Network 1. Wired network 2. Wireless network

Let’s Discuss about Wired Network

Lan(Local Area network)

A Local Area Network


Man(Metropolitan (LAN) is a group of computer and
area network)
peripheral devices which are connected in a limited area such
as school, laboratory, home, and office building. It is a widely
A Metropolitan Area Network or MAN is consisting of a
useful network for sharing resources like files, printers, games,
computer network across an entire city, college campus, or a
and other application.
small region. This type of network is large than a LAN, which is
mostly limited to a single building or site. Depending upon the
type of configuration, this type of network allows you to cover an
area from several miles to tens of miles.

Wan (Wide area Network)

Wan (Wide area Network)

WAN (Wide Area Network) is another important computer


network that which is spread across a large geographical area.
WAN network system could be a connection of a LAN which
connects with other LAN's using telephone lines and radio waves.
It is mostly limited to an enterprise or an organization.

Pan( Private area Network)

PAN is a computer network formed around a person. It generally


consists of a computer, mobile, or personal digital assistant. PAN
can be used for establishing communication among these personal
devices for connecting to a digital network and the internet.
2. Lets discuss about wireless media.

WIFI(Wireless Fidelity)

Wi-Fi is the name of a wireless networking technology that uses radio waves to provide wireless
high-speed Internet and network connections. A common misconception is that the term Wi-Fi is
short for "wireless fidelity," however this is not the case. Wi-Fi is simply a trademarked phrase that
means IEEE 802.11x.

Network card :- A Network interface card (also known as


a NIC, network card, or network interface controller) is an
electronic device that connects a computer to a
computer network, usually a LAN. It is considered a piece of
MODEM:A
computer modem or
hardware. broadband modem is a
hardware device that connects a computer or router
to a broadband network. ... Short for
modulator/demodulator, a modem is a
Lets discussdevice
hardware about that
some popular
allows networking
a computer devices
to send and
receive information over telephone lines

Bluetooth

Bluetooth is a wireless technology standard used for exchanging data between fixed and mobile
devices over short distances using short-wavelength UHF radio waves in the industrial, scientific and
medical radio bands, from 2.402 GHz to 2.480 GHz, and building personal area networks.

A network interface unit (NIU) :- (sometimes called


a network interface device) is a device that serves as
SWITCH :-A network switch (also called switching
hub, bridging hub, officially MAC bridge)[1] is
networking hardware that connects devices on a
computer network by using packet switching to
receive and forward data to the destination device.

NODES :Network nodes are the physical pieces


(example :-computer) that make up a network.
They usually include any device that both receives
and then communicates information. But they
might receive and store the data, relay the
information elsewhere, or create and send data
instead.
ROUTER: A router is a networking device that
forwards data packets between computer
networks. Routers perform the traffic directing
functions on the Internet. Data sent through the
internet, such as a web page or email, is in the
form of data packets.

RJ 45 CONNECTOR:-RJ45 is a type
of connector commonly used for Ethernet
networking. ... The "RJ" in RJ45 stands for
"registered jack," since it is a standardized
networking interface. The "45" simply refers to the
number of the interface standard. Each RJ45
connector has eight pins, which means
an RJ45 cable contains eight separate wires.

Lets discuss About Various Networking Cable :-


Coaxial cable :- This cable contains a conductor, insulator, braiding, and sheath. The
sheath covers the braiding, braiding covers the insulation, and the insulation covers the
The twisted-pair cable was primarily developed for computer networks. This cable is
also known as Ethernet cable. Almost all modern LAN computer networks use this
cable.
This cable consists of color-coded pairs of insulated copper wires. Every two wires are
twisted around each other to form pair. Usually, there are four pairs. Each pair has one
solid color and one stripped color wire. Solid colors are blue, brown, green and orange.
In stripped color, the solid color is mixed with the white color.
Based on how pairs are stripped in the plastic sheath, there are two types of twisted-
pair cable; UTP and STP.
In the UTP (Unshielded twisted-pair) cable, all pairs are wrapped in a single plastic
sheath.
In the STP (Shielded twisted-pair) cable, each pair is wrapped with an additional metal
shield, then all pairs are wrapped in a single outer plastic sheath.
Fiber optic cable
This cable consists of core, cladding, buffer, and jacket. The core is made from the thin
strands of glass or plastic that can carry data over the long distance. The core is
wrapped in the cladding; the cladding is wrapped in the buffer, and the buffer is
wrapped in the jacket.
Core carries the data signals in the form of the light.
Cladding reflects light back to the core.
Buffer protects the light from leaking.
The jacket protects the cable from physical damage.
Fiber optic cable is completely immune to EMI and RFI. This cable can transmit data
over a long distance at the highest speed. It can transmit data up to 40 kilometers at
the speed of 100Gbps.
Fiber optic uses light to send data. It reflects light from one endpoint to another. Based
on how many beams of light are transmitted at a given time, there are two types of
fiber optical cable; SMF and MMF.

TOPOLOGY
A network topology is the pattern in which nodes (i.e., computers, printers, routers or
other devices) are connected to a local area network (LAN) or other network via links
(e.g., twisted pair copper wire cable or optical fiber cable). There are four
principal topologies used in LANs: bus, ring, star and mesh

Lets discuss about popular network topology:-


BUS TOPOLOGY
Alternatively referred to as a liner topology, a bus topology is a network setup where each computer
and network device is connected to a single cable or backbone. Depending on the type of computer
network card, a coaxial cable or an RJ-45 network cable is used to connect them together.
Advantages of bus topology
It works well when you have a small network.
It's the easiest network topology for connecting computers or peripherals in a linear fashion.
Disadvantages of bus topology
It can be difficult to identify the problems if the whole network goes down.
Bus topology is not great for large networks.
Terminators are required for both ends of the main cable.
Additional devices slow the network down.
If a main cable is damaged, the network fails or splits into two.

STAR TOPOLOGY
Alternatively referred to as a star network, star topology is one of the most common network setups.
In this configuration, every node connects to a central network device, like a hub, switch, or
computer. The central network device acts as a server and the peripheral devices act as clients.
Advantages of star topology
Easy to add another computer to the network.
If one computer on the network fails, the rest of the network continues to function normally.
Disadvantages of star topology
May have a higher cost to implement, especially when using a switch or router as the central network
device.
If the central computer, hub, or switch fails, the entire network goes down and all computers are
disconnected from the network.

RING TOPOLOGY
A ring topology is a network configuration in which device connections create a circular data path.
Each networked device is connected to two others, like points on a circle. Together, devices in a
ring topology are referred to as a ring network.
Advantages of ring topology
All data flows in one direction, reducing the chance of packet collisions.
Data can transfer between workstations at high speeds.
Additional workstations can be added without impacting performance of the network.
Disadvantages of ring topology
All data being transferred over the network must pass through each workstation on the network,
which can make it slower than a star topology.
The entire network will be impacted if one workstation shuts down.
MESH TOPOLOGY
A network setup where each computer and network device is interconnected with one another,
allowing for most transmissions to be distributed even if one of the connections go down. It is a
topology commonly used for wireless networks.
Advantages of a mesh topology
Manages high amounts of traffic, because multiple devices can transmit data simultaneously.
A failure of one device does not cause a break in the network or transmission of data.
Adding additional devices does not disrupt data transmission between other devices.
Disadvantages of a mesh topology
The cost to implement is higher than other network topologies, making it a less desirable option.
Building and maintaining the topology is difficult and time consuming.
The chance of redundant connections is high, which adds to the high costs and potential for reduced
efficiency.
TREE TOPOLOGY
In computer networks, a tree topology is also known as a star bus topology. It incorporates elements
of both a bus topology and a star topology. Below is an example network diagram of a tree topology,
in which the central nodes of two star networks are connected to one another.
In the picture above, if the main cable or trunk between each of the two star topology networks were
to fail, those networks would be unable to communicate with each other. However, computers on the
same star topology would still be able to communicate.

OS
OS
ref
fro
on
to
OS
per
OS
Org
and
for
OS
sm
ass
Eac
to

Characteristics of OSI Model:


• The OSI model is divided into two layers: upper layers and lower layers.
• The upper layer of the OSI model mainly deals with the application related issues,
and they are implemented only in the software. The application layer is closest to
the end user. Both the end user and the application layer interact with the software
applications. An upper layer refers to the layer just above another layer.
• The lower layer of the OSI model deals with the data transport issues. The data link
layer and the physical layer are implemented in hardware and software. The
physical layer is the lowest layer of the OSI model and is closest to the physical
medium. The physical layer is mainly responsible for placing the information on the
physical medium.
Network security is any activity designed to protect the usability and integrity of
your network and data.
It includes both hardware and software technologies
It targets a variety of threats
It stops them from entering or spreading on your network
Effective network security manages access to the network

Firewalls
Firewalls put up a barrier between your trusted internal network and untrusted
outside networks, such as the Internet. They use a set of defined rules to allow or
block traffic. A firewall can be hardware, software, or both. Cisco offers unified
threat management (UTM) devices and threat-focused next-generation firewalls.

Physical Network Security


Physical security controls are designed to prevent unauthorized personnel from
gaining physical access to network components such as routers, cabling cupboards
and so on. Controlled access, such as locks, biometric authentication and other
devices, is essential in any organization.
Technical Network Security
Technical security controls protect data that is stored on the network or which is in
transit across, into or out of the network. Protection is twofold; it needs to protect
data and systems from unauthorized personnel, and it also needs to protect against
malicious activities from employees.
Administrative Network Security
Administrative security controls consist of security policies and processes that control
user behavior, including how users are authenticated, their level of access and also
how IT staff members implement changes to the infrastructure.
Virtual Private Networks
Virtual private networks (VPNs) create a connection to the network from another
endpoint or site. For example, users working from home would typically connect to
the organization's network over a VPN. Data between the two points is encrypted
and the user would need to authenticate to allow communication between their
device and the network.

Access control
Not every user should have access to your network. To keep out potential attackers,
you need to recognize each user and each device. Then you can enforce your
security policies. You can block noncompliant endpoint devices or give them only
limited access. This process is network access control (NAC).

Network Access Control


To ensure that potential attackers cannot infiltrate your network, comprehensive access control policies need
to be in place for both users and devices. Network access control (NAC) can be set at the most granular level.
For example, you could grant administrators full access to the network but deny access to specific confidential
folders or prevent their personal devices from joining the network.
Antivirus and Antimalware Software
Antivirus and antimalware software protect an organization from a range of malicious software, including
viruses, ransomware, worms and trojans. The best software not only scans files upon entry to the network but
continuously scans and tracks files.

The Internet Protocol is the principal communications protocol in the Internet protocol suite for relaying
datagrams across network boundaries. Its routing function enables internetworking, and essentially establishes
the Internet
Classes of IP addresses
TCP/IP defines five classes of IP addresses: class A, B, C, D, and E. Each class has a range of valid IP addresses.
The value of the first octet determines the class. IP addresses from the first three classes (A, B and C) can be
used for host addresses. The other two classes are used for other purposes – class D for multicast and class E for
experimental purposes.
The system of IP address classes was developed for the purpose of Internet IP addresses assignment. The
classes created were based on the network size. For example, for the small number of networks with a very
large number of hosts, the Class A was created. The Class C was created for numerous networks with small
number of hosts.

Classes of IP addresses are:-


classes of ip addresses :-
For the IP addresses from Class A, the first 8 bits (the first decimal number) represent the network part, while
the remaining 24 bits represent the host part. For Class B, the first 16 bits (the first two numbers) represent the
network part, while the remaining 16 bits represent the host part. For Class C, the first 24 bits represent the
network part, while the remaining 8 bits represent the host part.
Consider the following IP addresses:
An ISP (Internet service provider) is a company that provides individuals and other
companies access to the Internet and other related services such as Web site building
and virtual hosting. ... Among the largest national and regional ISPs are AT&T WorldNet,
IBM Global Network, MCI, Netcom, UUNet, and PSINet.

Uniform Resource Locator


Uniform Resource Locator, colloquially termed a web address, is a reference to a web
resource that specifies its location on a computer network and a mechanism for
retrieving it. A URL is a specific type of Uniform Resource Identifier, although many
people use the two terms interchangeably.

1. How long is an IPv6 address?


A. 32 bits
B. 128 bytes
C. 64 bits
D. 128 bits
2 Computer Network is
A. Collection of hardware components and computers
B. Interconnected by communication channels
C. Sharing of resources and information
D. All of the Above
3 What is a Firewall in Computer Network?
A. The physical boundary of Network
B. An operating System of Computer Network
C. A system designed to prevent unauthorized access
D. A web browsing Software
4 How many layers does OSI Reference Model has?
A. 4
B. 5
C. 6
D. 7
5 DHCP is the abbreviation of
A. Dynamic Host Control Protocol
B. Dynamic Host Configuration Protocol
C. Dynamic Hyper Control Protocol
D. Dynamic Hyper Configuration Protocol
6 IPV4 Address is
A. 8 bit
B. 16 bit
C. 32 bit
D. 64 bit
7 DNS is the abbreviation of
A. Dynamic Name System
B. Dynamic Network System
C. Domain Name System
D. Domain Network Service
8 What is the meaning of Bandwidth in Network?
A. Transmission capacity of a communication channels
B. Connected Computers in the Network
C. Class of IP used in Network
D. None of Above
9 ADSL is the abbreviation of
A. Asymmetric Dual Subscriber Line
B. Asymmetric Digital System Line
C. Asymmetric Dual System Line
D. Asymmetric Digital Subscriber Line
10 What is the use of Bridge in Network?
A. to connect LANs
B. to separate LANs
C. to control Network Speed
D. All of the above
11 Router operates in which layer of OSI Reference Model?
A. Layer 1 (Physical Layer)
B. Layer 3 (Network Layer)
C. Layer 4 (Transport Layer)
D. Layer 7 (Application Layer)

12 Modem is used in data transmission. When was it invented and in which country?
A. 1963, USA
B. 1965, Germany
C. 1950, USA
D. 1950, Japan
13 Computers in a LAN can be interconnected by radio and infrared technologies.
A. Wireless LANs
B. Network Topologies
C. Multiplexer
D. Modem
14 How many digits of the Network User Address are known as the DNIC (Data Network Identification Code)?
A. first three
B. first four
C. first five
D. first seven
15. What is the benefit of the Networking?
A. File Sharing
B. Easier access to Resources
C. Easier Backups
D. All of the Above
16. Which of the following is not the Networking Devices?
A. Gateways
B. Linux
C. Routers
D. Firewalls
17. What is the size of MAC Address?
A. 16-bits
B. 32-bits
C. 48-bits
D. 64-bits
18. Which of the following can be Software?
A. Routers
B. Firewalls
C. Gateway
D. Modems
19. What is the use of Ping command?
A. To test a device on the network is reachable
B. To test a hard disk fault
C. To test a bug in a Application
D. To test a Pinter Quality
20. MAC Address is the example of
A. Transport Layer
B. Data Link Layer
C. Application Layer
D. Physical Layer
21. Routing tables of a router keeps track of
A. MAC Address Assignments
B. Port Assignments to network devices
C. Distribute IP address to network devices
D. Routes to use for forwarding data to its destination
22. Layer-2 Switch is also called
A. Multiport Hub
B. Multiport Switch
C. Multiport Bridge
D. Multiport NIC
23. Difference between T568A and T568B is
A. Difference in wire color
B. Difference in number of wires
C. Just different length of wires
D. Just different manufacturer standards
24. The meaning of Straight-through Cable is
A. Four wire pairs connect to the same pin on each end
B. The cable Which Directly connects Computer to Computer
C. Four wire pairs not twisted with each other
D. The cable which is not twisted
25. What is internet?
a) a single network
b) a vast collection of different networks
c) interconnection of local area networks
d) interconnection of wide area networks
26 To join the internet, the computer has to be connected to a _________
a) internet architecture board
b) internet society
c) internet service provider
d) different computer
27. Internet access by transmitting digital data over the wires of a local telephone network
is provided by _______
a) leased line
b) digital subscriber line
c) digital signal line
d) digital leased line
28 ISP exchanges internet traffic between their networks by __________
a) internet exchange point
b) subscriber end point
c) isp end point
d) internet end point
29. Which of the following protocols is used in the internet?
a) HTTP
b) DHCP
c) DNS
d) DNS, HTTP and DNS
30 Internet works on _______
a) packet switching
b) circuit switching
c) both packet switching and circuit switching
d) data switching
HOME WORK
1. WHAT IS THE NEED OF NETWORKING?
2. WRITE THE ADVANTAGE AND DISADVANTAGE OF NETWORKING?
3. DIFERENCE BETWEEN LAN AND WAN?
4. WRITE SHORT NOTE ON LAN , MAN, WAN ? GIVE TWO ADVANTAGE AND
DISADVANTAGE?
4. DISCUSS ABOUT VERIOUS NETWORK TOPOLOGY?
5. WRITE SHORT NOTE ON VPN,FIREWALL,URL?
6. WRITE SHORT NOTE ON BRIDGE , ROUTER, MODEM, NIC, OPTIC FIBRE CABLE , CO-
EXCEL CABLE?
7.WHAT YOU UNDERSTAND BY INTERNET? WRITE ADVANTAGE AND DISADVANTAGE?
8. HOW INTERNET WORK?
9. WHAT IS COMMUTATION SATELLITE? WRITE ADVANTAGE AND DISADVANTAGE?
10. STAR , RING ,MASH, TREE AND BUS TOPOLOGY WITH PROPER DIAGRAM ?
11. WHAT IS OSI MODEL? NAME THE LAYER OF IT?
12. WRITE SHORT NOTE ON NETWORK SECURITY , URL?
13. DEFINE IP? WHAT ARE THE CLASS OF IP?
UNIT V: INTRODUCTION TO DATABASE
A database management system (DBMS) is a software package designed to define,
manipulate, retrieve and manage data in a database. A DBMS generally manipulates the
data itself, the data format, field names, record structure and file structure. It also
defines rules to validate and manipulate this data

Advantages of Database Management System (DBMS)


1. Improved data sharing
An advantage of the database management approach is, the DBMS helps to create an
environment in which end users have better access to more and better-managed data.
Such access makes it possible for end users to respond quickly to changes in their
environment.
2. Improved data security
The more users access the data, the greater the risks of data security breaches.
Corporations invest considerable amounts of time, effort, and money to ensure that
corporate data are used properly. A DBMS provides a framework for better
enforcement of data privacy and security policies.
3. Better data integration
Wider access to well-managed data promotes an integrated view of the organization’s
operations and a clearer view of the big picture. It becomes much easier to see how
actions in one segment of the company affect other segments.
4. Minimized data inconsistency
Data inconsistency exists when different versions of the same data appear in different
places. For example, data inconsistency exists when a company’s sales department
stores a sales representative’s name as “Bill Brown” and the company’s personnel
department stores that same person’s name as “William G. Brown,” or when the
company’s regional sales office shows the price of a product as $45.95 and its national
sales office shows the same product’s price as $43.95. The probability of data
inconsistency is greatly reduced in a properly designed database.
5. Improved data access
The DBMS makes it possible to produce quick answers to ad hoc queries. From a
database perspective, a query is a specific request issued to the DBMS for data
manipulation—for example, to read or update the data. Simply put, a query is a
question, and an ad hoc query is a spur-of-the-moment question.

Disadvantages of Database Management System (DBMS):


Although the database system yields considerable advantages over previous data
management approaches, database systems do carry significant disadvantages. For
example:
1. Increased costs
one of the disadvantages of dbms is Database systems require sophisticated hardware
and software and highly skilled personnel. The cost of maintaining the hardware,
software, and personnel required to operate and manage a database system can be
substantial. Training, licensing, and regulation compliance costs are often overlooked
when database systems are implemented.
2. Management complexity
Database systems interface with many different technologies and have a significant
impact on a company’s resources and culture. The changes introduced by the adoption
of a database system must be properly managed to ensure that they help advance the
company’s objectives. Given the fact that database systems hold crucial company data
that are accessed from multiple sources, security issues must be assessed constantly.
3. Maintaining currency
To maximize the efficiency of the database system, you must keep your system current.
Therefore, you must perform frequent updates and apply the latest patches and
security measures to all components.
Because database technology advances rapidly, personnel training costs tend to be
Disadvantage of File-oriented system:
1. Data Redundancy: It is possible that the same information may be duplicated in
different files. This leads to data redundancy results in memory wastage.
2. Data Inconsistency: Because of data redundancy, it is possible that data may not be in
consistent state.
3. Difficulty in Accessing Data: Accessing data is not convenient and efficient in file
processing system.
4. Limited Data Sharing: Data are scattered in various files. Also different files may have
different formats and these files may be stored in different folders may be of different
departments.
5. Integrity Problems: Data integrity means that the data contained in the database in
both correct and consistent. For this purpose the data stored in database must satisfy
correct and constraints.
6. Atomicity Problems: Any operation on database must be atomic. This means, it must
happen in its entirely or not at all.
7. Concurrent Access Anomalies: Multiple users are allowed to access data
simultaneously. This is for the sake of better performance and faster response.
8. Security Problems: Database should be accessible to users in limited way.

The Database Architecture


The design of a DBMS depends on its architecture. It can be centralized or decentralized
or hierarchical. The architecture of a DBMS can be seen as either single tier or multi-tier.
An n-tier architecture divides the whole system into related but independent n modules,
which can be independently modified, altered, changed, or replaced.
In 1-tier architecture, the DBMS is the only entity where the user directly sits on the
DBMS and uses it. Any changes done here will directly be done on the DBMS itself. It
does not provide handy tools for end-users. Database designers and programmers
normally prefer to use single-tier architecture.
If the architecture of DBMS is 2-tier, then it must have an application through which the
DBMS can be accessed. Programmers use 2-tier architecture where they access the
DBMS by means of an application. Here the application tier is entirely independent of the
database in terms of operation, design, and programming.
3-tier Architecture
A 3-tier architecture separates its tiers from each other based on the complexity of the
users and how they use the data present in the database. It is the most widely used
architecture to design a DBMS.
Database (Data) Tier − At this tier, the database resides along with its query processing
languages. We also have the relations that define the data and their constraints at this
level.
Application (Middle) Tier − At this tier reside the application server and the programs
that access the database. For a user, this application tier presents an abstracted view of
the database. End-users are unaware of any existence of the database beyond the
application. At the other end, the database tier is not aware of any other user beyond
the application tier. Hence, the application layer sits in the middle and acts as a mediator
between the end-user and the database.
User (Presentation) Tier − End-users operate on this tier and they know nothing about
any existence of the database beyond this layer. At this layer, multiple views of the
database can be provided by the application. All views are generated by applications that
reside in the application tier.

BESIC IDEA ABOUT SQL | DDL, DQL, DML, DCL and TCL Commands
Structured Query Language(SQL) as we all know is the database language by the use of
which we can perform certain operations on the existing database and also we can use
this language to create a database. SQL uses certain commands like Create, Drop, Insert
etc. to carry out the required tasks.
These SQL commands are mainly categorized into four categories as:
DDL – Data Definition Language
DQl – Data Query Language
DML – Data Manipulation Language
DCL – Data Control Language
Though many resources claim there to be another category of SQL clauses TCL –
Transaction Control Language. So we will see in detail about TCL as well.
DDL(Data Definition Language) : DDL or Data Definition Language actually consists of the SQL commands
that can be used to define the database schema. It simply deals with descriptions of the database
schema and is used to create and modify the structure of database objects in the database.
Examples of DDL commands:
CREATE – is used to create the database or its objects (like table, index, function, views, store procedure
and triggers).
DROP – is used to delete objects from the database.
ALTER-is used to alter the structure of the database.
TRUNCATE–is used to remove all records from a table, including all spaces allocated for the records are
removed.
COMMENT –is used to add comments to the data dictionary.
RENAME –is used to rename an object existing in the database.
DQL (Data Query Language) :
DML statements are used for performing queries on the data within schema objects. The purpose of DQL
Command is to get some schema relation based on the query passed to it.
Example of DQL:
SELECT – is used to retrieve data from the a database.
DML(Data Manipulation Language) : The SQL commands that deals with the manipulation of data
present in the database belong to DML or Data Manipulation Language and this includes most of the SQL
TCL(transaction Control Language) : TCL commands deals with the transaction within the
database.
Examples of TCL commands:
COMMIT– commits a Transaction.
ROLLBACK– rollbacks a transaction in case of any error occurs.
SAVEPOINT–sets a save point within a transaction.
SET TRANSACTION–specify characteristics for the transaction.

DBMS Database Models:-


A Database model defines the logical design and structure of a database and defines
how data will be stored, accessed and updated in a database management system.
While the Relational Model is the most widely used database model, there are other
models too:
Hierarchical Model
Network Model
Entity-relationship Model
Relational Model

The ER model defines the conceptual view of a database. It works around real-world
entities and the associations among them. At view level, the ER model is considered a
good option for designing databases.
Entity
An entity can be a real-world object, either animate or inanimate, that can be easily
identifiable. For example, in a school database, students, teachers, classes, and
courses offered can be considered as entities. All these entities have some attributes
or properties that give them their identity.
An entity set is a collection of similar types of entities. An entity set may contain
SQL OVERVIEW
SQL is a programming language for Relational
Databases. It is designed over relational
algebra and tuple relational calculus. SQL
comes as a package with all major
distributions of RDBMS.
SQL comprises both data definition and data
manipulation languages. Using the data
definition properties of SQL, one can design
and modify database schema, whereas data
manipulation properties allows SQL to store
and retrieve data from database.

Data Definition Language


SQL uses the following set of commands to define database schema −
CREATE
Creates new databases, tables and views from RDBMS.
For example −
Create database SCHOOL;
Create table article;
Create view for_students;

DROP
Drops commands, views, tables, and databases from RDBMS.
For example−
Drop object_type object_name;
Drop database SCHOOL;
Drop table article;
Drop view for_students;
Data Manipulation Language
SQL is equipped with data manipulation language (DML). DML modifies the database
instance by inserting, updating and deleting its data. DML is responsible for all forms
data modification in a database. SQL contains the following set of commands in its
DML section −
SELECT/FROM/WHERE
INSERT INTO/VALUES
UPDATE/SET/WHERE
DELETE FROM/WHERE
These basic constructs allow database programmers and users to enter data and
information into the database and retrieve efficiently using a number of filter options.
SELECT/FROM/WHERE
SELECT − This is one of the fundamental query command of SQL. It is similar to the
projection operation of relational algebra. It selects the attributes based on the
condition described by WHERE clause.

FROM − This clause takes a relation name as an argument from which attributes are to be
selected/projected. In case more than one relation names are given, this clause corresponds to
Cartesian product.
WHERE − This clause defines predicate or conditions, which must match in order to qualify the
attributes to be projected.

For example −
Select author_name
From book_author
Where age > 50;
This command will yield the names of authors from the relation book_author whose
age is greater than 50.
INSERT INTO/VALUES
MULTIPLE CHOICE QUESTIONS
1.What do you mean by one to many relationship between Teacher and Class table?
A. One class may have many teachers
B. One teacher can have many classes
C. Many classes may have many teachers
D. Many teachers may have many classes
2.What are the different view to present a Table ?
A. Datasheet View
B. Design View
C. Pivote TableView
D. All Of Above
3.In one-to-many relationship the table on 'many' side is called _______
A. Parent
B. Child
C. Sister
D. Master
4.In which state one gathers and list all the necessary fields for the database design project.
A. Data Definition
B. Data Refinement
C. Establishing Relationship
D. None Of The Above
5.Which of the following enables us to view data from a table based on a specific criterion
A. Form
B. Query
C. Macro
D. Report
6. Which database object is ideal to view, change, andanalyze datain different ways ?
A. Table
B. Form
C. Query
D. Report
7. In one-to-many relationship the table in 'one' side is called _______
A. Child
B. Owner
C. Parent
D. Owner
8. Which data type allows alphanumeric characters and special symbols to be entered?
A. Text
B. Memo
C. Auto number
D. Mixed
9. It is used to establish an association between related tables.
A. Line
B. Relationship
C. Primary Key
D. Records
10.This key that uniquely identifies each record is called :
A. Primary Key
B. Key Record
C. Unique Key
D. Field Name
11.. Which name must be unique within a database ?
A. Table
B. Field
C. Record
D. Character
12. The third stage of designing a database is when we create___________ between tables
A. Relationship
B. Join
C. Query
D. None of These
13. Two tables can be linked with relationship to _____
A. Ensure data entry
B. Ensure data integrity
C. Create Primary Key
D. Ensure Foreign Key
14. In a database Table, the each category of information Is called __________
A. Tuple
B. Field
C. Record
D. All Of Above
15.Which of the following fields has width of 8 bytes?
A. Memo
B. Number
C. Date/time
D. Hyperlink
16. which of the following is not a database object?
A. Tables
B. Queries
C. Relationships
D. Reports
17. Which of the following is not a database model
A. Network Database Model
B. Relational Database Model
C. Object Oriented Database Model
D. None
18. The overall description of a database is called______.
A. Data integrity
B. Data manipulation
C. Database schema
D. Data definition
19. A data dictionary is a repository that manages _____
A. Memory
B. Metadata
C. Spell Checker
D. Data Validator
20. A Database Management System (DBMS) is
A. Collection of interrelated data
B. Collection of programs to access data
C. Collection of data describing one particular enterprise
D. All of the above
21. Which of the following is not a level of data abstraction?
A. Physical Level
B. Critical Level
C. Logical Level
D. View Level
22. Disadvantages of File systems to store data is:
A. Data redundancy and inconsistency
B. Difficulty in accessing data
C. Data isolation
D. All of the above
23. In an Entity-Relationship Diagram Rectangles represents
A. Entity sets
B. Attributes
C. Database
D. Tables
24. Which of the following is not a Storage Manager Component?
A. Transaction Manager
B. Logical Manager
C. Buffer Manager
D. File Manager
25. Data Manipulation Language enables users to
A. Retrieval of information stored in database
B. Insertion of new information into the database
C. Deletion of information from the database
D. All of the above
26. Which of the following is not an Schema?
A. Database Schema
B. Physical Schema
C. Critical Schema
D. Logical Schema
27. Which of the following is Database Language?
A. Data Definition Language
B. Data Manipulation Language
C. Query Language
D. All of the above
28. Which of the following in not a function of DBA?
A. Network Maintenance
B. Routine Maintenance
C. Schema Definition
D. Authorization for data access
29. Which of the following is a Data Model?
A. Entity-Relationship model
B. Relational data model
C. Object-Based data model
D. All of the above
Homework :-
1. WHAT IS DATABASE? DEFINE DATABASE MANAGEMENT SYSTEM?
2. WRITE THE ADVANTAGE AND DISADVANTAGE OF DATABASE MANAGEMENT
SYSTEM?
3. DESCRIBE THE THREE LAYER ARCHITECTURE OF DBMS?
4. WRITE SHORT NOTE ON DDL , DML, DCL AND DQL?
5. DESCRIBE THE ONE TO ONE , AND ONE TO MANY RELATIONSHIP OF DATABASE?
6. DEFINE PRIMARY KEY ,SECENDARY KEY?
7. WHT IS SQL?
8. DESCRIBE THE FUNCTION OF CREATE ,ALTTER, DELETE,DROP,SELECT ,GRANT
AND REVOKE SQL COMMANDS?
UNIT VI MICROSOFT WORD
Microsoft Office Word 2010 allows you to create and edit personal and business
documents, such as letters, reports, invoices, emails and books. By default, documents
saved in Word 2010 are saved with the .docx extension. Microsoft Word can be used for
the following purposes −
 To create business documents having various graphics including pictures, charts, and
diagrams.
 To store and reuse readymade content and formatted elements such as cover pages
and sidebars.
 To create letters and letterheads for personal and business purpose.
 To design different documents such as resumes or invitation cards etc.
 To create a range of correspondence from a simple office memo to legal copies and
reference documents.
 In this chapter, we will discuss how to get started with Word 2010. We will
understand how to start a Word 2010 application in simple steps. Assuming you have
Microsoft Office 2010 installed in your PC, to start the Word application, follow
these steps −
 Step 1 − Click the Start button.

 Step 2 − Click the All Programs option from the menu.

 Step 3 − Search for Microsoft Office from the submenu and click it.

 Step 4 − Search for Microsoft Word 2010 from the submenu and click it.

 This will launch the Microsoft Word 2010 application and you will see the following
window.

We will understand how to explore Window in Word 2010. Following is the basic
window which you get when you start the Word application. Let us understand the
various important parts of this window..
File Tab
The File tab replaces the Office button from Word 2007. You can click it to check
the Backstage view. This is where you come when you need to open or save files, create
new documents, print a document, and do other file-related operations.
Quick Access Toolbar
This you will find just above the File tab. This is a convenient resting place for the
mostfrequently used commands in Word. You can customize this toolbar based on your
comfort.
Ribbon

Ribbon contains commands organized in three components −


 Tabs − These appear across the top of the Ribbon and contain groups of related
commands. Home, Insert, Page Layout are examples of ribbon tabs.
 Groups − They organize related commands; each group name appears below the
group on the Ribbon. For example, group of commands related to fonts or group of
commands related to alignment, etc.
 Commands − Commands appear within each group as mentioned above.
Title bar
This lies in the middle and at the top of the window. Title bar shows the program and
document titles.
Rulers
Word has two rulers - a horizontal ruler and a vertical ruler. The horizontal ruler appears
just beneath the Ribbon and is used to set margins and tab stops. The vertical ruler
appears on the left edge of the Word window and is used to gauge the vertical position of
elements on the page.
Help
The Help Icon can be used to get word related help anytime you like. This provides nice
tutorial on various subjects related to word.
Zoom Control
Zoom control lets you zoom in for a closer look at your text. The zoom control consists of
a slider that you can slide left or right to zoom in or out; you can click the + buttons to
increase or decrease the zoom factor.
View Buttons
The group of five buttons located to the left of the Zoom control, near the bottom of the
screen, lets you switch through the Word's various document views.
 Print Layout view − This displays pages exactly as they will appear when printed.
 Full Screen Reading view − This gives a full screen view of the document.
 Web Layout view − This shows how a document appears when viewed by a Web
browser, such as Internet Explorer.
 Outline view − This lets you work with outlines established using Word’s standard
heading styles.
 Draft view − This formats text as it appears on the printed page with a few
exceptions. For example, headers and footers aren't shown. Most people prefer this
mode.
Document Area
This is the area where you type. The flashing vertical bar is called the insertion point and
it represents the location where text will appear when you type.
Status Bar
This displays the document information as well as the insertion point location. From left
to right, this bar contains the total number of pages and words in the document, language,
etc.
You can configure the status bar by right-clicking anywhere on it and by selecting or
deselecting options from the provided list.
Dialog Box Launcher
This appears as very small arrow in the lower-right corner of many groups on the Ribbon.
Clicking this button opens a dialog box or task pane that provides more options about the
group.
we will discuss the Backstage View in Word 2010. The Backstage view was introduced
in Word 2010. This acts as the central place for managing your documents. The backstage
view helps in creating new documents, saving and opening documents, printing and
sharing documents, and so on.
Getting to the Backstage View is easy: Just click the File tab, located in the upper-left
corner of the Word Ribbon. If you already do not have any opened document, then you
will see a window listing down all the recently opened documents as follows −

If you already have an opened document, then it will display a window showing detail
about the opened document as shown below. Backstage view shows three columns when
you select most of the available options in the first column.
The first column of the backstage view will have following options −
S.N Option & Description
o

Save
1 If an existing document is opened, it will be saved as is,
otherwise it will display a dialogue box asking for the document
name.

Save As
2 A dialogue box will be displayed asking for document name and
document type, by default it will save in word 2010 format with
extension .docx.

Open
3
This option is used to open an existing word document.

Close
4
This option is used to close an open document.

Info
5
This option displays information about the opened document.

Recent
6
This option lists down all the recently opened documents

7 New
This option is used to open a new document.

Print
8
This option is used to print an open document.

Save & Send


9 This option will save an open document and will display options
to send the document using email, etc.

Help
10
This option is used to get the required help about Word 2010.

Options
11
This option is used to set various option related to Word 2010.

Exit
12
Use this option to close the document and exit.

Document Information
When you click the Info option available in the first column, it displays the following
information in the second column of the backstage view −
 Compatibility Mode − If the document is not a native Word 2007/2010 document,
a Convert button appears here, enabling you to easily update its format. Otherwise,
this category does not appear.
 Permissions − You can use this option to protect your word document. You can set a
password so that nobody can open your document, or you can lock the document so
that nobody can edit your document.
 Prepare for Sharing − This section highlights important information you should
know about your document before you send it to others, such as a record of the edits
you made as you developed the document.
 Versions − If the document has been saved several times, you may be able to access
the previous versions of it from this section.
Document Properties
When you click the Info option available in the first column, it displays various properties
in the third column of the backstage view. These properties include the document size, the
number of pages in the document, the total number of words in the document, the name of
the author etc.
You can also edit various properties by clicking on the property value and if the property
is editable, then it will display a text box where you can add your text like title, tags,
comments, Author.
Exit Backstage View
It is simple to exit from the Backstage View. Either click on the File tab or press the Esc
button on the keyboard to go back to the working mode of Word.
let us discuss how to enter text with Microsoft Word 2010. Let us see how easy it is
to enter text in a Word document. We assume you know that when you start Word, it
displays a new document by default as shown below −

Document area is the area where you type your text. The flashing vertical bar is called the
insertion point and it represents the location where the text will appear when you type.
keep the cursor at the text insertion point and start typing the text. We typed only two
words "Hello Word" as shown below. The text appears to the left of the insertion point as
you type −
The following are the two important points that will help you while typing −
 You do not need to press Enter to start a new line. As the insertion point reaches the
end of the line, Word automatically starts a new one. You will need to press Enter, to
add a new paragraph.
 When you want to add more than one space between words, use the Tab key instead
of the spacebar. This way you can properly align text by using the proportional fonts.
Saving New Document
Once you are done with typing in your new Word document, it is time to save your
document to avoid losing work you have done on a Word document. Following are the
steps to save an edited Word document −
Step 1 − Click the File tab and select the Save As option.

Step 2 − Select a folder where you will like to save the document, Enter the file name
which you want to give to your document and Select the Save As option, by default it is
the .docx format.
Step 3 − Finally, click on the Save button and your document will be saved with the
entered name in the selected folder.
Saving New Changes
There may be an instance when you open an existing document and edit it partially or
completely, or an instance where you may like to save the changes in between editing of
the document. If you want to save this document with the same name, then you can use
either of the following simple options −
 Just press the Ctrl + S keys to save the changes.
 Optionally you can click on the floppy icon available at the top left corner and just
above the File tab. This option will also help you save the changes.
 You can also use the third method to save the changes, which is the Save option
available just above the Save As option as shown in the above screenshot.
If your document is new and it was never saved so far, then with either of the three
options, Word will display a dialogue box to let you select a folder, and enter the
document name as explained in case of saving new document.

Opening New Document


A new, blank document always opens when you start Microsoft Word. Suppose you want
to start another new document while you are working on another document, or you closed
an already opened document and want to start a new document. Here are the steps to open
a new document −
Step 1 − Click the File tab and select the New option.
Step 2 − When you select the New option from the first column, it will display a list of
templates in the second column. Double-click on the Blank document; this is the first
option in the template list. We will discuss the other templates available in the list in the
following chapters.
You should have your blank document as shown below. The document is now ready for
you to start typing your text.

You can use a shortcut to open a blank document anytime. Try using the Ctrl + N keys
and you will see a new blank document similar to the one in the above screenshot.
Opening Existing Document
There may be a situation when you open an existing document and edit it partially or
completely. Follow the steps given below to open an existing document −
Step 1 − Click the File tab and select the Open option.

Step 2 − This will display the following file Open dialog box. This lets you navigate
through different folders and files, and also lets you select a file which you want to open.
Step 3 − Finally, locate and select a file which you want to open and click the small
triangle available on the Open button to open the file. You will have different options to
open the file, but simply use the Open option.

This will open your selected file. You can use the Open Read-Only option if you are
willing just to read the file and you have no intention to modify, i.e., edit the file. Other
options can be used for advanced usage.
we will understand how to close a document in Word 2010. When you finish working
with a document, you will proceed to close the document. Closing a document removes it
from your computer screen and if you had other documents open, Word displays the last
document you used otherwise, you see a blank Word window. Here are simple steps to
close an opened document −
Step 1 − Click the File tab and select the Close option.
Step 2 − When you select the Close option and if the document is not saved before
closing, it will display the following Warning box asking whether the document should be
saved or not.

Step 3 − To save the changes, click Save, otherwise click Don't Save. To go back to the
document, click Cancel. This will close the document and if you have other documents
open, Word displays the last document you used, otherwise, you see a blank Word
window as shown below −

we will discuss how to copy, cut and paste in Word 2010. In the previous chapter, we
understood how we can select the desired text and move it to any other location in the
same document or in any other document. This tutorial will teach you how to use copy,
cut and paste techniques to duplicate a text leaving the original text intact or removing the
original text completely.
To use copy and paste or cut and paste operations, Word makes use of a temporary
memory which is called the clipboard. When you copy or cut a text, it stay on the
clipboard temporarily and in the second step you can paste this content at the desired
location.
Copy & Paste Operation
The Copy operation will just copy the content from its original place and create a
duplicate copy of the content at the desired location without deleting the text from it's the
original location. Following is the procedure to copy the content in word −
Step 1 − Select a portion of the text using any of the text selection methods.

Step 2 − You have various options available to copy the selected text in clipboard. You
can make use of any one of the options −
 Using Right-Click − When you right-click on the selected text, it will display
the copy option, click this option to copy the selected content in clipboard.
 Using Ribbon Copy Button − After selecting text, you can use the copy button
available at the ribbon to copy the selected content in clipboard.
 Using Ctrl + c Keys − After selecting a text, just press Ctrl + c keys to copy the
selected content in clipboard.
Step 3 − Finally click at the place where you want to copy the selected text and use either
of these two simple options −
 Using Ribbon Paste Button − Just click the Paste button available at the ribbon to
paste the copied content at the desired location.
 Using Ctrl + v Keys − This is simplest way of pasting the content. Just press Ctrl +
v keys to paste the content at the new location.

Note − You can repeat the Paste operation as many times as you like to paste the same
content.
Cut & Paste Operation
The Cut operation will cut the content from its original place and move the content from
its original location to a new desired location. Following is the procedure to move the
content in word −
Step 1 − Select a portion of the text using any of the text selection methods.
Step 2 − Now, you have various options available to cut the selected text and put it in the
clipboard. You can make use of one of the options −
 Using Right-Click − If right-click on the selected portion of text, it will
display cut option, just click this option to cut the selected content and keep it in
clipboard.
 Using Ribbon Cut Button − After selecting a portion of text, you can use cut button
available at the ribbon to cut the selected content and keep it in clipboard.
 Using Ctrl + x Keys − After selecting a portion of text, just press Ctrl + x keys to
cut the selected content and keep it in clipboard.

Step 3 − Finally, click at the place where you want to move the selected text and use
either of these two simple options −
 Using Ribbon Paste Button − Just click the Paste button available at the ribbon to
paste the content at the new location.
 Using Ctrl + v Keys − This is simplest way of pasting the content. Just press Ctrl +
v keys to paste the content at the new location.

Note − You can repeat the Paste operation as many times as you like to paste the same
content.
Copy, Cut & Paste in different documents
You can use the same procedure that we discussed above to copy and paste or cut and
paste content from one document to another document. This is very simple, just copy or
cut the desired content from one document and go into another document where you want
to paste the content and use mentioned step to paste the content.
You can use the Alt + Tab keys to switch through the different documents and select the
desired destination document.
we will discuss the Find and Replace operation in Word 2010. While working on editing a
document you come across a situation very frequently when you want to search a
particular word in your document and many times you will be willing to replace this word
with another word at a few or all the places throughout the document. Here, we will
understand how to find a word or phrase in a word document and how to replace an
existing word with any other word using simple steps.

Find Command
The Find command enables you to locate specific text in your document. Following are
the steps to find a word document in the following screen −
Step 1 − Let us work out on a sample text available in our Word document. Just type
=rand() and press Enter; the following screen will appear −
Step 2 − Click the Find option in the Editing group on the Home tab or press Ctrl +
F to launch the Navigation pane −

Step 3 − Enter a word which you want to search in the Search box, as soon as you finish
typing, Word searches for the text you entered and displays the results in the navigation
pane and highlights the word in the document as in the following screenshot −
Step 4 − You can click the clear button (X) to clear the search and results and perform
another search.
Step 5 − You can use further options while searching for a word. Click the option
button to display the options menu and then click the Options option; this will display a
list of options. You can select the options like match case to perform case-sensitive
search.

Step 6 − Finally, if you are done with the Search operation, you can click the close
button (X) to close the Navigation Pane.
Find & Replace Operation
We assume you are an expert in searching a word or phrase in a word document as
explained above. This section will teach you how you can replace an existing word in
your document. Following are the simple steps −
Step 1 − Click the Replace option in the Editing group on the Home tab or press Ctrl +
H to launch the Find and Replace dialog box shown in Step 2 −
Step 2 − Type a word which you want to search. You can also replace the word using
the Find and Replace dialog box as in the following screenshot −

Step 3 − Click the Replace button available on the Find and Replace dialog box and you
will see the first occurrence of the searched word would be replaced with the replace with
word. Clicking again on Replace button would replace next occurrence of the searched
word. If you will click Replace All button then it would replace all the found words in
one go. You can also use Find Next button just to search the next occurence and later you
can use Replace button to replace the found word.
Step 4 − You can use More >> button available on the dialog box to use more options
and to make your search more specific like case sensitive search or searching for whole
word only etc.
Step 5 − Finally, if you are done with the Find and Replace operation, you can click
the Close (X) or Cancel button of the dialog box to close the box.
we will discuss how to check spelling and grammar in Word 2010. Microsoft Word
provides a decent Spelling and Grammar Checker which enables you to search for and
correct all spelling and grammar mistakes in your document. Word is intelligent enough
to identify misspelled or misused, as well as grammar errors and underlines them as
follows.
 A red underline beneath spelling errors.
 A green underline beneath grammar errors.
 A blue line under correctly spelled but misused words.
Check Spelling and Grammar using Review tab
Here is the simple procedure to find out the spelling mistakes and fix them −
Step 1 − Click the Review tab and then click the Spelling & Grammar button.

Step 2 − A Spelling and Grammar dialog box will appear and will display the wrong
spellings or errors in grammar. You will also get suggestions to correct as shown below −

Now you have following options to fix the spelling mistakes −


 Ignore − If you are willing to ignore a word, then click this button and Word ignores
the word throughout the document.
 Ignore All − Like Ignore, but this ignores all occurrences of the same misspelling,
not just once but throughout the document.
 Add to Dictionary − Choose Add to Dictionary to add the word to the Word
spelling dictionary.
 Change − This will change the wrong word using the suggested correct word.
 Change All − Like Change, but this changes all occurrences of the same misspelling,
not just once but throughout the document.
 AutoCorrect − If you select a suggestion, Word creates an AutoCorrect entry that
automatically corrects this spelling error from now on.
Following are the different options in case you have grammatical mistake −
 Next Sentence − You can click Next Sentence to direct the grammar checker to skip
ahead to the next sentence.
 Explain − The grammar checker displays a description of the rule that caused the
sentence to be flagged as a possible error.
 Options − This will open the Word Options dialog box to allow you to change the
behavior of the grammar checker or spelling options.
 Undo − This will undo the last grammar changed.
Step 3 − Select one of the given suggestions you want to use and click the Change option
to fix the spelling or grammar mistake and repeat the step to fix all the spelling or
grammar mistake.
Step 4 − Word displays a dialog box when it finishes checking for spelling and grammar
mistakes, finally Click OK.

Check Spelling and Grammar using Right Click


If you will right-click the mouse button over a misspelled word, then it will show you the
correct suggestions and the above mentioned options to fix the spelling or grammar
mistake. Try it yourself.
we will discuss how to set the text fonts and size in Word 2010. Microsoft word allows
you to use different fonts with different size. You can change your document's appearance
by changing the fonts and their size. Usually you use different fonts for paragraphs and
headings. It is important to learn how to use different fonts. This chapter will teach you
how to change a font and its size in simple steps.
Change the Font Type & Size
We will understand in brief the font buttons that we will further use in this tutorial.
Following is a screenshot to show you a few font related buttons.

Step 1 − Select the portion of text the font of which needs to be changed and click
the Home tab. Now click the Font Type button to list down all the fonts available as
shown below.
©SAYANTAN BERA
Step 2 − Try to move the mouse pointer over the listed fonts. You will see that the text
font changes when you move the mouse pointer over different fonts. You can use
the Font Scroll Bar to display more fonts available. Finally select a desired font by
clicking over the font name in the list. We have selected MV Boli as the font for our
sample text.

Step 3 − Similar way, to change the font size, click over the Font Size button which will
display a font size list. You will use the same procedure to select a desired font size that
you have used while selecting a font type.
Use Shrink and Grow Buttons
You can use a quick way to reduce or enlarge the font size. As shown in the first
screenshot, the Shrink Font button can be used to reduce the font size whereas the Grow
Font button can be used to enlarge the font size.

Try to click either of these two buttons and you will see the effect. You can click a single
button multiple times to apply the effect. Each time you click either of the buttons, it will
enlarge or reduce the font size by 1 point.
Clear Formatting Options
All of the setting can be reset to plain text, or the default formatting. To reset text to
default settings −
Step 1 − Select the portion of text that you want to reset.
Step 2 − Click the Clear Formatting button in the Home tab Font group, or simply
use Ctrl + SPACEBAR.
we will discuss how to adjust page margins in Word 2010. Margins are the space between
the edge of the paper and the text. You can adjust the right, left, top, and bottom margins
of your document. By default, Word sets all margins left, right, top, and bottom to 1 inch.
In the screenshot given below, I have shown top, left and right margins, if you will type
the complete page, word will leave 1-inch bottom margin as well.

Adjust Margins
The following steps will help you understand how to set margins for an open document.
Step 1 − Open the document the margins of which need to be set. If you want the margins
to be applied only to a selected part of a document, select that particular part.
Step 2 − Click the Page Layout tab, and click the Margins button in the Page Setup
group. This will display a list of options to be selected but you have to click the Custom
Margins option available at the bottom.
You can also select any of the predefined margins from the list, but using custom margins
option you will have more control on all the settings.
Step 3 − You will have to display a Page Dialog Box as shown below where you can set
top, left, right and bottom margins under the Margins Tab. Select the Apply to: option to
apply the margin on selected text or complete document.

Step 4 − If you are going to bind the document and want to add an extra amount of space
on one edge for the binding, enter that amount in the Gutter text box, and select the side
the gutter is on with the Gutter Position drop-down list. After setting all the desired
values for all the margins, click the OK button to apply the margins.
we will discuss how to add header and footer in Word 2010. Headers and footers are parts
of a document that contain special information such as page numbers and the total number
of pages, the document title, company logo, any photo, etc. The header appears at the top
of every page, and the footer appears at the bottom of every page.
Add Header and Footer
The following steps will help you understand how to add header and footer in a Word
document.
Step 1 − Click the Insert tab, and click either the Header button or the Footer
button that which needs to be added first. Assume you are going to add Header; when
you click the Header button it will display a list of built-in Headers from where you can
choose any of the headers by simply clicking on it.

Step 2 − Once you select any of the headers, it will be applied to the document in editable
mode and the text in your document will appear dimmed, Header and Footer
buttons appear on the Ribbon and a Close Header and Footer button will also appear at
the top-right corner.

Step 3 − Finally, you can type your information whatever you want to have in your
document header and once you are done, click Close Header and Footer to come out of
the header insertion mode. You will see the final result as follows.

You can follow a similar procedure to add footer in your document.


Edit Header and Footer
The following steps will help you understand how to edit the existing header or footer of
your document.
Step 1 − Click the Insert tab, and click either the Header button or Footer button or
whatever you want to edit. Assume you are going to edit the Header, so when you click
the Header button it will display a list of options including the Edit Header option.

Step 2 − Click on the Edit Header option and Word will display the editable header as
shown in the following screenshot.

Step 3 − Now you can edit your document header and once you are done, click Close
Header and Footer to come out of the edit header mode.
we will discuss how to add page numbers in Word 2010. Microsoft Word automatically
assigns page numbers on the pages of your document. Typically, page numbers are
printed either in header or footer but you have the option that can display the page number
in the left or right margins at the top or the bottom of a page.
Add Page Numbers
Following are the simple steps to add page numbers in a Word document.
Step 1 − Click the Insert tab, and click the Page Number button available in the header
and footer section. This will display a list of options to display the page number at the top,
bottom, current position etc.
Step 2 − When you move your mouse pointer over the available options, it displays
further styles of page numbers to be displayed. For example, when I take the mouse
pointer at the Bottom of Page option it displays the following list of styles.

Step 3 − Finally, select any one of the page number styles. I selected the Accent Bar
1 style by clicking over it. You will be directed to the Page Footer modification mode.
Click the Close Header and Footer button to come out of the Footer Edit mode.
You can format your page numbers using the Format Page Numbers option available
under the listed options.
Remove Page Numbers
The following steps will help you remove page numbering from a Word document.
Step 1 − Click the Insert tab, and click the Page Number button available in the header
and footer section. This will display a list of options to display page number at the top,
bottom, current position, etc. At the bottom, you will have the Remove Page
Numbers option. Just click this option and it will delete all the page numbers set in your
document.

we will discuss Almost all the good documents and books have an attractive first page
that includes the document title, its subject, author and publisher name etc. This first page
is is the Cover Page and Microsoft Word provides an easy way to add a cover page.
Add Cover Pages
Following are the simple steps to add a cover page in a Word document.
Step 1 − Click the Insert tab, and click the Cover Page button available in the Pages
group. This will display a list of Built-in Cover Pages as shown below.

Step 2 − Choose a cover page from the options available in the gallery. The selected
cover page will be added as the first page of your document which can later be modified
according to the requirements. If you want to place the cover page elsewhere except the
first page, right-click the cover page in the gallery and select the location you want from
the menu that appears.
Delete Cover Pages
The following steps will help you understand how to delete an existing cover page from a
Word document.
Step 1 − Click the Insert tab, and click the Cover Page button available in the Pages
group. This will display a list of Built-in Cover Pages as shown below. You will find
a Remove Current Cover Page option available at the bottom of the cover page gallery.
Step 2 − Click the Remove Current Cover Page option and your cover page will be
deleted from your document.
we will discuss how to create a table in Word 2010. A table is a structure of vertical
columns and horizontal rows with a cell at every intersection. Each cell can contain text
or graphics, and you can format the table in any way you want. Usually the top row in the
table is kept as a table header and can be used to put some informative instruction.
Create a Table
The following steps will help you understand how to create a table in a Word document.
Step 1 − Click the Insert tab followed by the Table button. This will display a simple
grid as shown below. When you move your mouse over the grid cells, it makes a table in
the table that appears in the document. You can make your table having the desired
number of rows and columns.

Step 2 − Click the square representing the lower-right corner of your table, which will
create an actual table in your document and Word goes in the table design mode. The
table design mode has many options to work with as shown below.

Step 3 − This is an optional step that can be worked out if you want to have a fancy table.
Click the Table Styles button to display a gallery of table styles. When you move your
mouse over any of the styles, it shows real time preview of your actual table.
Step 4 − To select any of the styles, just click the built-in table style and you will see that
the selected style has been applied on your table.

Delete a Table
Following are the simple steps to delete an existing table from a word document.
Step 1 − Click anywhere in the table you want to delete.
Step 2 − Click the Layout tab, and click the Delete Table option under the Delete Table
Button to delete the complete table from the document along with its content.

we will discuss how to work with rows and columns in Word 2010. As discussed in the
previous chapter, a table is a structure of vertical columns and horizontal rows with a cell
at every intersection. A Word table can contain as many as 63 columns but the number of
rows is unlimited. This chapter will teach you how to add and delete rows and columns in
a table.
Add a Row
Following are the simple steps to add rows in a table of a word document.
Step 1 − Click a row where you want to add an additional row and then click the Layout
tab; it will show the following screen.

Step 2 − Now use the Row & Column group of buttons to add any row below or above
to the selected row. If you click the Insert Below button, it will add a row just below the
selected row as follows.

If you click the Insert Above button, it will add a row just above the selected row.
Delete a Row
The following steps will help you delete rows from a table of a Word document.
Step 1 − Click a row which you want to delete from the table and then click the Layout
tab; it will show the following screen.
Step 2 − Click the Layout tab, and then click the Delete Rows option under the Delete
Table Button to delete the selected row.

Add a Column
The following steps will help you add columns in a table of a Word document.
Step 1 − Click a column where you want to add an additional column and then click
the Layout tab; it will show the following screen.

Step 2 − Now use the Row & Column group of buttons to add any column to the left or
right of the selected column. If you click the Insert Left button, it will add a column just
left to the selected column as follows.

If you click the Insert Right button, it will add a column just next to the selected column.
Delete a Column
Following are the simple steps to delete columns from a table of a word document.
Step 1 − Click a column which you want to delete from the table and then click
the Layout tab; it will show the following screen.

Step 2 − Click the Layout tab, and click the Delete Column option under the Delete
Table Button to delete the selected column.

We will discuss how to add formula to a table in Word 2010. Microsoft Word allows you
to use mathematical formula in table cells which can be used to add numbers, to find the
average of numbers, or find the largest or the smallest number in table cells you specify.
There is a list of formulae, you can choose from the many based on the requirement. This
chapter will teach you how to use formula in word tables.
Add a Formula
Following are the simple steps to add formula in a table cell available in Word document.
Step 1 − Consider the following table with the total number of rows. Click in a cell that
should contain the sum of the rows.
Step 2 − Now click the Layout tab and then click the Formula button; this will
display a Formula Dialog Box which will suggest a default formula, which is
=SUM(LEFT) in our case. You can select a number format using Number Format List
Box to display the result or you can change the formula using the Formula List Box.

Step 3 − Now click OK to apply the formula and you will see that the left cells have been
added and the sum has been put in the total cell where we wanted to have it. You can
repeat the procedure to have the sum of other two rows as well.

Cell Formulae
The Formula dialog box provides the following important functions to be used as formula
in a cell.
S.N Formula & Description
o

1 AVERAGE( )
The average of a list of cells

2 COUNT( )
The number of items in a list of cells

3 MAX( )
The largest value in a list of cells

4 MIN( )
The smallest value in a list of cells

5 PRODUCT( )
The multiplication of a list of cells

6 SUM( )
The sum of a list of cells

We assume you are familiar with how to create a spreadsheet program; you can construct
your word cell formula. Word formulae uses a reference system to refer to an individual
table cells. Each column is identified by a letter, starting with A for the first column, B for
the second column, and so on. After the letter comes the row number. Thus, the first cell
in the first row is A1, the third cell in the fourth row is C4, and so on.
Following are useful points to help you in constructing a word cell formula.
S.N Cell References and Description
o

1 A single cell reference, such as B3 or F7

2 A range of cells, such as A4:A9 or C5:C13

3 A series of individual cells, such as A3, B4, C5

4 ABOVE, referring to all cells in the column above the current


cell.

BELOW, referring to all cells in the column below the current


5
cell.

LEFT, referring to all cells in the row to the left of the current
6
cell

RIGHT, referring to all cells in the row to the right of the current
7
cell

You can also construct simple Math expressions, such as B3+B5*10 by using simple
mathematical operators +, -, /, *, %.
UNIT VII: GETTING STARTED WITH EXCEL 2010
This chapter teaches you how to start an excel 2010 application in simple steps. Assuming
you have Microsoft Office 2010 installed in your PC, start the excel application following
the below mentioned steps in your PC.
Step 1 − Click on the Start button.

Step 2 − Click on All Programs option from the menu.

Step 3 − Search for Microsoft Office from the sub menu and click it.
Step 4 − Search for Microsoft Excel 2010 from the submenu and click it.

This will launch the Microsoft Excel 2010 application and you will see the following
excel window.

Explore Window in Excel 2010


The following basic window appears when you start the excel application. Let us now
understand the various important parts of this window.
File Tab
The File tab replaces the Office button from Excel 2007. You can click it to check
the Backstage view, where you come when you need to open or save files, create new
sheets, print a sheet, and do other file-related operations.
Quick Access Toolbar
You will find this toolbar just above the File tab and its purpose is to provide a
convenient resting place for the Excel's most frequently used commands. You can
customize this toolbar based on your comfort.
Ribbon

Ribbon contains commands organized in three components −


 Tabs − They appear across the top of the Ribbon and contain groups of related
commands. Home, Insert, Page Layout are the examples of ribbon tabs.
 Groups − They organize related commands; each group name appears below the
group on the Ribbon. For example, group of commands related to fonts or group of
commands related to alignment etc.
 Commands − Commands appear within each group as mentioned above.
Title Bar
This lies in the middle and at the top of the window. Title bar shows the program and the
sheet titles.
Help
The Help Icon can be used to get excel related help anytime you like. This provides nice
tutorial on various subjects related to excel.
Zoom Control
Zoom control lets you zoom in for a closer look at your text. The zoom control consists of
a slider that you can slide left or right to zoom in or out. The + buttons can be clicked to
increase or decrease the zoom factor.
View Buttons
The group of three buttons located to the left of the Zoom control, near the bottom of the
screen, lets you switch among excel's various sheet views.
 Normal Layout view − This displays the page in normal view.
 Page Layout view − This displays pages exactly as they will appear when printed.
This gives a full screen look of the document.
 Page Break view − This shows a preview of where pages will break when printed.
Sheet Area
The area where you enter data. The flashing vertical bar is called the insertion point and
it represents the location where text will appear when you type.
Row Bar
Rows are numbered from 1 onwards and keeps on increasing as you keep entering data.
Maximum limit is 1,048,576 rows.
Column Bar
Columns are numbered from A onwards and keeps on increasing as you keep entering
data. After Z, it will start the series of AA, AB and so on. Maximum limit is 16,384
columns.
Status Bar
This displays the current status of the active cell in the worksheet. A cell can be in either
of the fours states (a) Ready mode which indicates that the worksheet is ready to accept
user inpu (b) Edit mode indicates that cell is editing mode, if it is not activated the you
can activate editing mode by double-clicking on a cell (c) A cell enters into Enter mode
when a user types data into a cell (d) Point mode triggers when a formula is being entered
using a cell reference by mouse pointing or the arrow keys on the keyboard.
Dialog Box Launcher
This appears as a very small arrow in the lower-right corner of many groups on the
Ribbon. Clicking this button opens a dialog box or task pane that provides more options
about the group.
BackStage View in Excel 2010
The Backstage view has been introduced in Excel 2010 and acts as the central place for
managing your sheets. The backstage view helps in creating new sheets, saving and
opening sheets, printing and sharing sheets, and so on.
Getting to the Backstage View is easy. Just click the File tab located in the upper-left
corner of the Excel Ribbon. If you already do not have any opened sheet then you will see
a window listing down all the recently opened sheets as follows −

If you already have an opened sheet then it will display a window showing the details
about the opened sheet as shown below. Backstage view shows three columns when you
select most of the available options in the first column.

First column of the backstage view will have the following options −
S.No Option & Description
.
1 Save
If an existing sheet is opened, it would be saved as is, otherwise
it will display a dialogue box asking for the sheet name.

2 Save As
A dialogue box will be displayed asking for sheet name and
sheet type. By default, it will save in sheet 2010 format with
extension .xlsx.

3 Open
This option is used to open an existing excel sheet.

4 Close
This option is used to close an opened sheet.

5 Info
This option displays the information about the opened sheet.

6 Recent
This option lists down all the recently opened sheets.

7 New
This option is used to open a new sheet.

8 Print
This option is used to print an opened sheet.

9 Save & Send


This option saves an opened sheet and displays options to send
the sheet using email etc.

10 Help
You can use this option to get the required help about excel
2010.

11 Options
Use this option to set various option related to excel 2010.
12 Exit
Use this option to close the sheet and exit.

Sheet Information
When you click Info option available in the first column, it displays the following
information in the second column of the backstage view −
 Compatibility Mode − If the sheet is not a native excel 2007/2010 sheet, a Convert
button appears here, enabling you to easily update its format. Otherwise, this
category does not appear.
 Permissions − You can use this option to protect the excel sheet. You can set a
password so that nobody can open your sheet, or you can lock the sheet so that
nobody can edit your sheet.
 Prepare for Sharing − This section highlights important information you should
know about your sheet before you send it to others, such as a record of the edits you
made as you developed the sheet.
 Versions − If the sheet has been saved several times, you may be able to access
previous versions of it from this section.
Sheet Properties
When you click Info option available in the first column, it displays various properties in
the third column of the backstage view. These properties include sheet size, title, tags,
categories etc.
You can also edit various properties. Just try to click on the property value and if property
is editable, then it will display a text box where you can add your text like title, tags,
comments, Author.
Exit Backstage View
It is simple to exit from the Backstage View. Either click on the File tab or press the Esc
button on the keyboard to go back to excel working mode.
Entering Values in Excel 2010
Entering values in excel sheet is a child’s play and this chapter shows how to enter values
in an excel sheet. A new sheet is displayed by default when you open an excel sheet as
shown in the below screen shot.
Sheet area is the place where you type your text. The flashing vertical bar is called the
insertion point and it represents the location where text will appear when you type. When
you click on a box then the box is highlighted. When you double click the box, the
flashing vertical bar appears and you can start entering your data.
So, just keep your mouse cursor at the text insertion point and start typing whatever text
you would like to type. We have typed only two words "Hello Excel" as shown below.
The text appears to the left of the insertion point as you type.
There are following three important points, which would help you while typing −
 Press Tab to go to next column.
 Press Enter to go to next row.

 Press Alt + Enter to enter a new line in the same column.

Move Around in Excel 2010


Excel provides a number of ways to move around a sheet using the mouse and the
keyboard.
First of all, let us create some sample text before we proceed. Open a new excel sheet and
type any data. We've shown a sample data in the screenshot.
OrderDate Region Rep Item Units Unit Cost Total

1/6/2010 East Jones Pencil 95 1.99 189.05

1/23/2010 Central Kivell Binder 50 19.99 999.5

2/9/2010 Central Jardine Pencil 36 4.99 179.64

2/26/2010 Central Gill Pen 27 19.99 539.73

3/15/2010 West Sorvino Pencil 56 2.99 167.44

4/1/2010 East Jones Binder 60 4.99 299.4

4/18/2010 Central Andrews Pencil 75 1.99 149.25

5/5/2010 Central Jardine Pencil 90 4.99 449.1

5/22/2010 West Thompson Pencil 32 1.99 63.68

6/8/2010 East Jones Binder 60 8.99 539.4

6/25/2010 Central Morgan Pencil 90 4.99 449.1

7/12/2010 East Howard Binder 29 1.99 57.71

7/29/2010 East Parent Binder 81 19.99 1,619.19


8/15/2010 East Jones Pencil 35 4.99 174.65

Moving with Mouse


You can easily move the insertion point by clicking in your text anywhere on the screen.
Sometime if the sheet is big then you cannot see a place where you want to move. In such
situations, you would have to use the scroll bars, as shown in the following screen shot −

You can scroll your sheet by rolling your mouse wheel, which is equivalent to clicking
the up-arrow or down-arrow buttons in the scroll bar.

Moving with Scroll Bars


As shown in the above screen capture, there are two scroll bars: one for moving vertically
within the sheet, and one for moving horizontally. Using the vertical scroll bar, you may −
 Move upward by one line by clicking the upward-pointing scroll arrow.
 Move downward by one line by clicking the downward-pointing scroll arrow.
 Move one next page, using next page button (footnote).
 Move one previous page, using previous page button (footnote).
 Use Browse Object button to move through the sheet, going from one chosen object
to the next.
Moving with Keyboard
The following keyboard commands, used for moving around your sheet, also move the
insertion point −
Keystroke Where the Insertion Point Moves

Forward one box

Back one box

Up one box

Down one box

PageUp To the previous screen

PageDown To the next screen

Home To the beginning of the current screen

End To the end of the current screen

You can move box by box or sheet by sheet. Now click in any box containing data in the
sheet. You would have to hold down the Ctrl key while pressing an arrow key, which
moves the insertion point as described here −
Key Where the Insertion Point Moves
Combination

Ctrl + To the last box containing data of the current row.


Ctrl + To the first box containing data of the current row.

Ctrl + To the first box containing data of the current


column.

Ctrl + To the last box containing data of the current


column.

Ctrl + PageUp To the sheet in the left of the current sheet.

Ctrl + PageDown To the sheet in the right of the current sheet.

Ctrl + Home To the beginning of the sheet.

Ctrl + End To the end of the sheet.

Moving with Go To Command


Press F5 key to use Go To command, which will display a dialogue box where you will
find various options to reach to a particular box.
Normally, we use row and column number, for example K5 and finally press Go
To button.

Save Workbook in Excel 2010

Saving New Sheet


Once you are done with typing in your new excel sheet, it is time to save your
sheet/workbook to avoid losing work you have done on an Excel sheet. Following are the
steps to save an edited excel sheet −
Step 1 − Click the File tab and select Save As option.

Step 2 − Select a folder where you would like to save the sheet, Enter file name, which
you want to give to your sheet and Select a Save as type, by default it is .xlsx format.

Step 3 − Finally, click on Save button and your sheet will be saved with the entered name
in the selected folder.
Saving New Changes
There may be a situation when you open an existing sheet and edit it partially or
completely, or even you would like to save the changes in between editing of the sheet. If
you want to save this sheet with the same name, then you can use either of the following
simple options −
 Just press Ctrl + S keys to save the changes.
 Optionally, you can click on the floppy icon available at the top left corner and just
above the File tab. This option will also save the changes.
 You can also use third method to save the changes, which is the Save option
available just above the Save As option as shown in the above screen capture.
If your sheet is new and it was never saved so far, then with either of the three options,
word would display you a dialogue box to let you select a folder, and enter sheet name as
explained in case of saving new sheet.
Create Worksheet in Excel 2010
Creating New Worksheet
Three new blank sheets always open when you start Microsoft Excel. Below steps explain
you how to create a new worksheet if you want to start another new worksheet while you
are working on a worksheet, or you closed an already opened worksheet and want to start
a new worksheet.
Step 1 − Right Click the Sheet Name and select Insert option.

Step 2 − Now you'll see the Insert dialog with select Worksheet option as selected from
the general tab. Click the Ok button.
Now you should have your blank sheet as shown below ready to start typing your text.

You can use a short cut to create a blank sheet anytime. Try using the Shift+F11 keys and
you will see a new blank sheet similar to the above sheet is opened.
Copy Worksheet in Excel 2010

Copy Worksheet
First of all, let us create some sample text before we proceed. Open a new excel sheet and
type any data. We've shown a sample data in the screenshot.
OrderDate Region Rep Item Units Unit Cost Total

1/6/2010 East Jones Pencil 95 1.99 189.05

1/23/2010 Central Kivell Binder 50 19.99 999.5

2/9/2010 Central Jardine Pencil 36 4.99 179.64

2/26/2010 Central Gill Pen 27 19.99 539.73

3/15/2010 West Sorvino Pencil 56 2.99 167.44

4/1/2010 East Jones Binder 60 4.99 299.4

4/18/2010 Central Andrews Pencil 75 1.99 149.25

5/5/2010 Central Jardine Pencil 90 4.99 449.1

5/22/2010 West Thompson Pencil 32 1.99 63.68

6/8/2010 East Jones Binder 60 8.99 539.4

6/25/2010 Central Morgan Pencil 90 4.99 449.1

7/12/2010 East Howard Binder 29 1.99 57.71

7/29/2010 East Parent Binder 81 19.99 1,619.19

8/15/2010 East Jones Pencil 35 4.99 174.65


Here are the steps to copy an entire worksheet.
Step 1 − Right Click the Sheet Name and select the Move or Copy option.

Step 2 − Now you'll see the Move or Copy dialog with select Worksheet option as
selected from the general tab. Click the Ok button.
Select Create a Copy Checkbox to create a copy of the current sheet and Before sheet
option as (move to end) so that new sheet gets created at the end.
Press the Ok Button.
Now you should have your copied sheet as shown below.

You can rename the sheet by double clicking on it. On double click, the sheet name
becomes editable. Enter any name say Sheet5 and press Tab or Enter Key.
Hiding Worksheet in Excel 2010
Hiding Worksheet
Here is the step to hide a worksheet.
Step − Right Click the Sheet Name and select the Hide option. Sheet will get hidden.

Unhiding Worksheet
Here are the steps to unhide a worksheet.
Step 1 − Right Click on any Sheet Name and select the Unhide... option.
Step 2 − Select Sheet Name to unhide in Unhide dialog to unhide the sheet.
Press the Ok Button.
Now you will have your hidden sheet back.
Delete Worksheet in Excel 2010
Delete Worksheet
Here is the step to delete a worksheet.
Step − Right Click the Sheet Name and select the Delete option.

Sheet will get deleted if it is empty, otherwise you'll see a confirmation message.
Press the Delete Button.
Now your worksheet will get deleted.
Close Workbook in Excel 2010
Close Workbook
Here are the steps to close a workbook.
Step 1 − Click the Close Button as shown below.

You'll see a confirmation message to save the workbook.


Step 2 − Press the Save Button to save the workbook as we did in MS Excel - Save
Workbook chapter.
Now your worksheet will get closed.
Open Workbook in Excel 2010
Let us see how to open workbook from excel in the below mentioned steps.
Step 1 − Click the File Menu as shown below. You can see the Open option in File
Menu.
There are two more columns Recent workbooks and Recent places, where you can see the
recently opened workbooks and the recent places from where workbooks are opened.

Step 2 − Clicking the Open Option will open the browse dialog as shown below. Browse
the directory and find the file you need to open.

Step 3 − Once you select the workbook your workbook will be opened as below −
Context Help in Excel 2010
MS Excel provides context sensitive help on mouse over. To see context sensitive help for
a particular Menu option, hover the mouse over the option for some time. Then you can
see the context sensitive Help as shown below.

Getting More Help


For getting more help with MS Excel from Microsoft you can press F1 or by File → Help
→ Support → Microsoft Office Help.
Insert Data in Excel 2010
In MS Excel, there are 1048576*16384 cells. MS Excel cell can have Text, Numeric
value or formulas. An MS Excel cell can have maximum of 32000 characters.
Inserting Data
For inserting data in MS Excel, just activate the cell type text or number and press enter
or Navigation keys.

Inserting Formula
For inserting formula in MS Excel go to the formula bar, enter the formula and then press
enter or navigation key. See the screen-shot below to understand it.
Modifying Cell Content
For modifying the cell content just activate the cell, enter a new value and then press enter
or navigation key to see the changes. See the screen-shot below to understand it.

Select Data in Excel 2010


MS Excel provides various ways of selecting data in the sheet. Let us see those ways.
Select with Mouse
Drag the mouse over the data you want to select. It will select those cells as shown below.
Select with Special
If you want to select specific region, select any cell in that region. Pressing F5 will show
the below dialogue box.

Click on Special button to see the below dialogue box. Select current region from the
radio buttons. Click on ok to see the current region selected.
As you can see in the below screen, the data is selected for the current region.

Delete Data in Excel 2010


MS Excel provides various ways of deleting data in the sheet. Let us see those ways.
Delete with Mouse
Select the data you want to delete. Right Click on the sheet. Select the delete option, to
delete the data.
Delete with Delete Key
Select the data you want to delete. Press on the Delete Button from the keyboard, it will
delete the data.
Selective Delete for Rows
Select the rows, which you want to delete with Mouse click + Control Key. Then right
click to show the various options. Select the Delete option to delete the selected rows.

Move Data in Excel 2010


Let us see how we can Move Data with MS Excel.
Step 1 − Select the data you want to Move. Right Click and Select the cut option.
Step 2 − Select the first cell where you want to move the data. Right click on it and paste
the data. You can see the data is moved now.

Rows & Columns in Excel 2010


Row and Column Basics
MS Excel is in tabular format consisting of rows and columns.
 Row runs horizontally while Column runs vertically.
 Each row is identified by row number, which runs vertically at the left side of the
sheet.
 Each column is identified by column header, which runs horizontally at the top of the
sheet.
For MS Excel 2010, Row numbers ranges from 1 to 1048576; in total 1048576 rows, and
Columns ranges from A to XFD; in total 16384 columns.
Navigation with Rows and Columns
Let us see how to move to the last row or the last column.
 You can go to the last row by clicking Control + Down Navigation arrow.
 You can go to the last column by clicking Control + Right Navigation arrow.

Cell Introduction
The intersection of rows and columns is called cell.
Cell is identified with Combination of column header and row number.
For example − A1, A2.
Copy & Paste in Excel 2010
MS Excel provides copy paste option in different ways. The simplest method of copy
paste is as below.
Copy Paste
 To copy and paste, just select the cells you want to copy. Choose copy option after
right click or press Control + C.
 Select the cell where you need to paste this copied content. Right click and select
paste option or press Control + V.

In this case, MS Excel will copy everything such as values, formulas, Formats,
Comments and validation. MS Excel will overwrite the content with paste. If you want to
undo this, press Control + Z from the keyboard.
Copy Paste using Office Clipboard
When you copy data in MS Excel, it puts the copied content in Windows and Office
Clipboard. You can view the clipboard content by Home → Clipboard. View the
clipboard content. Select the cell where you need to paste. Click on paste, to paste the
content.
Copy Paste in Special way
You may not want to copy everything in some cases. For example, you want to copy only
Values or you want to copy only the formatting of cells. Select the paste special option as
shown below.

Below are the various options available in paste special.


 All − Pastes the cell’s contents, formats, and data validation from the Windows
Clipboard.
 Formulas − Pastes formulas, but not formatting.
 Values − Pastes only values not the formulas.
 Formats − Pastes only the formatting of the source range.
 Comments − Pastes the comments with the respective cells.
 Validation − Pastes validation applied in the cells.
 All using source theme − Pastes formulas, and all formatting.
 All except borders − Pastes everything except borders that appear in the source
range.
 Column Width − Pastes formulas, and also duplicates the column width of the
copied cells.
 Formulas & Number Formats − Pastes formulas and number formatting only.
 Values & Number Formats − Pastes the results of formulas, plus the number.
 Merge Conditional Formatting − This icon is displayed only when the copied cells
contain conditional formatting. When clicked, it merges the copied conditional
formatting with any conditional formatting in the destination range.
 Transpose − Changes the orientation of the copied range. Rows become columns,
and columns become rows. Any formulas in the copied range are adjusted so that
they work properly when transposed.

Find & Replace in Excel 2010


MS Excel provides Find & Replace option for finding text within the sheet.
Find and Replace Dialogue
Let us see how to access the Find & Replace Dialogue.
To access the Find & Replace, Choose Home → Find & Select → Find or press Control
+ F Key. See the image below.
You can see the Find and Replace dialogue as below.

You can replace the found text with the new text in the Replace tab.

Exploring Options
Now, let us see the various options available under the Find dialogue.
 Within − Specifying the search should be in Sheet or workbook.
 Search By − Specifying the internal search method by rows or by columns.
 Look In − If you want to find text in formula as well, then select this option.
 Match Case − If you want to match the case like lower case or upper case of words,
then check this option.
 Match Entire Cell Content − If you want the exact match of the word with cell,
then check this option.

Spell Check in Excel 2010


MS Excel provides a feature of Word Processing program called Spelling check. We can
get rid of the spelling mistakes with the help of spelling check feature.
Spell Check Basis
Let us see how to access the spell check.
 To access the spell checker, Choose Review ➪ Spelling or press F7.
 To check the spelling in just a particular range, select the range before you activate
the spell checker.
 If the spell checker finds any words it does not recognize as correct, it displays
the Spelling dialogue with suggested options.
Exploring Options
Let us see the various options available in spell check dialogue.
 Ignore Once − Ignores the word and continues the spell check.
 Ignore All − Ignores the word and all subsequent occurrences of it.
 Add to Dictionary − Adds the word to the dictionary.
 Change − Changes the word to the selected word in the Suggestions list.
 Change All − Changes the word to the selected word in the Suggestions list and
changes all subsequent occurrences of it without asking.
 AutoCorrect − Adds the misspelled word and its correct spelling (which you select
from the list) to the AutoCorrect list.
Zoom In/Out in Excel 2010
Zoom Slider
By default, everything on screen is displayed at 100% in MS Excel. You can change the
zoom percentage from 10% (tiny) to 400% (huge). Zooming doesn’t change the font size,
so it has no effect on the printed output.
You can view the zoom slider at the right bottom of the workbook as shown below.
Zoom In
You can zoom in the workbook by moving the slider to the right. It will change the only
view of the workbook. You can have maximum of 400% zoom in. See the below screen-
shot.

Zoom Out
You can zoom out the workbook by moving the slider to the left. It will change the only
view of the workbook. You can have maximum of 10% zoom in. See the below screen-
shot.
Special Symbols in Excel 2010
If you want to insert some symbols or special characters that are not found on the
keyboard in that case you need to use the Symbols option.
Using Symbols
Go to Insert » Symbols » Symbol to view available symbols. You can see many symbols
available there like Pi, alpha, beta, etc.
Select the symbol you want to add and click insert to use the symbol.

Using Special Characters


Go to Insert » Symbols » Special Characters to view the available special characters.
You can see many special characters available there like Copyright, Registered etc.
Select the special character you want to add and click insert, to use the special character.

Insert Comments in Excel 2010


Adding Comment to Cell
Adding comment to cell helps in understanding the purpose of cell, what input it should
have, etc. It helps in proper documentation.
To add comment to a cell, select the cell and perform any of the actions mentioned below.
 Choose Review » Comments » New Comment.
 Right-click the cell and choose Insert Comment from available options.

 Press Shift+F2.

Initially, a comment consists of Computer's user name. You have to modify it with text
for the cell comment.
Modifying Comment
You can modify the comment you have entered before as mentioned below.
 Select the cell on which the comment appears.
 Right-click the cell and choose the Edit Comment from the available options.
 Modify the comment.

Formatting Comment
Various formatting options are available for comments. For formatting a comment, Right
click on cell » Edit comment » Select comment » Right click on it » Format comment.
With formatting of comment you can change the color, font, size, etc of the comment.
Add Text Box in Excel 2010
Text Boxes
Text boxes are special graphic objects that combine the text with a rectangular graphic
object. Text boxes and cell comments are similar in displaying the text in rectangular box.
But text boxes are always visible, while cell comments become visible after selecting the
cell.
Adding Text Boxes
To add a text box, perform the below actions.
 Choose Insert » Text Box » choose text box or draw it.
Initially, the comment consists of Computer's user name. You have to modify it with text
for the cell comment.
Formatting Text Box
After you have added the text box, you can format it by changing the font, font size, font
style, and alignment, etc. Let us see some of the important options of formatting a text
box.
 Fill − Specifies the filling of text box like No fill, solid fill. Also specifying the
transparency of text box fill.
 Line Colour − Specifies the line colour and transparency of the line.
 Line Style − Specifies the line style and width.
 Size − Specifies the size of the text box.
 Properties − Specifies some properties of the text box.
 Text Box − Specifies text box layout, Auto-fit option and internal margins.

Undo Changes in Excel 2010


Undo Changes
You can reverse almost every action in Excel by using the Undo command. We can undo
changes in following two ways.
 From the Quick access tool-bar » Click Undo.
 Press Control + Z.

You can reverse the effects of the past 100 actions that you performed by executing Undo
more than once. If you click the arrow on the right side of the Undo button, you see a list
of the actions that you can reverse. Click an item in that list to undo that action and all the
subsequent actions you performed.
Redo Changes
You can again reverse back the action done with undo in Excel by using the Redo
command. We can redo changes in following two ways.
 From the Quick access tool-bar » Click Redo.
 Press Control + Y.

Setting Cell Type in Excel 2010


Formatting Cell
MS Excel Cell can hold different types of data like Numbers, Currency, Dates, etc. You
can set the cell type in various ways as shown below −
 Right Click on the cell » Format cells » Number.
 Click on the Ribbon from the ribbon.
Various Cell Formats
Below are the various cell formats.
 General − This is the default cell format of Cell.
 Number − This displays cell as number with separator.
 Currency − This displays cell as currency i.e. with currency sign.
 Accounting − Similar to Currency, used for accounting purpose.
 Date − Various date formats are available under this like 17-09-2013, 17 th-Sep-2013,
etc.
 Time − Various Time formats are available under this, like 1.30PM, 13.30, etc.
 Percentage − This displays cell as percentage with decimal places like 50.00%.
 Fraction − This displays cell as fraction like 1/4, 1/2 etc.
 Scientific − This displays cell as exponential like 5.6E+01.
 Text − This displays cell as normal text.
 Special − Special formats of cell like Zip code, Phone Number.
 Custom − You can use custom format by using this.
Setting Fonts in Excel 2010
You can assign any of the fonts that is installed for your printer to cells in a worksheet.
Setting Font from Home
You can set the font of the selected text from Home » Font group » select the font.
Setting Font From Format Cell Dialogue
 Right click on cell » Format cells » Font Tab
 Press Control + 1 or Shift + Control + F

Text Decoration in Excel 2010


You can change the text decoration of the cell to change its look and feel.
Text Decoration
Various options are available in Home tab of the ribbon as mentioned below.
 Bold − It makes the text in bold by choosing Home » Font Group » Click B or
Press Control + B.
 Italic − It makes the text italic by choosing Home » Font Group » Click I or
Press Control + I.
 Underline − It makes the text to be underlined by choosing Home » Font Group »
Click U or Press Control + U.
 Double Underline − It makes the text highlighted as double underlined by
choose Home » Font Group » Click arrow near U » Select Double Underline.

More Text Decoration Options


There are more options available for text decoration in Formatting cells » Font Tab
»Effects cells as mentioned below.
 Strike-through − It strikes the text in the center vertically.
 Super Script − It makes the content to appear as a super script.
 Sub Script − It makes content to appear as a sub script.
Rotate Cells in Excel 2010
You can rotate the cell by any degree to change the orientation of the cell.
Rotating Cell from Home Tab
Click on the orientation in the Home tab. Choose options available like Angle
CounterClockwise, Angle Clockwise, etc.

Rotating Cell from Formatting Cell


Right Click on the cell. Choose Format cells » Alignment » Set the degree for rotation.

Setting Colors in Excel 2010


You can change the background color of the cell or text color.
Changing Background Color
By default the background color of the cell is white in MS Excel. You can change it as per
your need from Home tab » Font group » Background color.

Changing Foreground Color


By default, the foreground or text color is black in MS Excel. You can change it as per
your need from Home tab » Font group » Foreground color.

Also you can change the foreground color by selecting the cell Right click » Format
cells » Font Tab » Color.
Text Alignments in Excel 2010
If you don’t like the default alignment of the cell, you can make changes in the alignment
of the cell. Below are the various ways of doing it.
Change Alignment from Home Tab
You can change the Horizontal and vertical alignment of the cell. By default, Excel aligns
numbers to the right and text to the left. Click on the available option in the Alignment
group in Home tab to change alignment.

Change Alignment from Format Cells


Right click on the cell and choose format cell. In format cells dialogue,
choose Alignment Tab. Select the available options from the Vertical alignment and
Horizontal alignment options.
Exploring Alignment Options
1. Horizontal Alignment − You can set horizontal alignment to Left, Centre, Right, etc.
 Left − Aligns the cell contents to the left side of the cell.
 Center − Centers the cell contents in the cell.
 Right − Aligns the cell contents to the right side of the cell.
 Fill − Repeats the contents of the cell until the cell’s width is filled.
 Justify − Justifies the text to the left and right of the cell. This option is applicable
only if the cell is formatted as wrapped text and uses more than one line.
2. Vertical Alignment − You can set Vertical alignment to top, Middle, bottom, etc.
 Top Aligns the cell contents to the top of the cell.
 Center Centers the cell contents vertically in the cell.
 Bottom Aligns the cell contents to the bottom of the cell.
 Justify Justifies the text vertically in the cell; this option is applicable only if the cell
is formatted as wrapped text and uses more than one line.
Merge & Wrap in Excel 2010
Merge Cells
MS Excel enables you to merge two or more cells. When you merge cells, you don’t
combine the contents of the cells. Rather, you combine a group of cells into a single cell
that occupies the same space.
You can merge cells by various ways as mentioned below.
 Choose Merge & Center control on the Ribbon, which is simpler. To merge cells,
select the cells that you want to merge and then click the Merge & Center button.
 Choose Alignment tab of the Format Cells dialogue box to merge the cells.

Additional Options
The Home » Alignment group » Merge & Center control contains a drop-down list
with these additional options −
 Merge Across − When a multi-row range is selected, this command creates multiple
merged cells — one for each row.
 Merge Cells − Merges the selected cells without applying the Center attribute.
 Unmerge Cells − Unmerges the selected cells.
Wrap Text and Shrink to Fit
If the text is too wide to fit the column width but don’t want that text to spill over into
adjacent cells, you can use either the Wrap Text option or the Shrink to Fit option to
accommodate that text.
Borders and Shades in Excel 2010
Apply Borders
MS Excel enables you to apply borders to the cells. For applying border, select the range
of cells Right Click » Format cells » Border Tab » Select the Border Style.

Then you can apply border by Home Tab » Font group »Apply Borders.
Apply Shading
You can add shading to the cell from the Home tab » Font Group » Select the Color.

Apply Formatting in Excel 2010


Formatting Cells
In MS Excel, you can apply formatting to the cell or range of cells by Right Click »
Format cells » Select the tab. Various tabs are available as shown below
Alternative to Placing Background
 Number − You can set the Format of the cell depending on the cell content. Find
tutorial on this at MS Excel - Setting Cell Type.
 Alignment − You can set the alignment of text on this tab. Find tutorial on this
at MS Excel - Text Alignments.
 Font − You can set the Font of text on this tab.Find tutorial on this at MS Excel -
Setting Fonts.
 Border − You can set border of cell with this tab.Find tutorial on this at MS Excel -
Borders and Shades.
 Fill − You can set fill of cell with this tab. Find tutorial on this at MS Excel - Borders
and Shades.
 Protection − You can set cell protection option with this tab.
Sheet Options in Excel 2010
Sheet Options
MS Excel provides various sheet options for printing purpose like generally cell gridlines
aren’t printed. If you want your printout to include the gridlines, Choose Page Layout »
Sheet Options group » Gridlines » Check Print.
Options in Sheet Options Dialogue
 Print Area − You can set the print area with this option.
 Print Titles − You can set titles to appear at the top for rows and at the left for
columns.
 Print −
o Gridlines − Gridlines to appear while printing worksheet.

o Black & White − Select this check box to have your color printer print the chart

in black and white.


o Draft quality − Select this check box to print the chart using your printer’s

draft-quality setting.
o Rows & Column Heading − Select this check box to have rows and column

heading to print.
 Page Order −
o Down, then Over − It prints the down pages first and then the right pages.

o Over, then Down − It prints right pages first and then comes to print the down

pages.
Adjust Margins in Excel 2010
Margins
Margins are the unprinted areas along the sides, top, and bottom of a printed page. All
printed pages in MS Excel have the same margins. You can’t specify different margins for
different pages.
You can set margins by various ways as explained below.
 Choose Page Layout » Page Setup » Margins drop-down list, you can select Normal,
Wide, Narrow, or the custom Setting.
 These options are also available when you choose File » Print.

If none of these settings does the job, choose Custom Margins to display the Margins tab
of the Page Setup dialog box, as shown below.

Center on Page
By default, Excel aligns the printed page at the top and left margins. If you want the
output to be centered vertically or horizontally, select the appropriate check box in the
Center on Page section of the Margins tab as shown in the above screenshot.
Page Orientation in Excel 2010
Page Orientation
Page orientation refers to how output is printed on the page. If you change the orientation,
the onscreen page breaks adjust automatically to accommodate the new paper orientation.
Types of Page Orientation
 Portrait − Portrait to print tall pages (the default).
 Landscape − Landscape to print wide pages. Landscape orientation is useful when
you have a wide range that doesn’t fit on a vertically oriented page.
Changing Page Orientation
 Choose Page Layout » Page Setup » Orientation » Portrait or Landscape.

 Choose File » Print.


Header and Footer in Excel 2010
Header and Footer
A header is the information that appears at the top of each printed page and a footer is the
information that appears at the bottom of each printed page. By default, new workbooks
do not have headers or footers.
Adding Header and Footer
 Choose Page Setup dialog box » Header or Footer tab.

You can choose the predefined header and footer or create your custom ones.
 &[Page] − Displays the page number.
 &[Pages] − Displays the total number of pages to be printed.
 &[Date] − Displays the current date.
 &[Time] − Displays the current time.
 &[Path]&[File] − Displays the workbook’s complete path and filename.
 &[File] − Displays the workbook name.
 &[Tab] − Displays the sheet’s name.
Other Header and Footer Options
When a header or footer is selected in Page Layout view, the Header & Footer » Design
» Options group contains controls that let you specify other options −
 Different First Page − Check this to specify a different header or footer for the first
printed page.
 Different Odd & Even Pages − Check this to specify a different header or footer for
odd and even pages.
 Scale with Document − If checked, the font size in the header and footer will be
sized. Accordingly if the document is scaled when printed. This option is enabled, by
default.
 Align with Page Margins − If checked, the left header and footer will be aligned
with the left margin, and the right header and footer will be aligned with the right
margin. This option is enabled, by default.
Insert Page Break in Excel 2010
Page Breaks
If you don’t want a row to print on a page by itself or you don't want a table header row to
be the last line on a page. MS Excel gives you precise control over page breaks.
MS Excel handles page breaks automatically, but sometimes you may want to force a
page break either a vertical or a horizontal one. so that the report prints the way you
want.
For example, if your worksheet consists of several distinct sections, you may want to print
each section on a separate sheet of paper.
Inserting Page Breaks
Insert Horizontal Page Break − For example, if you want row 14 to be the first row of a
new page, select cell A14. Then choose Page Layout » Page Setup Group » Breaks»
Insert Page Break.

Insert vertical Page break − In this case, make sure to place the pointer in row 1.
Choose Page Layout » Page Setup » Breaks » Insert Page Break to create the page
break.
Removing Page Breaks
 Remove a page break you’ve added − Move the cell pointer to the first row beneath
the manual page break and then choose Page Layout » Page Setup » Breaks »
Remove Page Break.
 Remove all manual page breaks − Choose Page Layout » Page Setup » Breaks »
Reset All Page Breaks.
Set Background in Excel 2010
Background Image
Unfortunately, you cannot have a background image on your printouts. You may have
noticed the Page Layout » Page Setup » Background command. This button displays a
dialogue box that lets you select an image to display as a background. Placing this control
among the other print-related commands is very misleading. Background images placed
on a worksheet are never printed.
Alternative to Placing Background
 You can insert a Shape, WordArt, or a picture on your worksheet and then adjust its
transparency. Then copy the image to all printed pages.
 You can insert an object in a page header or footer.
Freeze Panes in Excel 2010
Freezing Panes
If you set up a worksheet with row or column headings, these headings will not be visible
when you scroll down or to the right. MS Excel provides a handy solution to this problem
with freezing panes. Freezing panes keeps the headings visible while you’re scrolling
through the worksheet.
Using Freeze Panes
Follow the steps mentioned below to freeze panes.
 Select the First row or First Column or the row Below, which you want to freeze, or
Column right to area, which you want to freeze.
 Choose View Tab » Freeze Panes.
 Select the suitable option −
o Freeze Panes − To freeze area of cells.

o Freeze Top Row − To freeze first row of worksheet.

o Freeze First Column − To freeze first Column of worksheet.

 If you have selected Freeze top row you can see the first row appears at the top, after
scrolling also. See the below screen-shot.
Unfreeze Panes
To unfreeze Panes, choose View Tab » Unfreeze Panes.
Conditional Format in Excel 2010
Conditional Formatting
MS Excel 2010 Conditional Formatting feature enables you to format a range of values so
that the values outside certain limits, are automatically formatted.
Choose Home Tab » Style group » Conditional Formatting dropdown.
Various Conditional Formatting Options
 Highlight Cells Rules − It opens a continuation menu with various options for
defining the formatting rules that highlight the cells in the cell selection that contain
certain values, text, or dates, or that have values greater or less than a particular
value, or that fall within a certain ranges of values.
Suppose you want to find cell with Amount 0 and Mark them as red.Choose Range of cell
» Home Tab » Conditional Formatting DropDown » Highlight Cell Rules » Equal To.
After Clicking ok, the cells with value zero are marked as red.

 Top/Bottom Rules − It opens a continuation menu with various options for defining
the formatting rules that highlight the top and bottom values, percentages, and above
and below average values in the cell selection.
Suppose you want to highlight the top 10% rows you can do this with these Top/Bottom
rules.
 Data Bars − It opens a palette with different color data bars that you can apply to the
cell selection to indicate their values relative to each other by clicking the data bar
thumbnail.
With this conditional Formatting data Bars will appear in each cell.

 Color Scales − It opens a palette with different three- and two-colored scales that
you can apply to the cell selection to indicate their values relative to each other by
clicking the color scale thumbnail.
See the below screenshot with Color Scales, conditional formatting applied.
 Icon Sets − It opens a palette with different sets of icons that you can apply to the
cell selection to indicate their values relative to each other by clicking the icon set.
See the below screenshot with Icon Sets conditional formatting applied.

 New Rule − It opens the New Formatting Rule dialog box, where you define a
custom conditional formatting rule to apply to the cell selection.
 Clear Rules − It opens a continuation menu, where you can remove the conditional
formatting rules for the cell selection by clicking the Selected Cells option, for the
entire worksheet by clicking the Entire Sheet option, or for just the current data table
by clicking the This Table option.
 Manage Rules − It opens the Conditional Formatting Rules Manager dialog box,
where you edit and delete particular rules as well as adjust their rule precedence by
moving them up or down in the Rules list box.
Creating Formulas in Excel 2010
Formulas in MS Excel
Formulas are the Bread and butter of worksheet. Without formula, worksheet will be just
simple tabular representation of data. A formula consists of special code, which is entered
into a cell. It performs some calculations and returns a result, which is displayed in the
cell.
Formulas use a variety of operators and worksheet functions to work with values and text.
The values and text used in formulas can be located in other cells, which makes changing
data easy and gives worksheets their dynamic nature. For example, you can quickly
change the data in a worksheet and formulas works.
Elements of Formulas
A formula can consist of any of these elements −
 Mathematical operators, such as +(for addition) and *(for multiplication)
Example −
o =A1+A2 Adds the values in cells A1 and A2.
 Values or text
Example −
o =200*0.5 Multiplies 200 times 0.15. This formula uses only values, and it
always returns the same result as 100.
 Cell references (including named cells and ranges)
Example −
o=A1=C12 Compares cell A1 with cell C12. If the cells are identical, the formula
returns TRUE; otherwise, it returns FALSE.
 Worksheet functions (such as SUMor AVERAGE)
Example −
o =SUM(A1:A12) Adds the values in the range A1:A12.
Creating Formula
For creating a formula you need to type in the Formula Bar. Formula begins with '=' sign.
When building formulas manually, you can either type in the cell addresses or you can
point to them in the worksheet. Using the Pointing method to supply the cell addresses
for formulas is often easier and more powerful method of formula building. When you are
using built-in functions, you click the cell or drag through the cell range that you want to
use when defining the function’s arguments in the Function Arguments dialog box. See
the below screen shot.
As soon as you complete a formula entry, Excel calculates the result, which is then
displayed inside the cell within the worksheet (the contents of the formula, however,
continue to be visible on the Formula bar anytime the cell is active). If you make an error
in the formula that prevents Excel from being able to calculate the formula at all, Excel
displays an Alert dialog box suggesting how to fix the problem.
Copying Formulas in Excel 2010
Copying Formulas in MS Excel
Copying formulas is one of the most common tasks that you do in a typical spreadsheet
that relies primarily on formulas. When a formula uses cell references rather than constant
values, Excel makes the task of copying an original formula to every place that requires a
similar formula.
Relative Cell Addresses
MS Excel does it automatically adjusting the cell references in the original formula to suit
the position of the copies that you make. It does this through a system known as relative
cell addresses, where by the column references in the cell address in the formula change
to suit their new column position and the row references change to suit their new row
position.
Let us see this with the help of example. Suppose we want the sum of all the rows at last,
then we will write a formula for first column i.e. B. We want sum of the rows from 3 to 8
in the 9th row.
After writing formula in the 9th row, we can drag it to remaining columns and the formula
gets copied. After dragging we can see the formula in the remaining columns as below.
 column C : =SUM(C3:C8)
 column D : =SUM(D3:D8)
 column E : =SUM(E3:E8)
 column F : =SUM(F3:F8)
 column G : =SUM(G3:G8)

Formula Reference in Excel 2010


Cell References in Formulas
Most formulas you create include references to cells or ranges. These references enable
your formulas to work dynamically with the data contained in those cells or ranges. For
example, if your formula refers to cell C2 and you change the value contained in C2, the
formula result reflects new value automatically. If you didn’t use references in your
formulas, you would need to edit the formulas themselves in order to change the values
used in the formulas.
When you use a cell (or range) reference in a formula, you can use three types of
references − relative, absolute, and mixed references.
Relative Cell References
The row and column references can change when you copy the formula to another cell
because the references are actually offsets from the current row and column. By default,
Excel creates relative cell references in formulas.

Absolute Cell References


The row and column references do not change when you copy the formula because the
reference is to an actual cell address. An absolute reference uses two dollar signs in its
address: one for the column letter and one for the row number (for example, $A$5).
Mixed Cell References
Both the row or column reference is relative and the other is absolute. Only one of the
address parts is absolute (for example, $A5 or A$5).

Using Functions in Excel 2010


Functions in Formula
Many formulas you create use available worksheet functions. These functions enable you
to greatly enhance the power of your formulas and perform calculations that are difficult
if you use only the operators. For example, you can use the LOG or SIN function to
calculate the Logarithm or Sin ratio. You can’t do this complicated calculation by using
the mathematical operators alone.
Using Functions
When you type = sign and then type any alphabet you will see the searched functions as
below.

Suppose you need to determine the largest value in a range. A formula can’t tell you the
answer without using a function. We will use formula that uses the MAX function to
return the largest value in the range B3:B8 as =MAX(A1:D100).

Another example of functions. Suppose you want to find if the cell of month is greater
than 1900 then we can give Bonus to Sales representative. The we can achieve it with
writing formula with IF functions as =IF(B9>1900,"Yes","No")
Function Arguments
In the above examples, you may have noticed that all the functions used parentheses. The
information inside the parentheses is the list of arguments.
Functions vary in how they use arguments. Depending on what it has to do, a function
may use.
 No arguments − Examples − Now(), Date(), etc.
 One argument − UPPER(), LOWER(), etc.
 A fixed number of arguments − IF(), MAX(), MIN(), AVERGAGE(), etc.
 Infinite number of arguments
 Optional arguments
Built-in Functions in Excel 2010
Built In Functions
MS Excel has many built in functions, which we can use in our formula. To see all the
functions by category, choose Formulas Tab » Insert Function. Then Insert function
Dialog appears from which we can choose the function.
Functions by Categories
Let us see some of the built in functions in MS Excel.
 Text Functions
o LOWER − Converts all characters in a supplied text string to lower case

o UPPER − Converts all characters in a supplied text string to upper case

o TRIM − Removes duplicate spaces, and spaces at the start and end of a text

string
o CONCATENATE − Joins together two or more text strings.

o LEFT − Returns a specified number of characters from the start of a supplied

text string.
o MID − Returns a specified number of characters from the middle of a supplied

text string
o RIGHT − Returns a specified number of characters from the end of a supplied

text string.
o LEN − Returns the length of a supplied text string

o FIND − Returns the position of a supplied character or text string from within a

supplied text string (case-sensitive).


 Date & Time
o DATE − Returns a date, from a user-supplied year, month and day.

o TIME − Returns a time, from a user-supplied hour, minute and second.

o DATEVALUE − Converts a text string showing a date, to an integer that

represents the date in Excel's date-time code.


o TIMEVALUE − Converts a text string showing a time, to a decimal that

represents the time in Excel.


o NOW − Returns the current date & time.

o TODAY − Returns today's date.

 Statistical
o MAX − Returns the largest value from a list of supplied numbers.

o MIN − Returns the smallest value from a list of supplied numbers.


o AVERAGE − Returns the Average of a list of supplied numbers.
o COUNT − Returns the number of numerical values in a supplied set of cells or

values.
o COUNTIF − Returns the number of cells (of a supplied range), that satisfies a

given criteria.
o SUM − Returns the sum of a supplied list of numbers

 Logical
o AND − Tests a number of user-defined conditions and returns TRUE if ALL of

the conditions evaluate to TRUE, or FALSE otherwise


o OR − Tests a number of user-defined conditions and returns TRUE if ANY of

the conditions evaluate to TRUE, or FALSE otherwise.


o NOT − Returns a logical value that is the opposite of a user supplied logical

value or expression i.e. returns FALSE if the supplied argument is TRUE and
returns TRUE if the supplied argument is FAL
 Math & Trig
o ABS − Returns the absolute value (i.e. the modulus) of a supplied number.

o SIGN − Returns the sign (+1, -1 or 0) of a supplied number.

o SQRT − Returns the positive square root of a given number.

o MOD − Returns the remainder from a division between two supplied numbers.

Data Filtering in Excel 2010


Filters in MS Excel
Filtering data in MS Excel refers to displaying only the rows that meet certain conditions.
(The other rows gets hidden.)
Using the store data, if you are interested in seeing data where Shoe Size is 36, then you
can set filter to do this. Follow the below mentioned steps to do this.
 Place a cursor on the Header Row.
 Choose Data Tab » Filter to set filter.
 Click the drop-down arrow in the Area Row Header and remove the check mark from
Select All, which unselects everything.
 Then select the check mark for Size 36 which will filter the data and displays data of
Shoe Size 36.
 Some of the row numbers are missing; these rows contain the filtered (hidden) data.
 There is drop-down arrow in the Area column now shows a different graphic — an
icon that indicates the column is filtered.

Using Multiple Filters


You can filter the records by multiple conditions i.e. by multiple column values. Suppose
after size 36 is filtered, you need to have the filter where color is equal to Coffee. After
setting filter for Shoe Size, choose Color column and then set filter for color.
Data Sorting in Excel 2010
Sorting in MS Excel
Sorting data in MS Excel rearranges the rows based on the contents of a particular
column. You may want to sort a table to put names in alphabetical order. Or, maybe you
want to sort data by Amount from smallest to largest or largest to smallest.
To Sort the data follow the steps mentioned below.
 Select the Column by which you want to sort data.
 Choose Data Tab » Sort Below dialog appears.

 If you want to sort data based on a selected column, Choose Continue with the
selection or if you want sorting based on other columns, choose Expand Selection.
 You can Sort based on the below Conditions.
o Values − Alphabetically or numerically.
o Cell Color − Based on Color of Cell.
o Font Color − Based on Font color.
o Cell Icon − Based on Cell Icon.

 Clicking Ok will sort the data.

Sorting option is also available from the Home Tab. Choose Home Tab » Sort & Filter.
You can see the same dialog to sort records.
Using Ranges in Excel 2010
Ranges in MS Excel
A cell is a single element in a worksheet that can hold a value, some text, or a formula. A
cell is identified by its address, which consists of its column letter and row number. For
example, cell B1 is the cell in the second column and the first row.
A group of cells is called a range. You designate a range address by specifying its upper-
left cell address and its lower-right cell address, separated by a colon.
Example of Ranges −
 C24 − A range that consists of a single cell.
 A1:B1 − Two cells that occupy one row and two columns.
 A1:A100 − 100 cells in column A.
 A1:D4 − 16 cells (four rows by four columns).
Selecting Ranges
You can select a range in several ways −
 Press the left mouse button and drag, highlighting the range. Then release the mouse
button. If you drag to the end of the screen, the worksheet will scroll.
 Press the Shift key while you use the navigation keys to select a range.
 Press F8 and then move the cell pointer with the navigation keys to highlight the
range. Press F8 again to return the navigation keys to normal movement.
 Type the cell or range address into the Name box and press Enter. Excel selects the
cell or range that you specified.
Selecting Complete Rows and Columns
When you need to select an entire row or column. You can select entire rows and columns
in much the same manner as you select ranges −
 Click the row or column border to select a single row or column.
 To select multiple adjacent rows or columns, click a row or column border and drag
to highlight additional rows or columns.
 To select multiple (nonadjacent) rows or columns, press Ctrl while you click the row
or column borders that you want.

Data Validation in Excel 2010


Data Validation
MS Excel data validation feature allows you to set up certain rules that dictate what can
be entered into a cell. For example, you may want to limit data entry in a particular cell to
whole numbers between 0 and 10. If the user makes an invalid entry, you can display a
custom message as shown below.
Validation Criteria
To specify the type of data allowable in a cell or range, follow the steps below, which
shows all the three tabs of the Data Validation dialog box.
 Select the cell or range.
 Choose Data » Data Tools » Data Validation. Excel displays its Data Validation
dialog box having 3 tabs settings, Input Message and Error alert.
Settings Tab
Here you can set the type of validation you need. Choose an option from the Allow drop-
down list. The contents of the Data Validation dialog box will change, displaying controls
based on your choice.
 Any Value − Selecting this option removes any existing data validation.
 Whole Number − The user must enter a whole number.For example, you can specify
that the entry must be a whole number greater than or equal to 50.
 Decimal − The user must enter a number. For example, you can specify that the entry
must be greater than or equal to 10 and less than or equal to 20.
 List − The user must choose from a list of entries you provide. You will create drop-
down list with this validation. You have to give input ranges then those values will
appear in the drop-down.
 Date − The user must enter a date. You specify a valid date range from choices in the
Data drop-down list. For example, you can specify that the entered data must be
greater than or equal to January 1, 2013, and less than or equal to December 31,
2013.
 Time − The user must enter a time. You specify a valid time range from choices in
the Data drop-down list. For example, you can specify that the entered data must be
later than 12:00 p.m.
 Text Length − The length of the data (number of characters) is limited. You specify
a valid length by using the Data drop-down list. For example, you can specify that
the length of the entered data be 1 (a single alphanumeric character).
 Custom − To use this option, you must supply a logical formula that determines the
validity of the user’s entry (a logical formula returns either TRUE or FALSE).

Input Message Tab


You can set the input help message with this tab. Fill the title and Input message of the
Input message tab and the input message will appear when the cell is selected.
Error Alert Tab
You can specify an error message with this tab. Fill the title and error message. Select the
style of the error as stop, warning or Information as per you need.

Using Styles in Excel 2010


Using Styles in MS Excel
With MS Excel 2010 Named styles make it very easy to apply a set of predefined
formatting options to a cell or range. It saves time as well as make sure that look of the
cells are consistent.
A Style can consist of settings for up to six different attributes −
 Number format
 Font (type, size, and color)

 Alignment (vertical and horizontal)

 Borders

 Pattern

 Protection (locked and hidden)

Now, let us see how styles are helpful. Suppose that you apply a particular style to some
twenty cells scattered throughout your worksheet. Later, you realize that these cells
should have a font size of 12 pt. rather than 14 pt. Rather than changing each cell, simply
edit the style. All cells with that particular style change automatically.
Applying Styles
Choose Home » Styles » Cell Styles. Note that this display is a live preview, that is, as
you move your mouse over the style choices, the selected cell or range temporarily
displays the style. When you see a style you like, click it to apply the style to the
selection.

Creating Custom Style in MS Excel


We can create new custom style in Excel 2010. To create a new style, follow these steps −
 Select a cell and click on Cell styles from Home Tab.
 Click on New Cell Style and give style name.
 Click on Format to apply formatting to the cell.
 After applying formatting click on OK. This will add new style in the styles. You can
view it on Home » Styles.

Using Themes in Excel 2010


Using Themes in MS Excel
To help users create more professional-looking documents, MS Excel has incorporated a
concept known as document themes. By using themes, it is easy to specify the colors,
fonts, and a variety of graphic effects in a document. And best of all, changing the entire
look of your document is a breeze. A few mouse clicks is all it takes to apply a different
theme and change the look of your workbook.
Applying Themes
Choose Page layout Tab » Themes Dropdown. Note that this display is a live preview,
that is, as you move your mouse over the Theme, it temporarily displays the theme effect.
When you see a style you like, click it to apply the style to the selection.
Creating Custom Theme in MS Excel
We can create new custom Theme in Excel 2010. To create a new style, follow these
steps −
 Click on the save current theme option under Theme in Page Layout Tab.
 This will save the current theme to office folder.
 You can browse the theme later to load the theme.
Using Templates in Excel 2010
Using Templates in MS Excel
Template is essentially a model that serves as the basis for something. An Excel template
is a workbook that’s used to create other workbooks.
Viewing Available Templates
To view the Excel templates, choose File » New to display the available templates screen
in Backstage View. You can select a template stored on your hard drive, or a template
from Microsoft Office Online. If you choose a template from Microsoft Office Online,
you must be connected to the Internet to download it. The Office Online Templates
section contains a number of icons, which represents various categories of templates.
Click an icon, and you’ll see the available templates. When you select a template
thumbnail, you can see a preview in the right panel.

On-line Templates
These template data is available online at the Microsoft server. When you select the
template and click on it, it will download the template data from Microsoft server and
opens it as shown below.
Using Templates in MS Excel
Template is essentially a model that serves as the basis for something. An Excel template
is a workbook that’s used to create other workbooks.
Viewing Available Templates
To view the Excel templates, choose File » New to display the available templates screen
in Backstage View. You can select a template stored on your hard drive, or a template
from Microsoft Office Online. If you choose a template from Microsoft Office Online,
you must be connected to the Internet to download it. The Office Online Templates
section contains a number of icons, which represents various categories of templates.
Click an icon, and you’ll see the available templates. When you select a template
thumbnail, you can see a preview in the right panel.

On-line Templates
These template data is available online at the Microsoft server. When you select the
template and click on it, it will download the template data from Microsoft server and
opens it as shown below.
Using Macros in Excel 2010
Macros in MS Excel
Macros enable you to automate almost any task that you can undertake in Excel 2010. By
using macro recorder from View Tab » Macro Dropdown to record tasks that you
perform routinely, you not only speed up the procedure considerably but you are assured
that each step in a task is carried out the same way each and every time you perform a
task.
To view macros choose View Tab » Macro dropdown.

Macro Options
View tab contains a Macros command button to which a dropdown menu containing the
following three options.
 View Macros − Opens the Macro dialog box where you can select a macro to run or
edit.
 Record Macro − Opens the Record Macro dialog box where you define the settings
for your new macro and then start the macro recorder; this is the same as clicking the
Record Macro button on the Status bar.
 Use Relative References − Uses relative cell addresses when recording a macro,
making the macro more versatile by enabling you to run it in areas of a worksheet
other than the ones originally used in the macro’s recording.
Creating Macros
You can create macros in one of two ways −
 Use MS Excel’s macro recorder to record your actions as you undertake them in a
worksheet.
 Enter the instructions that you want to be followed in a VBA code in the Visual Basic
Editor.
Now let's create a simple macro that will automate the task of making cell content Bold
and apply cell color.
 Choose View Tab » Macro dropdown.
 Click on Record Macro as below.

 Now Macro recording will start.


 Do the steps of action, which you want to perform repeatedly. Macro will record
those steps.
 You can stop the macro recording once done with all steps.
Edit Macro
You can edit the created Macro at any time. Editing macro will take you to the VBA
programming editor.

Adding Graphics in Excel 2010


Graphic Objects in MS Excel
MS Excel supports various types of graphic objects like Shapes gallery, SmartArt, Text
Box, and WordArt available on the Insert tab of the Ribbon.Graphics are available in
the Insert Tab. See the screenshots below for various available graphics in MS Excel
2010.
Insert Shape
 Choose Insert Tab » Shapes dropdown.
 Select the shape you want to insert. Click on shape to insert it.
 To edit the inserted shape just drag the shape with the mouse. Shape will adjust the
shape.

Insert Smart Art


 Choose Insert Tab » SmartArt.
 Clicking SmartArt will open the SmartArt dialogue as shown below in the screen-
shot. Choose from the list of available smartArts.
 Click on SmartArt to Insert it in the worksheet.
 Edit the SmartArt as per your need.
Insert Clip Art
 Choose Insert Tab » Clip Art.
 Clicking Clip Art will open the search box as shown in the below screen-shot.
Choose from the list of available Clip Arts.
 Click on Clip Art to Insert it in the worksheet.

Insert Word Art


 Choose Insert Tab » WordArt.
 Select the style of WordArt, which you like and click it to enter a text in it.

Cross Referencing in Excel 2010


Graphic Objects in MS Excel
When you have information spread across several different spreadsheets, it can seem a
daunting task to bring all these different sets of data together into one meaningful list or
table. This is where the Vlookup function comes into its own.
VLOOKUP
VlookUp searches for a value vertically down for the lookup table.
VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) has 4 parameters as
below.
 lookup_value − It is the user input. This is the value that the function uses to search
on.
 The table_array − It is the area of cells in which the table is located. This includes
not only the column being searched on, but the data columns for which you are going
to get the values that you need.
 Col_index_num − It is the column of data that contains the answer that you want.
 Range_lookup − It is a TRUE or FALSE value. When set to TRUE, the lookup
function gives the closest match to the lookup_value without going over the
lookup_value. When set to FALSE, an exact match must be found to the
lookup_value or the function will return #N/A. Note, this requires that the column
containing the lookup_value be formatted in ascending order.
VLOOKUP Example
Let's look at a very simple example of cross-referencing two spreadsheets. Each
spreadsheet contains information about the same group of people. The first spreadsheet
has their dates of birth, and the second shows their favorite color. How do we build a list
showing the person's name, their date of birth and their favorite color? VLOOOKUP will
help in this case. First of all, let us see data in both the sheets.
This is data in the first sheet
This is data in the second sheet

Now for finding the respective favorite color for that person from another sheet we need
to vlookup the data. First argument to the VLOOKUP is lookup value (In this case it is
person name). Second argument is the table array, which is table in the second sheet from
B2 to C11. Third argument to VLOOKUP is Column index num, which is the answer we
are looking for. In this case, it is 2 the color column number is 2. The fourth argument is
True returning partial match or false returning exact match. After applying VLOOKUP
formula it will calculate the color and the results are displayed as below.
As you can see in the above screen-shot that results of VLOOKUP has searched for color
in the second sheet table. It has returned #N/A in case where match is not found. In this
case, Andy's data is not present in the second sheet so it returned #N/A.
Printing Worksheets in Excel 2010
Quick Print
If you want to print a copy of a worksheet with no layout adjustment, use the Quick Print
option. There are two ways in which we can use this option.
 Choose File » Print (which displays the Print pane), and then click the Print button.
 Press Ctrl+P and then click the Print button (or press Enter).
Adjusting Common Page Setup Settings
You can adjust the print settings available in the Page setup dialogue in different ways as
discussed below. Page setup options include Page orientation, Page Size, Page Margins,
etc.
 The Print screen in Backstage View, displayed when you choose File » Print.
 The Page Layout tab of the Ribbon.
Choosing Your Printer
To switch to a different printer, choose File » Print and use the drop-down control in the
Printer section to select any other installed printer.

Specifying What You Want to Print


Sometimes you may want to print only a part of the worksheet rather than the entire active
area. Choose File » Print and use the controls in the Settings section to specify what to
print.
 Active Sheets − Prints the active sheet or sheets that you selected.
 Entire Workbook − Prints the entire workbook, including chart sheets.
 Selection − Prints only the range that you selected before choosing File » Print.
Email Workbooks MS Excel 2010
Email Workbook
MS Excel allows you to email the workbook very easily. To email the workbook to
anyone, follow the below mentioned steps.
 Choose File » Save and Send. It basically saves the document first and then the
emails.

 Click on Send using E-mail if your email system is configured. MS Outlook will
open with the file as attachment in the New Email Window. You can send mail this
workbook to anyone with valid email address.
Translate Worksheet in Excel 2010
Translate Worksheet
You can translate the text written in a different language, such as phrases or paragraphs,
individual words (by using the Mini Translator), or translate your whole file with MS
Excel 2010.
Translation is available in the review tab of the ribbon in MS Excel 2010. You can
quickly translate cell into different language with this option.
Performing Translation Step By Step
 Select the content, which you want to translate to a different language.
 Choose review tab » translation.
 It will open the pane from which you can select the language to which you need to
translate.
 You need to have an internet connection for performing translation. It will translate
using the Microsoft Translator.
 Click on Insert to apply translation changes.
Workbook Security in Excel 2010
Workbook Security
We can apply security to the workbook by the concept of protection available in the
Review Tab of ribbon. MS Excel's protection-related features fall into three categories.
 Worksheet protection − Protecting a worksheet from being modified, or restricting
the modifications to certain users.
 Workbook protection − Protecting a workbook from having sheets inserted or
deleted, and also requiring the use of password to open the workbook.
Protect Worksheet
You may want to protect a worksheet for a variety of reasons. One reason is to prevent
yourself or others from accidentally deleting the formulas or other critical data. A
common scenario is to protect a worksheet, so that the data can be changed, but the
formulas can’t be changed.
To protect a worksheet, choose Review » Changes group » Protect Sheet. Excel
displays the Protect Sheet dialog box. Note that providing a password is optional. If you
enter a password, that password will be required to unprotect the worksheet. You can
select various options in which the sheet should be protected. Suppose we checked
Format Cells option then Excel will not allow to format cells.
When somebody tries to format the cells, he or she will get the error as shown in the
screenshot below.

To unprotect a protected sheet, choose Review » Changes group » Unprotect Sheet. If


the sheet was protected with a password, you’re prompted to enter that password.
Protecting a Workbook
Excel provides three ways to protect a workbook.
 Requires a password to open the workbook.
 Prevents the users from adding sheets, deleting sheets, hiding sheets, and unhiding
sheets.
 Prevents users from changing the size or position of windows.
Requiring a Password to Open a Workbook
Excel lets you save a workbook with a password. After doing so, whoever tries to open
the workbook, must enter the password. To add a password to a workbook, follow these
steps.
 Choose File » Info » Protect Workbook » Encrypt With Password. Excel displays
the Encrypt Document dialog box.
 Type a password and click OK.
 Type the password again and click OK.
 Save the workbook.

To remove a password from a workbook, repeat the same procedure. In Step 2, however,
delete the existing password symbols.
Protecting Workbook’s Structure and Windows
To prevent others (or yourself) from performing certain actions in a workbook, you can
protect the workbook’s structure and windows. When a workbook’s structure and
windows are protected, the user may not Add a sheet, Delete a sheet, Hide a sheet, unhide
a sheet, etc., and may not be allowed to change the size or position of a workbook’s
windows respectively.
To protect a worksheet’s structure and windows, follow the below mentioned steps.
 Choose Review » Changes group » Protect Workbook to display the Protect
Workbook dialog box.
 In the Protect Workbook dialog box, select the Structure check box and Windows
check box.
 (Optional) Enter a password.
 Click OK.
Data Tables in Excel 2010
Data Tables
In Excel, a Data Table is a way to see different results by altering an input cell in your
formula. Data tables are available in Data Tab » What-If analysis dropdown » Data
table in MS Excel.

Data Table with Example


Now, let us see data table concept with an example. Suppose you have the Price and
quantity of many values. Also, you have the discount for that as third variable for
calculating the Net Price. You can keep the Net Price value in the organized table format
with the help of the data table. Your Price runs horizontally to the right while quantity
runs vertically down. We are using a formula to calculate the Net Price as Price multiplied
by Quantity minus total discount (Quantity * Discount for each quantity).

Now, for creation of data table select the range of data table. Choose Data Tab » What-If
analysis dropdown » Data table. It will give you dialogue asking for Input row and
Input Column. Give the Input row as Price cell (In this case cell B3) and Input column as
quantity cell (In this case cell B4). Please see the below screen-shot.

Clicking OK will generate data table as shown in the below screen-shot. It will generate
the table formula. You can change the price horizontally or quantity vertically to see the
change in the Net Price.
Pivot Tables in Excel 2010
Pivot Tables
A pivot table is essentially a dynamic summary report generated from a database. The
database can reside in a worksheet (in the form of a table) or in an external data file. A
pivot table can help transform endless rows and columns of numbers into a meaningful
presentation of the data. Pivot tables are very powerful tool for summarized analysis of
the data.
Pivot tables are available under Insert tab » PivotTable dropdown » PivotTable.
Pivot Table Example
Now, let us see Pivot table with the help of example. Suppose you have huge data of
voters and you want to see the summarized data of voter Information per party, then you
can use the Pivot table for it. Choose Insert tab » Pivot Table to insert pivot table. MS
Excel selects the data of the table. You can select the pivot table location as existing sheet
or new sheet.

This will generate the Pivot table pane as shown below. You have various options
available in the Pivot table pane. You can select fields for the generated pivot table.
 Column labels − A field that has a column orientation in the pivot table. Each item
in the field occupies a column.
 Report Filter − You can set the filter for the report as year, then data gets filtered as
per the year.
 Row labels − A field that has a row orientation in the pivot table. Each item in the
field occupies a row.
 Values area − The cells in a pivot table that contain the summary data. Excel offers
several ways to summarize the data (sum, average, count, and so on).
After giving input fields to the pivot table, it generates the pivot table with the data as
shown below.

Simple Charts in Excel 2010


Charts
A chart is a visual representation of numeric values. Charts (also known as graphs) have
been an integral part of spreadsheets. Charts generated by early spreadsheet products were
quite crude, but thy have improved significantly over the years. Excel provides you with
the tools to create a wide variety of highly customizable charts. Displaying data in a well-
conceived chart can make your numbers more understandable. Because a chart presents a
picture, charts are particularly useful for summarizing a series of numbers and their
interrelationships.
Types of Charts
There are various chart types available in MS Excel as shown in the below screen-shot.

 Column − Column chart shows data changes over a period of time or illustrates
comparisons among items.
 Bar − A bar chart illustrates comparisons among individual items.
 Pie − A pie chart shows the size of items that make up a data series, proportional to
the sum of the items. It always shows only one data series and is useful when you
want to emphasize a significant element in the data.
 Line − A line chart shows trends in data at equal intervals.
 Area − An area chart emphasizes the magnitude of change over time.
 X Y Scatter − An xy (scatter) chart shows the relationships among the numeric
values in several data series, or plots two groups of numbers as one series of xy
coordinates.
 Stock − This chart type is most often used for stock price data, but can also be used
for scientific data (for example, to indicate temperature changes).
 Surface − A surface chart is useful when you want to find the optimum combinations
between two sets of data. As in a topographic map, colors and patterns indicate areas
that are in the same range of values.
 Doughnut − Like a pie chart, a doughnut chart shows the relationship of parts to a
whole; however, it can contain more than one data series.
 Bubble − Data that is arranged in columns on a worksheet, so that x values are listed
in the first column and corresponding y values and bubble size values are listed in
adjacent columns, can be plotted in a bubble chart.
 Radar − A radar chart compares the aggregate values of a number of data series.
Creating Chart
To create charts for the data by below mentioned steps.
 Select the data for which you want to create the chart.
 Choose Insert Tab » Select the chart or click on the Chart group to see various
chart types.
 Select the chart of your choice and click OK to generate the chart.

Editing Chart
You can edit the chart at any time after you have created it.
 You can select the different data for chart input with Right click on chart » Select
data. Selecting new data will generate the chart as per the new data, as shown in the
below screen-shot.
 You can change the X axis of the chart by giving different inputs to X-axis of chart.
 You can change the Y axis of chart by giving different inputs to Y-axis of chart.
Pivot Charts Excel 2010
Pivot Charts
A pivot chart is a graphical representation of a data summary, displayed in a pivot table.
A pivot chart is always based on a pivot table. Although Excel lets you create a pivot
table and a pivot chart at the same time, you can’t create a pivot chart without a pivot
table. All Excel charting features are available in a pivot chart.
Pivot charts are available under Insert tab » PivotTable dropdown » PivotChart.
Pivot Chart Example
Now, let us see Pivot table with the help of an example. Suppose you have huge data of
voters and you want to see the summarized view of the data of voter Information per party
in the form of charts, then you can use the Pivot chart for it. Choose Insert tab » Pivot
Chart to insert the pivot table.

MS Excel selects the data of the table. You can select the pivot chart location as an
existing sheet or a new sheet. Pivot chart depends on automatically created pivot table by
the MS Excel. You can generate the pivot chart in the below screen-shot.
Keyboard Shortcuts in Excel 2010
MS Excel Keyboard Short-cuts
MS Excel offers many keyboard short-cuts. If you are familiar with windows operating
system, you should be aware of most of them. Below is the list of all the major shortcut
keys in Microsoft Excel.
 Ctrl + A − Selects all contents of the worksheet.
 Ctrl + B − Bold highlighted selection.
 Ctrl + I − Italicizes the highlighted selection.
 Ctrl + K − Inserts link.
 Ctrl + U − Underlines the highlighted selection.
 Ctrl + 1 − Changes the format of selected cells.
 Ctrl + 5 − Strikethrough the highlighted selection.
 Ctrl + P − Brings up the print dialog box to begin printing.
 Ctrl + Z − Undo last action.
 Ctrl + F3 − Opens Excel Name Manager.
 Ctrl + F9 − Minimizes the current window.
 Ctrl + F10 − Maximize currently selected window.
 Ctrl + F6 − Switches between open workbooks or windows.
 Ctrl + Page up − Moves between Excel work sheets in the same Excel document.
 Ctrl + Page down − Moves between Excel work sheets in the same Excel document.
 Ctrl + Tab − Moves between Two or more open Excel files.
 Alt + = − Creates a formula to sum all of the above cells
 Ctrl + ' − Inserts the value of the above cell into cell currently selected.
 Ctrl + Shift + ! − Formats the number in comma format.
 Ctrl + Shift + $ − Formats the number in currency format.
 Ctrl + Shift + # − Formats the number in date format.
 Ctrl + Shift + % − Formats the number in percentage format.
 Ctrl + Shift + ^ − Formats the number in scientific format.
 Ctrl + Shift + @ − Formats the number in time format.
 Ctrl + Arrow key − Moves to the next section of text.
 Ctrl + Space − Selects the entire column.
 Shift + Space − Selects the entire row.
 Ctrl + - − Deletes the selected column or row.
 Ctrl + Shift + = − Inserts a new column or row.
 Ctrl + Home − Moves to cell A1.
 Ctrl + ~ − Switches between showing Excel formulas or their values in cells.
 F2 − Edits the selected cell.
 F3 − After a name has been created F3 will paste names.
 F4 − Repeat last action. For example, if you changed the color of text in another cell
pressing F4 will change the text in cell to the same color.
 F5 − Goes to a specific cell. For example, C6.
 F7 − Spell checks the selected text or document.
 F11 − Creates chart from the selected data.
 Ctrl + Shift + ; − Enters the current time.
 Ctrl + ; − Enters the current date.
 Alt + Shift + F1 − Inserts New Worksheet.
 Alt + Enter − While typing text in a cell pressing Alt + Enter will move to the next
line allowing for multiple lines of text in one cell.
 Shift + F3 − Opens the Excel formula window.
 Shift + F5 − Brings up the search box.
Microsoft Access is a Database Management System (DBMS) from Microsoft that
combines the relational Microsoft Jet Database Engine with a graphical user interface and
softwaredevelopment tools. It is a member of the Microsoft Office suite of applications,
included in the professional and higher editions.
 Microsoft Access is just one part of Microsoft’s overall data management product
strategy.
 It stores data in its own format based on the Access Jet Database Engine.
 Like relational databases, Microsoft Access also allows you to link related
information easily. For example, customer and order data. However, Access 2013
also complements other database products because it has several powerful
connectivity features.
 It can also import or link directly to data stored in other applications and databases.
 As its name implies, Access can work directly with data from other sources,
including many popular PC database programs, with many SQL (Structured Query
Language) databases on the desktop, on servers, on minicomputers, or on
mainframes, and with data stored on Internet or intranet web servers.
 Access can also understand and use a wide variety of other data formats, including
many other database file structures.
 You can export data to and import data from word processing files, spreadsheets, or
database files directly.
 Access can work with most popular databases that support the Open Database
Connectivity (ODBC) standard, including SQL Server, Oracle, and DB2.
 Software developers can use Microsoft Access to develop application software.
Microsoft Access stores information which is called a database. To use MS Access, you
will need to follow these four steps −
 Database Creation − Create your Microsoft Access database and specify what kind
of data you will be storing.
 Data Input − After your database is created, the data of every business day can be
entered into the Access database.
 Query − This is a fancy term to basically describe the process of retrieving
information from the database.
 Report (optional) − Information from the database is organized in a nice presentation
that can be printed in an Access Report.
Architecture
 Access calls anything that can have a name an object. Within an Access desktop
database, the main objects are tables, queries, forms, reports, macros, data macros,
and modules.
 If you have worked with other database systems on desktop computers, you might
have seen the term database used to refer to only those files in which you store data.
 But, in Access, a desktop database (.accdb) also includes all the major objects related
to the stored data, including objects you define to automate the use of your data.
Ms Access - RDBMS
Microsoft Access has the look and feel of other Microsoft Office products as far as its
layout and navigational aspects are concerned, but MS Access is a database and, more
specifically, a relational database.
 Before MS Access 2007, the file extension was *.mdb, but in MS Access 2007 the
extension has been changed to *.accdb extension.
 Early versions of Access cannot read accdb extensions but MS Access 2007 and later
versions can read and change earlier versions of Access.
 An Access desktop database (.accdb or .mdb) is a fully functional RDBMS.
 It provides all the data definition, data manipulation, and data control features that
you need to manage large volumes of data.
 You can use an Access desktop database (.accdb or .mdb) either as a standalone
RDBMS on a single workstation or in a shared client/server mode across a network.
 A desktop database can also act as the data source for data displayed on webpages on
your company intranet.
 When you build an application with an Access desktop database, Access is the
RDBMS.
Data Definition
Let us now understand what Data Definition is −
 In document or a spreadsheet, you generally have complete freedom to define the
contents of the document or each cell in the spreadsheet.
 In a document, you can include paragraphs of text, a table, a chart, or multiple
columns of data displayed with multiple fonts.
 In spreadsheet, you can have text data at the top to define a column header for
printing or display, and you might have various numeric formats within the same
column, depending on the function of the row.
 An RDBMS allows you to define the kind of data you have and how the data should
be stored.
 You can also usually define rules that the RDBMS can use to ensure the integrity of
your data.
 For example, a validation rule might ensure that the user can’t accidentally store
alphabetic characters in a field that should contain a number.
Data Manipulation
Working with data in RDBMS is very different from working with data in a word
processing or spreadsheet program.
 In a word processing document, you can include tabular data and perform a limited
set of functions on the data in the document.
 You can also search for text strings in the original document and, with ActiveX
controls, include tables, charts, or pictures from other applications.
 In a spreadsheet, some cells contain functions that determine the result you want, and
in other cells, you enter the data that provides the source information for the
functions.
An RDBMS provides you many ways to work with your data. For example,
 You can search a single table for information or request a complex search across
several related tables.
 You can update a single field or many records with a single command.
 You can write programs that use RDBMS commands to fetch data that you want to
display and allow the user to update the data.
Access uses the powerful SQL database language to process data in your tables. Using
SQL, you can define the set of information that you need to solve a particular problem,
including data from perhaps many tables.
Data Control
Spreadsheets and word processing documents are great for solving single-user problems,
but they are difficult to use when more than one person needs to share the data.
 When you need to share your information with others, RDBMS gives you the
flexibility to allow multiple users to read or update your data.
 An RDBMS that is designed to allow data sharing also provides features to ensure
that no two people can change the same data at the same time.
 The best systems also allow you to group changes (which is also known as
transaction) so that either all the changes or none of the changes appear in your data.
 You might also want to be sure that no one else can view any part of the order until
you have entered all of it.
 Because you can share your Access data with other users, you might need to set some
restrictions on what various users are allowed to see or update.
Ms Access - Objects
MS Access uses “objects" to help the user list and organize information, as well as
prepare specially designed reports. When you create a database, Access offers you Tables,
Queries, Forms, Reports, Macros, and Modules. Databases in Access are composed of
many objects but the following are the major objects −
 Tables
 Queries

 Forms

 Reports

Together, these objects allow you to enter, store, analyze, and compile your data. Here is
a summary of the major objects in an Access database;
Table
Table is an object that is used to define and store data. When you create a new table,
Access asks you to define fields which is also known as column headings.
 Each field must have a unique name, and data type.
 Tables contain fields or columns that store different kinds of data, such as a name or
an address, and records or rows that collect all the information about a particular
instance of the subject, such as all the information about a customer or employee etc.
 You can define a primary key, one or more fields that have a unique value for each
record, and one or more indexes on each table to help retrieve your data more
quickly.
Query
An object that provides a custom view of data from one or more tables. Queries are a way
of searching for and compiling data from one or more tables.
 Running a query is like asking a detailed question of your database.
 When you build a query in Access, you are defining specific search conditions to find
exactly the data you want.
 In Access, you can use the graphical query by example facility or you can write
Structured Query Language (SQL) statements to create your queries.
 You can define queries to Select, Update, Insert, or Delete data.
 You can also define queries that create new tables from data in one or more existing
tables.
Form
Form is an object in a desktop database designed primarily for data input or display or for
control of application execution. You use forms to customize the presentation of data that
your application extracts from queries or tables.
 Forms are used for entering, modifying, and viewing records.
 The reason forms are used so often is that they are an easy way to guide people
toward entering data correctly.
 When you enter information into a form in Access, the data goes exactly where the
database designer wants it to go in one or more related tables.
Report
Report is an object in desktop databases designed for formatting, calculating, printing, and
summarizing selected data.
 You can view a report on your screen before you print it.
 If forms are for input purposes, then reports are for output.
 Anything you plan to print deserves a report, whether it is a list of names and
addresses, a financial summary for a period, or a set of mailing labels.
 Reports are useful because they allow you to present components of your database in
an easy-to-read format.
 You can even customize a report's appearance to make it visually appealing.
 Access offers you the ability to create a report from any table or query.
Other MS Access Objects
Let us now take a look at other MS Access objects.
Macro
This object is a structured definition of one or more actions that you want Access to
perform in response to a defined event. An Access Macro is a script for doing some job.
For example, to create a button which opens a report, you could use a macro which will
fire OpenReport action.
 You can include simple conditions in macros to specify when one or more actions in
the macro should be performed or skipped.
 You can use macros to open and execute queries, to open tables, or to print or view
reports.
 You can also run other macros or Visual Basic procedures from within a macro.
 Data macros can be attached directly to table events such as inserting new records,
editing existing records, or deleting records.
 Data macros in web apps can also be stand-alone objects that can be called from
other data macros or macro objects.
Module
Module is an object in desktop databases containing custom procedures that you code
using Visual Basic. Modules provide a more discrete flow of actions and allow you to trap
errors.
 Everything that can be done in a macro can also be done in a module, but you don't
get the macro interface that prompts you what is needed for each action.
 Modules are far more powerful, and are essential if you plan to write code for a
multi-user environment, because macros cannot include error handling.
 Modules can be standalone objects containing functions that can be called from
anywhere in your application, or they can be directly associated with a form or a
report to respond to events on the associated form or report.
Ms Access - Create Database
In this chapter, we will be covering the basic process of starting Access and creating a
database. This chapter will also explain how to create a desktop database by using a
template and how to build a database from scratch.
To create a database from a template, we first need to open MS Access and you will see
the following screen in which different Access database templates are displayed.

To view the all the possible databases, you can scroll down or you can also use the search
box.
Let us enter project in the search box and press Enter. You will see the database templates
related to project management.

Select the first template. You will see more information related to this template.
After selecting a template related to your requirements, enter a name in the File
name field and you can also specify another location for your file if you want.

Now, press the Create option. Access will download that database template and open a
new blank database as shown in the following screenshot.
Now, click the Navigation pane on the left side and you will see all the other objects that
come with this database.

Click the Projects Navigation and select the Object Type in the menu.

You will now see all the objects types — tables, queries, etc.
Create Blank Database
Sometimes database requirements can be so specific that using and modifying the existing
templates requires more work than just creating a database from scratch. In such case, we
make use of blank database.
Step 1 − Let us now start by opening MS Access.

Step 2 − Select Blank desktop database. Enter the name and click the Create button.

Step 3 − Access will create a new blank database and will open up the table which is also
completely blank.
Ms Access - Data Types
Every field in a table has properties and these properties define the field's characteristics
and behavior. The most important property for a field is its data type. A field's data type
determines what kind of data it can store. MS Access supports different types of data,
each with a specific purpose.
 The data type determines the kind of the values that users can store in any given field.
 Each field can store data consisting of only a single data type.

Here are some of the most common data types you will find used in a typical Microsoft
Access database.
Type of Data Description Size

Text or Up to 255 characters.


combinations
of text and
numbers,
including
Short Text numbers that
do not
require
calculating
(e.g. phone
numbers).

Long Text Lengthy text Up to 63, 999 characters.


or
combinations
of text and
numbers.

Numeric 1, 2, 4, or 8 bytes (16 bytes if set to


data used in Replication ID).
Number
mathematical
calculations.

Date and 8 bytes


time values
Date/Time for the years
100 through
9999.

Currency 8 bytes
values and
numeric data
used in
mathematical
Currency calculations
involving
data with one
to four
decimal
places.

AutoNumber A unique 4 bytes (16 bytes if set to Replication


sequential ID).
(incremented
by 1) number
or random
number
assigned by
Microsoft
Access
whenever a
new record is
added to a
table.

Yes and No 1 bit.


values and
fields that
contain only
Yes/No one of two
values
(Yes/No,
True/False,
or On/Off).

 If you use previous versions of Access, you will notice a difference for two of those
data types.
 In Access 2013, we now have two data types — short text and long text. In previous
versions of Access these data types were called text and memo.
 The text field is referred to as short text and your memo field is now called long text.
Here are some of the other more specialized data types, you can choose from in Access.
Data Types Description Size

Files, such as digital Up to about 2 GB.


photos. Multiple files can
Attachment be attached per record. This
data type is not available in
earlier versions of Access.

OLE objects can store Up to about 2 GB.


pictures, audio, video, or
OLE objects
other BLOBs (Binary
Large Objects)

Text or combinations of Up to 8,192 (each part of a


text and numbers stored as Hyperlink data type can
Hyperlink
text and used as a hyperlink contain up to 2048 characters).
address.

Lookup The Lookup Wizard entry Dependent on the data type of


Wizard in the Data Type column in the lookup field.
the Design view is not
actually a data type. When
you choose this entry, a
wizard starts to help you
define either a simple or
complex lookup field.
A simple lookup field uses
the contents of another
table or a value list to
validate the contents of a
single value per row. A
complex lookup field
allows you to store multiple
values of the same data
type in each row.

You can create an You can create an expression


expression that uses data that uses data from one or
from one or more fields. more fields. You can designate
Calculated
You can designate different different result data types from
result data types from the the expression.
expression.

These are all the different data types that you can choose from when creating fields in a
Microsoft Access table.
Ms Access - Create Tables
When you create a database, you store your data in tables. Because other database objects
depend so heavily on tables, you should always start your design of a database by creating
all of its tables and then creating any other object. Before you create tables, carefully
consider your requirements and determine all the tables that you need.
Let us try and create the first table that will store the basic contact information concerning
the employees as shown in the following table −
Field Name Data Type

EmployeelD AutoNumber

FirstName Short Text

LastName Short Text

Address1 Short Text


Address2 Short Text

City Short Text

State Short Text

Zip Short Text

Phone Short Text

Phone Type Short Text

Let us now have short text as the data type for all these fields and open a blank database
in Access.

This is where we left things off. We created the database and then Access automatically
opened up this table-one-datasheet view for a table.
Let us now go to the Field tab and you will see that it is also automatically created. The
ID which is an AutoNumber field acts as our unique identifier and is the primary key for
this table.
The ID field has already been created and we now want to rename it to suit our
conditions. This is an Employee table and this will be the unique identifier for our
employees.

Click on the Name & Caption option in the Ribbon and you will see the following dialog
box.

Change the name of this field to EmployeeID to make it more specific to this table. Enter
the other optional information if you want and click Ok.
We now have our employee ID field with the caption Employee ID. This is automatically
set to auto number so we don't really need to change the data type.
Let us now add some more fields by clicking on click to add.

Choose Short Text as the field. When you choose short text, Access will then highlight
that field name automatically and all you have to do is type the field name.
Type FirstName as the field name. Similarly, add all the required fields as shown in the
following screenshot.

Once all the fields are added, click the Save icon.
You will now see the Save As dialog box, where you can enter a table name for the table.

Enter the name of your table in the Table Name field. Here the tbl prefix stands for table.
Let us click Ok and you will see your table in the navigation pane.
Table Design View
As we have already created one table using Datasheet View. We will now create another
table using the Table Design View. We will be creating the following fields in this table.
These tables will store some of the information for various book projects.
Field Name Data Type

Project ID AutoNumber

ProjectName Short Text

ManagingEditor Short Text

Author Short Text

PStatus Short Text

Contracts Attachment

ProjectStart Date/Time

ProjectEnd Date/Time

Budget Currency
ProjectNotes Long Text

Let us now go to the Create tab.

In the tables group, click on Table and you can see this looks completely different from
the Datasheet View. In this view, you can see the field name and data type side by side.

We now need to make ProjectID a primary key for this table, so let us
select ProjectID and click on Primary Key option in the ribbon.
You can now see a little key icon that will show up next to that field. This shows that the
field is part of the table’s primary key.
Let us save this table and give this table a name.

Click Ok and you can now see what this table looks like in the Datasheet View.
Let us click the datasheet view button on the top left corner of the ribbon.

If you ever want to make changes to this table or any specific field, you don't always have
to go back to the Design View to change it. You can also change it from the Datasheet
View. Let us update the PStatus field as shown in the following screenshot.

Click Ok and you will see the changes.


©SAYANTAN BERA
Ms Access - Adding Data
An Access database is not a file in the same sense as a Microsoft Office Word document
or a Microsoft Office PowerPoint are. Instead, an Access database is a collection of
objects like tables, forms, reports, queries etc. that must work together for a database to
function properly. We have now created two tables with all of the fields and field
properties necessary in our database. To view, change, insert, or delete data in a table
within Access, you can use the table’s Datasheet View.
 A datasheet is a simple way to look at your data in rows and columns without any
special formatting.
 Whenever you create a new web table, Access automatically creates two views that
you can start using immediately for data entry.
 A table open in Datasheet View resembles an Excel worksheet, and you can type or
paste data into one or more fields.
 You do not need to explicitly save your data. Access commits your changes to the
table when you move the cursor to a new field in the same row, or when you move
the cursor to another row.
 By default, the fields in an Access database are set to accept a specific type of data,
such as text or numbers. You must enter the type of data that the field is set to
accept. If you don't, Access displays an error message −
Let us add some data into your tables by opening the Access database we have created.
Select the Views → Datasheet View option in the ribbon and add some data as shown in
the following screenshot.

Similarly, add some data in the second table as well as shown in the following screenshot.

You can now see that inserting a new data and updating the existing data is very simple in
Datasheet View as working in spreadsheet. But if you want to delete any data you need to
select the entire row first as shown in the following screenshot.
Now press the delete button. This will display the confirmation message.

Click Yes and you will see that the selected record is deleted now.

Ms Access - Query Data


A query is a request for data results, and for action on data. You can use a query to answer
a simple question, to perform calculations, to combine data from different tables, or even
to add, change, or delete table data.
 As tables grow in size they can have hundreds of thousands of records, which makes
it impossible for the user to pick out specific records from that table.
 With a query you can apply a filter to the table's data, so that you only get the
information that you want.
 Queries that you use to retrieve data from a table or to make calculations are called
select queries.
 Queries that add, change, or delete data are called action queries.
 You can also use a query to supply data for a form or report.
 In a well-designed database, the data that you want to present by using a form or
report is often located in several different tables.
 The tricky part of queries is that you must understand how to construct one before
you can actually use them.
Create Select Query
If you want to review data from only certain fields in a table, or review data from multiple
tables simultaneously or maybe just see the databased on certain criteria, you can use
the Select query. Let us now look into a simple example in which we will create a simple
query which will retrieve information from tblEmployees table. Open the database and
click on the Create tab.

Click Query Design.


In the Tables tab, on the Show Table dialog, double-click the tblEmployees table and
then Close the dialog box.

In the tblEmployees table, double-click all those fields which you want to see as result of
the query. Add these fields to the query design grid as shown in the following screenshot.
Now click Run on the Design tab, then click Run.

The query runs, and displays only data in those field which is specified in the query.
Ms Access - Query Criteria
Query criteria helps you to retrieve specific items from an Access database. If an item
matches with all the criteria you enter, it appears in the query results. When you want to
limit the results of a query based on the values in a field, you use query criteria.
 A query criterion is an expression that Access compares to query field values to
determine whether to include the record that contains each value.
 Some criteria are simple, and use basic operators and constants. Others are complex,
and use functions, special operators, and include field references.
 To add some criteria to a query, you must open the query in the Design View.
 You then identify the fields for which you want to specify criteria.
Example
Let’s look at a simple example in which we will use criteria in a query. First open your
Access database and then go to the Create tab and click on Query Design.
In the Tables tab on Show Table dialog, double-click on the tblEmployees table and then
close the dialog box.

Let us now add some field to the query grid such as EmployeeID, FirstName, LastName,
JobTitle and Email as shown in the following screenshot.
Let us now run your query and you will see only these fields as query result.

If you want to see only those whose JobTitle are Marketing Coordinator then you will
need to add the criteria for that. Let’s go to the Query Design again and in Criteria row of
JobTitle enter Marketing Coordinator.
Let us now run your query again and you will see that only Job title of Marketing
Coordinators are retrieved.

If you want to add criteria for multiple fields, just add the criteria in multiple fields. Let us
say we want to retrieve data only for “Marketing Coordinator” and “Accounting
Assistant”; we can specify the OR row operator as shown in the following screenshot −

Let us now run your query again and you will see the following results.
If you need to use the functionality of the AND operator, then you have to specify the
other condition in the Criteria row. Let us say we want to retrieve all Accounting
Assistants but only those Marketing Coordinator titles with “Pollard” as last name.

Let us now run your query again and you will see the following results.
Ms Access - Action Queries
In MS Access and other DBMS systems, queries can do a lot more than just displaying
data, but they can actually perform various actions on the data in your database.
 Action queries are queries that can add, change, or delete multiple records at one
time.
 The added benefit is that you can preview the query results in Access before you run
it.
 Microsoft Access provides 4 different types of Action Queries −
o Append

o Update

o Delete

o Make-table

 An action query cannot be undone. You should consider making a backup of any
tables that you will update by using an update query.
Create an Append Query
You can use an Append Query to retrieve data from one or more tables and add that data
to another table. Let us create a new table in which we will add data from
the tblEmployees table. This will be temporary table for demo purpose.
Let us call it TempEmployees and this contains the fields as shown in the following
screenshot.
In the Tables tab, on the Show Table dialog box, double-click on the tblEmployees table
and then close the dialog box. Double-click on the field you want to be displayed.

Let us run your query to display the data first.


Now let us go back to Query design and select the Append button.

In the Query Type, select the Append option button. This will display the following
dialog box.

Select the table name from the drop-down list and click Ok.
In the Query grid, you can see that in the Append To row all the field are selected by
default except Address1. This because that Address1 field is not available in
the TempEmployee table. So, we need to select the field from the drop-down list.

Let us look into the Address field.

Let us now run your query and you will see the following confirmation message.
Click Yes to confirm your action.

When you open the TempEmployee table, you will see all the data is added from the
tblEmployees to the TempEmployee table.
Ms Access - Create Queries
Let us understand how to create queries in this chapter.
Create an Update Query
You can use an Update Query to change the data in your tables, and you can use an
update query to enter criteria to specify which rows should be updated. An update query
provides you an opportunity to review the updated data before you perform the update.
Let us go to the Create tab again and click Query Design.
In the Tables tab, on the Show Table dialog box, double-click on the tblEmployees table
and then close the dialog box.

On the Design tab, in the Query Type group, click Update and double-click on the field in
which you want to update the value. Let us say we want to update the FirstName of “Rex”
to “Max”.
In the Update row of the Design grid, enter the updated value and in Criteria row add the
original value which you want to be updated and run the query. This will display the
confirmation message.

Click Yes and go to Datasheet View and you will see the first record — FirstName is
updated to “Max” now.

Create a Delete Query


You can use a delete query to delete data from your tables, and you can use a delete query
to enter criteria to specify which rows should be deleted. A Delete Query provides you an
opportunity to review the rows that will be deleted before you perform the deletion. Let us
go to the Create tab again and click Query Design.
In the Tables tab on the Show Table dialog box, double-click the tblEmployees table and
then close the dialog box.

On the Design tab, in the Query Type group, click Delete and double-click on
the EmployeeID.
In the Criteria row of the Design Grid, type 11. Here we want to delete an employee
whose EmployeeID is 11.

Let us now run the query. This query will display the confirmation message.

Click Yes and go to your Datasheet View and you will see that the specified employee
record is deleted now.

Create a Make Table Query


You can use a make-table query to create a new table from data that is stored in other
tables. Let us go to the Create tab again and click Query Design.
In the Tables tab, on the Show Table dialog box, double-click the tblEmployees table and
then close the dialog box.

Select all those fields which you want to copy to another table.
In the Query Type, select the Make Table option button.

You will see the following dialog box. Enter the name of the new table you want to create
and click OK.

Now run your query.


You will now see the following message.

Click Yes and you will see a new table created in the navigation pane.

Ms Access - Parameter Queries


The best part about queries is that you can save and run the same query again and again,
but when you run the same query again and again by only changing the criteria then you
might consider the query to accept parameters.
 If you frequently want to run variations of a particular query, consider using a
parameter query
 Parameter query retrieves information in an interactive manner prompting the end
user to supply criteria before the query is run.
 You can also specify what type of data a parameter should accept.
 You can set the data type for any parameter, but it is especially important to set the
data type for numeric, currency, or date/time data.
 When you specify the data type that a parameter should accept, users see a more
helpful error message if they enter the wrong type of data, such as entering text when
currency is expected.
 If a parameter is set to accept text data, any input is interpreted as text, and no error
message is displayed.
Example
Let us now take a look at a simple example by creating a parameter query. Let us open
your database and select Query Design in the Create table tab.

Double-click on the tblProjects and close the Show dialog box.


Select the field you want to see as a query result as shown in the following screenshot.

In the query design grid, in the Criteria row of the ProjectStart column, type [Enter a
project start data]. The string [Enter a project start data] is your parameter prompt.
The square brackets indicate that you want the query to ask for input, and the text
is Enter a project start data is the parameter prompt displays.
Let us now run your query and you will see the following prompt.

Let us now enter the following date.

Click OK to confirm.

As a result, you will see the details of the project which started on 2/1/2007. Let us go to
the Design View and run the query again.
Enter the date as in the above screenshot and click Ok. You will now see the details of the
project which started on 5/1/2008.
Ms Access - Alternate Criteria
Queries come in with many advantages. You can save and run the same query again and
again, and a lot of times you want to add alternate criteria.
You can add alternate criteria in the following two ways −
 You can use the OR operator to combine two sets of criteria.
 You can also use the query design grid, but instead of specifying criteria on the same
line, you will need to separate it in multiple row.
Example
Let us look at a simple example of alternate criteria. Open database and in the Create tab
select Query Design.

Double-click on tblEmployee and close the Show Table dialog box.


Double-click on all the field you want to see as query result.

You can now see that alternate criterion is specified in different rows of
the LastName field. When you run this query, you will see the employees whose last
name is either Pollard or Manning. Let us now run this query.

As you can see that only two employees have been retrieved, because of the alternate
criteria.
If you want to add alternate criteria in multiple fields then you will have to use different
rows for all the fields. Let us now add another alternate criterion where we can retrieve
information for employees whose last name is either Pollard or Manning or the job title
is Accounting Assistant.
Let us now run this query.

You will now see the following result.

Ms Access - Relating Data


In this chapter, we will understand the basics of relating data. Before talking about and
creating relationships between different data, let us review why we need it. It all goes
back to normalization.
Normalization
Database normalization, or simply normalization, is the process of organizing columns
(attributes) and tables (relations) of a relational database to minimize data redundancy. It
is the process of splitting data across multiple tables to improve overall performance,
integrity and longevity.
 Normalization is the process of organizing data in a database.
 This includes creating tables and establishing relationships between those tables
according to rules designed both to protect the data and to make the database more
flexible by eliminating redundancy and inconsistent dependency.
Let us now look into the following table which contains data, but the problem is that this
data is quite redundant which increases the chances of typo and inconsistent phrasing
during data entry.
CustI Name Address Cookie Quantity Price Total
D

1 Ethel Smith 12 Main Chocolat 5 $2.00 $10.00


St, e Chip
Arlington,
VA
22201 S

2 Tom Wilber 1234 Oak Choc 3 $2.00 $6.00


Dr., Chip
Pekin, IL
61555

3 Ethil 12 Main Chocolat 5 $2.00 $10.00


Smithy St., e Chip
Arlington,
VA
22201

To solve this problem, we need to restructure our data and break it down into multiple
tables to eliminate some of those redundancy as shown in the following three tables.

Here, we have one table for Customers, the 2 nd one is for Orders and the 3rd one is for
Cookies.
The problem here is that just by splitting the data in multiple tables will not help to tell
how data from one table relates to data in another table. To connect data in multiple
tables, we have to add foreign keys to the Orders table.
Defining Relationships
A relationship works by matching data in key columns usually columns with the same
name in both the tables. In most cases, the relationship matches the primary key from one
table, which provides a unique identifier for each row, with an entry in the foreign key in
the other table. There are three types of relationships between tables. The type of
relationship that is created depends on how the related columns are defined.
Let us now look into the three types of relationships −
One-to-Many Relationships
A one-to-many relationship is the most common type of relationship. In this type of
relationship, a row in table A can have many matching rows in table B, but a row in table
B can have only one matching row in table A.
For example, the Customers and Orders tables have a one-to-many relationship: each
customer can place many orders, but each order comes from only one customer.
Many-to-Many Relationships
In a many-to-many relationship, a row in table A can have many matching rows in table
B, and vice versa.
You create such a relationship by defining a third table, called a junction table, whose
primary key consists of the foreign keys from both table A and table B.
For example, the Customers table and the Cookies table have a many-to-many
relationship that is defined by a one-to-many relationship from each of these tables to the
Orders table.
One-to-One Relationships
In a one-to-one relationship, a row in table A can have no more than one matching row in
table B, and vice versa. A one-to-one relationship is created if both the related columns
are primary keys or have unique constraints.
This type of relationship is not common because most information related in this way
would be all in one table. You might use a one-to-one relationship to −
 Divide a table into many columns.
 Isolate part of a table for security reasons.
 Store data that is short-lived and could be easily deleted by simply deleting the table.
 Store information that applies only to a subset of the main table.
Ms Access - Create Relationships
In this chapter, we will understand the need to create relationships between related tables.
One of the goals of good database design is to remove data redundancy.
 To achieve that goal, you divide your data into many subject-based tables so that
each fact is represented only once.
 To do this, all the common fields which are related to each other are placed in one
table.
 To do this step correctly, you must first understand the relationship between your
tables, and then specify these relationships in your Access database.
Why Create Table Relationships?
MS Access uses table relationships to join tables when you need to use them in a database
object. There are several reasons why you should create table relationships before you
create other database objects, such as forms, queries, macros, and reports.
 To work with records from more than one table, you often must create a query that
joins the tables.
 The query works by matching the values in the primary key field of the first table
with a foreign key field in the second table.
 When you design a form or report, MS Access uses the information it gathers from
the table relationships you have already defined to present you with informed
choices and to prepopulate property settings with appropriate default values.
 When you design a database, you divide your information into tables, each of which
has a primary key and then add foreign keys to related tables that reference those
primary keys.
 These foreign key-primary key pairings form the basis for table relationships and
multi-table queries.
Let us now add another table into your database and name it tblHRData using Table
Design as shown in the following screenshot.
Click on the Save icon as in the above screenshot.

Enter tblHRData as table name and click Ok.

tblHRData is now created with data in it.


Ms Access - One-To-One Relationship
Let us now understand One-to-One Relationship in MS Access. This relationship is used
to relate one record from one table to one and only one record in another table.
Let us now go to the Database Tools tab.

Click on the Relationships option.

Select tblEmployees and tblHRData and then click on the Add button to add them to our
view and then close the Show Table dialog box.
To create a relationship between these two tables, use the mouse, and click and hold
the EmployeeID field from tblEmployees and drag and drop that field on the field we
want to relate by hovering the mouse right over EmployeeID from tblHRData. When
you release your mouse button, Access will then open the following window −

The above window relates EmployeeID of tblEmployees to EmployeeID of tblHRData.


Let us now click on the Create button and now these two tables are related.
The relationship is now saved automatically and there's no real need to click on the Save
button. Now that we have the most basic of relationships created, let us now go to the
table side to see what has happened with this relationship.
Let us open the tblEmployees table.

Here, on the left-hand side of each and every record, you will see a little plus sign by
default. When you create a relationship, Access will automatically add a sub-datasheet to
that table.
Let us click on the plus sign and you will see the information that is related to this record
is on the tblHRData table.

Click on the Save icon and open tblHRData and you will see that the data we have
entered is already here.
Ms Access - One-To-Many Relationship
The vast majority of your relationships will more than likely be this one to many
relationships where one record from a table has the potential to be related to many records
in another table.
The process to create one-to-many relationship is exactly the same as for creating a one-
to-one relationship.

Let us first clear the layout by clicking on the Clear Layout option on the Design tab.
We will first add another table tblTasks as shown in the following screenshot.

Click on the Save icon and enter tblTasks as the table name and go to
the Relationship view.

Click on the Show Table option.


Add tblProjects and tblTasks and close the Show Table dialog box.

We can run through the same process once again to relate these tables. Click and hold
ProjectID from tblProjects and drag that all the way over to the ProjectID from tblTasks.
Further, a relationships window pops up when you release the mouse.
Click the Create button. We now have a very simple relationship created.

Ms Access - Many-To-Many Relationship


In this chapter, let us understand Many-to-Many Relationship. To represent a many-
tomany relationship, you must create a third table, often called a junction table, that
breaks down the many-to-many relationship into two one-to-many relationships. To do so,
we also need to add a junction table. Let us first add another table tblAuthers.
Let us now create a many-to-many relationship. We have more than one author working
on more than one project and vice versa. As you know, we have an Author field in
tblProjects so, we have created a table for it. We do not need this field any more.

Select the Author field and press the delete button and you will see the following
message.

Click Yes. We will now have to create a junction table. This junction table have two
foreign keys in it as shown in the following screenshot.
These foreign key fields will be the primary keys from the two tables that were linked
together — tblAuthers and tblProjects.
To create a composite key in Access, select both these fields and from the table tools
design tab, you can click directly on that primary key and that will mark not one but both
of these fields.

The combination of these two fields is the tables’ unique identifier. Let us now save this
table as tblAuthorJunction.
The last step in bringing the many-to-many relationships together is to go back to
that relationships view and create those relationships by clicking on Show Table.
Select the above three highlighted tables and click on the Add button and then close this
dialog box.
Click and drag the AuthorID field from tblAuthors and place it on top of
the tblAuthorJunction table AuthorID.

The relationship you’re creating is the one that Access will consider as a one-to-many
relationship. We will also enforce referential integrity. Let us now turn on Cascade
Update and click on the Create button as in the above screenshot.
Let us now hold the ProjectID, drag and drop it right on top
of ProjectID from tblAuthorJunction.

We will Enforce Referential Integrity and Cascade Update Related Fields.

The following are the many-to-many relationships.


Ms Access - Wildcards
Wildcards are special characters that can stand in for unknown characters in a text value
and are handy for locating multiple items with similar, but not identical data. Wildcards
can also help with getting databased on a specified pattern match.
Access supports two sets of wildcard characters because it supports two standards for
Structured Query Language.
 ANSI-89
 ANSI-92

As a rule, you use the ANSI-89 wildcards when you run queries and find-and-
replace operations against Access databases such as *.mdb and *.accdb files.
You use the ANSI-92 wildcards when you run queries against Access projects — Access
files connected to Microsoft SQL Server databases. Access projects use the ANSI-92
standard because SQL Server uses that standard.
ANSI-89 Wildcard Characters
The following table lists out characters supported by ANSI-89 −
Characte Description Example
r

* Matches any number of characters. wh* finds what, white,


You can use the asterisk (*) and why, but not
anywhere in a character string. awhile or watch.

? Matches any single alphabetic B?ll finds ball, bell,


character. and bill.

[] Matches any single character B[ae]ll finds ball and


within the brackets. bell, but not bill.

! Matches any character not in the b[!ae]ll finds bill and


brackets. bull, but not ball or
bell.

- Matches any one of a range of b[a-c]d finds bad, bbd,


characters. You must specify the and bcd.
range in ascending order (A to Z,
not Z to A).

# Matches any single numeric 1#3S finds 103, 113,


character. and 123.

ANSI-92 wildcard characters


The following table lists out characters supported by ANSI-92 −
Characte Description Example
r

% Matches any number of wh% finds what,


characters. It can be used as the white, and why, but not
first or last character in the awhile or watch.
character string.

_ Matches any single alphabetic B_ll finds ball, bell,


character. and bill.

[] Matches any single character B[ae]ll finds ball and


within the brackets. bell, but not bill.

^ Matches any character not in the b[^ae]ll finds bill and


brackets. bull, but not ball or
bell.
- Matches any one of a range of b[a-c]d finds bad, bbd,
characters. You must specify the and bcd.
range in ascending order (A to Z,
not Z to A).

Example
Let us now look at a simple example of using these wildcard characters by opening the
query design.
Add the highlighted tables and close the Show Table dialog box.

Add the fields in the query grid which you want to see as a query result.
Run your query.

Let us again go to the query design and add prompt for project name.
Now run your query and let us assume that you don’t know the exact project name, but
you know that the project name contains the words “potion”. Click Ok.

The above step does not generate any result. That is because Access is looking for an
exact match in the project name field. It is looking for that project which has the
word potion in its name.
If you want it so that the users can enter wildcards to replace unknown characters, then
you need to adjust the criteria and include the operator like.

When you run the query, users can use wildcards to replace any number of characters.
Let us assume that you know that the word potion appears somewhere in the title but you
are not exactly sure where.
You can add an * to replace any number of characters before the word potion and then
add another * after the. Click Ok.

It is always good for the users to know the wildcards they can enter. But there are users
who may not know the wildcards they can and cannot enter. In that case, you can enter the
wildcards yourself.
In this situation, in-between the Like operator and our parameter prompt, we can add
those wildcards and now there's a very specific way we have to write this. After the
word like in quotation marks, enter the wildcard that we are using. In this case, we have
used “*” to replace any number of characters. We will now add this to the parameter. To
do so, we need ampersand (&) symbol and a space. We will now repeat this step and add
another ampersand (&) because we're joining that wildcard to whatever criteria is entered
in for that project name by the user and then “*” in quotes.
Let us now run our query again. Enter the word potion in the prompt without any
wildcards.

The query will now track those wildcards on either side of whatever is entered here. We
need to simply type potion and press enter.

We now get the results we were looking for and the results will be the same regardless of
what the users enter.
Let us say we want to find every project with the word “the” in the title. Then, you need
to just type the word and Enter or click Ok.
With this query, it becomes easier to search for projects with the word “the” in their
names. The 2nd level of results may also include the project names with the word “mother”
where “the” is part of the word.
Ms Access - Calculated Expression
In MS Access, an expression is like a formula in Excel. This consists of a number of
elements that can be used alone or in a combination to produce a result. Expressions can
include operators’, constants, functions and identifiers.
 Expressions can be used to perform a variety of tasks from retrieving the value of a
control or supplying criteria to a query to creating calculated controls and fields or
defining a group level for report.
 In this chapter, we will be focusing on creating a very specific kind of expression
called a calculated expression. We will create several calculated fields that will
calculate and display data that is not stored anywhere within the database itself but
calculated from separate fields that are stored.
We now have a new Access database that contains more data to calculate.
Example
Let us try an example to understand this. We will be retrieving some information from a
variety of tables — tblCustomers, tblOrders, tblOrdersDetails and tblBooks and
reviewing a variety of fields.
Let us now run the query and you will see the following results.

We want a very simple calculation for a subtotal which will take the quantity of the books
ordered and multiply that by the retail price of the book. It is a good idea to begin every
expression or any expression with a name to call that field. Let us call this one subtotal.

The full expression (Subtotal: [tblOrdersDetails]![QTY]*[tblBooks]!


[RetailPrice]) includes the table name, first tblOrdersDetails inside square brackets
because that is where our quantity field lives. Now an exclamation is telling Access to
look inside that table for a field QTY and multiply that by the retail price field in
tblBooks.
Let us try to run your query and you will see at end the subtotal field.

Let us say we want to calculate our sales tax. In the query grid we will do in the exact
same way we did before and this time we will call the field simply Tax and Let us
multiply Subtotal by nine percent tax rate.

Let us run your query again and you will see the new Tax field in the end.
Ms Access - Indexing
An index is a data structure, a special data structure designed to improve the speed of data
retrieval. If you often search a table or sort its records by a particular field, you can speed
up these operations by creating an index for the field. Microsoft Access uses indexes in a
table as you use an index in a book to find data.
 In some instances, such as for a primary key, Access automatically creates an index
for you.
 At other times, you might want to create an index yourself.

 An index stores the location of records based on the field or fields that you choose to

index.
 After Access obtains the location from the index, it can then retrieve the data by

moving directly to the correct location.


 In this way, using an index can be considerably faster than scanning through all of the

records to find the data.


 Indexes can speed up searches in queries, but they can also slow down performance

when adding or updating records.


Let us now look into what indexes Microsoft Access creates by default and how to create
them ourselves and learn how to delete any unnecessary indexes. Open
the tblEmployees table in Access database which we have created.
 We haven't really played with indexes in this database but that doesn't mean we don't
have any.
 In fact, any field that is set as a primary key in Access is automatically indexed.

 Access creates additional secondary indexes depending on the names of your fields.

Let us now go to the File menu and select Options.


You will see the Access Options window.

Go to the Object Designers and you will see a section labeled AutoIndex on
Import/Create and in the textbox you will see ID;key;code;num. By default, access
automatically adds a secondary index to fields that start or end with these names and that
goes for fields you have imported as well as ones you have manually created.
If you want to make any field indexed you can go to the Field tab.
Select any field that you want indexed and check the Indexed checkbox in Field
Validation section. You also have alternate options for creating or removing an index.
You can go back to the Design View.

You can adjust indexes by selecting any field. You can also see how they are indexed in
the field properties area below. Any field that has No selected next to indexed, means
there is no index for that given field. You can change that by clicking on the drop-down
menu and choosing the other two options — Yes (Duplicate OK) and Yes (No
duplicates).
The last option Yes (No Duplicates) means that Access will automatically prohibit
duplicate values in that field. Let us now create an index for our last name field.

Let us select LastName to index and say Yes (Duplicates OK). As we save, Access will
create that index. Another area where you can view and adjust your indexes for a table is
the tables design area in the Show/Hide group.
If you click on this Indexes button that will bring up a special view displaying all the
indexes created for this table.

We now have two indexes for tblEmployees —one that was created automatically based
on the primary key field and one that we just created for the LastName field. These are
the different ways to deal with indexes in Microsoft Access tables.
Ms Access - Grouping Data
In this chapter, we will be covering how to calculate on a group of records in Access. We
have created a field that calculates row by row or record by record to create a line total or
subtotal field, but what if we wanted to calculate down by a group of records rather than
by individual ones. We can do this by creating what's known as an Aggregate Query.
Aggregate Query
An aggregate query also known as a totals or summary query is a sum, mass or group
particulars. It can be a total or gross amount or a group or subset of records. Aggregate
queries can perform a number of operations. Here's a simple table listing some of the
ways to total on a group of records.
S.No Aggregate Functions & Description
1. Sum
Adds the field values

2. Avg
Average of the field values

3. Min
Lowest (minimum) field value

4. Max
Highest (maximum) field value

5. Count
Count of the values (records)

6. StDev
Standard deviation of the field values including date/time fields

7. Var
Variance of the field values including date/time

Let us open your database and go to the Query Design and include the following tables −
Close this dialog box and the following two fields will be displayed as shown in the query
grid in the following screenshot.

This is a simple query and we are displaying only two fields — book
title and quantity and when we run it we're seeing every single individual order in our
database.
Let us now run this query and you will see the following results.
This is why book titles are repeating. Separate orders have been placed for each of these
books here and they were ordered in different quantities. Let us assume we want to see a
summary of only that book title that has been listed only once. And then the sum of the
quantity listed beside it.
Let us now go to the Design View and in the Design tab, you will see a Sigma symbol.
This is your totals button.

Click the sigma symbol which will open another row underneath your field in the table
row and from here, you can specify how you are grouping this query.
We will now group by book title and also sum our quantity field.
If we click on group by area and further click on the drop-down menu, all the options
will be listed down. In this case, we will choose the option Sum and then run your query.

You can now see each individual book and also all the individual orders displayed beside
the book name.

Concatenation in Access
We learned the process of normalization, storing information in separate fields.
Sometimes you want to see or view data together like combining the first name and last
name fields as a single field. You can display that information together by creating a
calculated field that concatenates one or more strings. You can also add other characters
like a comma or period that you may want.
 To concatenate in Access, there are two different operators you can use
the ampersand (&) and the plus (+) sign.
 The ampersand will combine two strings into one whereas the plus sign will combine
two strings and propagate NULL values, for example, if one value is NULL the
entire expression evaluates to null.
Example
Let us take a simple example to understand the process of creating a new query using
query design. This is going to be a very simple query that is pulling information from our
customers’ table.
Let us now add tblCustomers table close that show table dialog box. We will try some
concatenation with some simple named fields.

Let us now add the first name and last name fields and run the query.
As you can see, the first name and the last name are separated into two different fields.
We need to display this information together.

Go back to the Design View and in the third field create a new field called full name.
Now, add the full name and type the expression that concatenates those two fields
together.

Let us run the query and you will see a new calculated field.
It can concatenate the information from these two fields together, but it doesn't exactly
appear the way we want it to. It runs all of that text together because it's performing the
way we have asked it to. We will now have to ask Access to add space in between the
information from these two fields.
Let us now go back to the Design View and add another section to this expression.

Add a Space inside quotes and another ampersand. This makes Access take the
information from that first name field; add it with a space and then add the information
from the last name field at the very end. Now, run the query again and you will see the
following results.
Ms Access - Joins
A database is a collection of tables of data that allow logical relationships to each other.
You use relationships to connect tables by fields that they have in common. A table can
be part of any number of relationships, but each relationship always has exactly two
tables. In a query, a relationship is represented by a Join.
What is Join
A join specifies how to combine records from two or more tables in a database.
Conceptually, a join is very similar to a table relationship. In fact, joins are to queries
what relationships are to tables.
The following are the two basic types of joins that we will be discussing in this chapter −
 The inner join
 The outer join

Both of which can easily be created from a queries design view.


Inner Join
Let us now understand Inner Join −
 The most common type of join is an inner join which is also the default join type in
Microsoft Access.
 Inner Join will display only the rows or records where the joined fields from both
tables are equal.
 This join type looks at those common fields and the data contained within. It only
displays the matches.
Outer Join
Let us now understand what an Outer Join is −
 An outer join displays all rows from one table and only those rows or records from
the other table where the joined fields are equal.
 In other words, an outer join shows all rows from one table and only the
corresponding rows from the other table.

There are other Join types too −


Left Outer Join & Right Outer Join
Let us now understand Left Outer Join and Right Outer Join −
 You can choose the table that will display all rows.
 You can create a Left Outer Join which will include all the rows from the first table.

 You can create a Right Outer Join that will include all the rows from the second table.

Let us now go to the Create tab and create a query from the Design View.
Select tblProjects and tblTasks and close the Show Table dialog box as in the following
screenshot.
Add the ProjectName field from tblProjects, and TaskTitle,
StartDate and DueDate from tblTasks table.

Let us now run the query.


We are only displaying records from a few projects. A couple of these projects have a lot
of tasks associated with that project and this information is related
through ProjectID field.
 When we create this query in Microsoft Access, Access is taking this relationship
from the relationships we have created.
 By default, it is creating what's known as an Inner Join between these two fields,
between these two tables, and that is how it is relating this information together from
these two tables.
 It is showing us only the matches, so when we run this query, there are a lot of other
projects listed in tblProjects that do not appear as part of our records set in this
query, and that is because of how these two tables are joined together, through that
Inner Join, which is again, that default Join for any query.
However, if you want to alter the relationship, Let us say you want to create an outer join,
or in other words, show all of the projects from tblProjects, every single record that is in
that table, along with all of the tasks from tblTasks — Open join properties; we can do
this simply by double-clicking on the relationship line.

Access will display the left table name and the right table name in Join Properties dialog.
 The left column name and the right column name and the first radio button is to only
include rows where the join fields from both tables are equal and that is the inner
join and that is what is selected by default when creating relationships, when creating
a join in the query, but, you can change it.
 We have two other options as well; we can include all records from tblProjects, and
only those records from tblTasks where the joined fields are equal and this one is
Left Outer Join.
 We have a third option, include all records from tblTasks and only those records
from tblProjects where the joined fields are equal and this one is Right Outer Join.
Those are the different types of joins you can create easily from the Design View. Let us
select the second option, which is Left Outer Join, and click Ok.
Let us now look into the other steps −

When you look at the relationship line, you will see a little arrow pointing
towards ProjectID in tblTasks. When you run this query, you will see the following
results.
As you can see that it is showing us every single project name, whether or not it has a
related task. You will also see a bunch of null fields. All of this will be blank because
there is no related information in tblTasks, where these fields come from. Let us now go
to the Design View again and double-click on the relationship line.

In the Join Properties dialog box, select the third option which is for the Right Outer Join
and click Ok.

Now look at our relationship line. You will see that a little arrow is now pointing
towards ProjectID in tblProjects. When you run this query you will see the following
results.
Self-Joins
Self-join is another type of Join. A Self-join relates matching fields from within the same
table. For example, look at the employee's table with a supervisor field, which references
the same kind of number stored in another field within the same table — the employee ID.

If we wanted to know who Kaitlin Rasmussen's supervisor is, we will have to take the
number stored in that supervisor field and look it up within the exact same table in that
employee ID field in order to know that Charity Hendricks is the supervisor.
This table is not the ideal structure for a relational database because it's not normalized.
If we have a situation where we want to create a query that just lists the employee names
alongside the names of their supervisors, there is no easy way we can query that unless we
create a Self-join.
To see a Self-join, create a table with the following fields and enter some data.
Here we want to create a list again with the first name of the employee and then the name
of the supervisor. Let us create a query from the query design view.
Now, add tblEmployees tables.

Close this dialog box.


Now, add the first name and last name for our employees.
We now need a way to create a relationship between this table and itself. To do that, we
need to open the show table dialog box and add tblEmployees one more time.

We have created another copy of the same table in this query view. Now, we need to
create Self-join. To do that, click on Supervisor in tblEmployees table and hold the
mouse button and drop it right on top of the EmployeeID in that copied table
— tblEmployees_1. Then, add the first name and last name from that copied table.
Let us now run your query and you will see the following results.

It displays the names of the employees along side the names of their supervisors. And,
this is how you create a Self-join in Microsoft Access.
Ms Access - Duplicates Query Wizard
In this tutorial, we have created a variety of select queries, mainly from the Design View.
But in Access, we can make use of some special query wizards to create a couple of
specific select queries. The first one is Find Duplicates Query wizard. The Find
Duplicates Query Wizard will create a query that locates records with duplicate field
values in a single table or query.
As we have discussed that relational databases are designed to avoid storing duplicate
information. But despite that design, sometimes users accidentally enter duplicate
information.
Example
In a customer's table, you can have the same customer accidentally added twice. In such
cases, the customer will have the same address, but different customer IDs, which can
create problems with reporting. In this situation, you can make use of the duplicates
query wizard to quickly locate possible duplicate entries.
Let us now open our Access database which contains tblAuthers table and go
the Create tab and, in the queries group, select query wizard.
If you see the following screenshot, you have four different wizards to choose from.
Select the find duplicates query wizard and click Ok.

The very first screen of the find duplicates query wizard will ask what table or what query
you want to search for possible duplicates. Let us say we want to check our author's table
to make sure that the same author hasn't accidentally been entered twice. So, select
tblAuthors and click Next.
 The second screen in the wizard will ask what fields might contain duplicate
information.
 Typically, you will not be using your primary key field, because, again, when you
designate a field in Access as a primary key, Access will not allow duplicates to be
entered.
 We will look at any other field or a combination of fields.
We can search by the last name or the first name and the last name, or you can search by
their street address, or to be more specific with their telephone number or birthday.
Let us now search by the first name, the last name, and birthday and click Next.

The following screen in this wizard will ask for the fields we want to be displayed in our
query. For this, hit the double arrow, all of the fields will move over to the additional
query fields area, and will be added to our query results.
Let us now click Next. It will take us to the last screen in this query wizard.

In the following screen, enter how do you want to name your query.

By default, it's going to name it find duplicates for plus whatever the name of the
object that you're querying. In this case, tblAuthors, but you can give it any other name
too and click finish.
Here, Access has found a possible duplicate, and that's going to be author Jose Caline
which has same birthday, same address, same telephone number but different AuthorIDs.
This one has definitely been entered twice by accident. We have now added all of the
fields to our query, we could just go and delete the record. We also have to make sure that
we don't have any related records in another table.

Select any record and choose Delete as in the following dialog box.

Access gives you a prompt, “You are about to delete one record.” Click Yes if you want
to continue.
If you'd like to see how that wizard has created this query, go into the Design View and
see what all has been added to this query.
As you can see in the above screenshot, we have our fields and some specific criteria
underneath the first name field.

This is how this wizard is looking for that duplicate information. It is by far the easiest
method to find duplicates.
Ms Access - Unmatched Query Wizard
In Access, there is another very useful wizard and that is Find Unmatched Query
Wizard. The Find Unmatched Query Wizard creates a query that finds records or rows in
one table that have no related records in another table.
As we have already discussed how data joins together in queries, and how most queries
are looking for the matches between two or more tables.

 This is the default join in Access, for example, if we design a query with two
tables, tblCustomers and tblOrders, and join those two tables by the CustomerIDs,
this query will return only the results that match. In other words, the customers who
have placed orders.
 There are times when we don't want to see the matches, for instance, we may not
want to see any customer in our database — the customers who have not placed
orders as yet.

 This is exactly what the find unmatched query does.


There are many other possible uses for this kind of query as well.
In our database, we can use it to see which authors have not yet written a project or you
could use it to see which employees have not yet elected any health benefits. Let us now
open your database which contains Customers and Orders table; go to the Create tab and
click on the query wizard button.
Select the Find Unmatched Query Wizard and click Ok.

In this scenario, we will look out for those customers who have not placed an order. In the
first screen it's asking which table or query contains the records you want in the query
results.
We now want a list of customers from tblCustomers. Select that option and click Next.
In the following screen, you need to specify which table or query contains the related
records. In other words, what table are you using to compare with the first one. For this,
we need to find the ones that have not placed orders. We need to select the table that
contains information on all orders — tblOrders. Now, click Next.

In the following screen, you need to specify which piece of information is in both tables.
 This will typically be some kind of primary key, foreign key, field, or relationship.
 If you have an existing relationship in your database, Access will select and match

those fields for you.


 But, if you have other fields that you can join together, contain similar information,

you can choose that here as well.


Here, we have CustID selected by default in both Fields in ‘tblCustomers’ and Fields in
‘tblOrders’. Now, click Next.
In the following screen, you can pick and choose the fields you want to see displayed in
the query results.

Let us now select all the available fields and click on the double-headed arrow. This
moves all the available fields over to the selected fields area. Now, click Next.

The last screen will allow you to choose a name for your query and click Finish.
©SAYANTAN BERA
Here we have one customer listed as that customer who has not placed an order with us
yet.

You can also see how that query was created. For this, you need to go back to the Design
View.
This wizard has created an Outer Join between tblCustomer and tblOrders and the Is
Null criteria is added to the CustID from tblORders. This is to exclude certain records. In
this case, it is the customers who have placed orders, or who have related information in
tblOrders.
Ms Access - Create Form
Forms in Access are like display cases in stores that make it easier to view or get the
items that you want. Since forms are objects through which you or other users can add,
edit, or display the data stored in your Access desktop database, the design of your form is
an important aspect. There's a lot you can do design-wise with forms in Microsoft Access.
You can create two basic types of forms −
 Bound forms
 Unbound forms
Bound Forms
Let us now understand what Bound Forms are −
 Bound forms are connected to some underlying data source such as a table, query, or
SQL statement.
 Bound forms are what people typically think of when they think of the purpose of a
form.
 Forms are to be filled out or used to enter or edit data in a database.
 Examples of bound forms will typically be what users use to enter, view or edit data
in a database.
Unbound Forms
Let us look into Unbound Forms −
 These forms are not connected to an underlying record or data source.
 Unbound forms could be dialog boxes, switch boards, or navigation forms.
 In other words, unbound forms are typically used to navigate or interact with the
database at large, as opposed to the data itself.
Types of Bound Forms
There are many types of bound forms you can create in Access. Let us understand the
types −
Single Item Form
This is the most popular one and this is where the records are displayed — one record at a
time.
Multiple Item Form
This displays multiple records at a time from that bound data source.
Split Form
The form is divided into halves, either vertically or horizontally. One half displays a
single item or record, and the other half displays a list or provides a datasheet view of
multiple records from the underlying data source.
Creating Forms
There are a few methods you can use to create forms in Access. For this, open your
Database and go to the Create tab. In the Forms group, in the upper right-hand corner
you will see the Form Wizard button.
Click on that button to launch the Form Wizard.
On this first screen in the wizard, you can select fields that you want to display on your
form, and you can choose from fields from more than one table or a query.
Let us assume we want to simply have a quick form that we are going to use for data entry
for our employee information.
From Tables/Queries drop-down list, select tblEmployees table. Click on the double
arrow to move all the fields at once.

Let us just leave it with that one table, and click Next.
The following screen in the Form Wizard will ask for the layout that we would like for
our form. We have columnar, tabular, datasheet and justified layouts. We will choose
the columnar layout here and then click Next.

In the following screen, we need to give a title for our form. Let us call it frmEmployees.
Once you have given your form a title, you can open the form to see what that form looks
like, or you can begin entering information into your table. Or you can choose the option
to modify the form's design. Let us choose the first option to open the form to view or
enter information and click Finish.
Now, take a look at the following screenshot. This is what your form looks like. This is a
single item form, meaning one record is displayed at a time and further down you can see
the navigation buttons, which is telling us that this is displaying the record 1 of 9. If you
click on that button then, it will move to the next record.

If you want to jump to the very last record in that form or that table, you can use the
button right beside that right arrow, the arrow with a line after it, that's the last record
button. If you want to add new employee information, go to the end of this records and
then after 9 records you will see a blank form where you can begin entering out the new
employee's information.
This is one example of how you can create a form using the Form Wizard. Let us now
close this form and go to the Create tab. Now we will create a slightly more complicated
form using Wizard. Click the Form Wizard and this time, we will choose fields from a
couple of different tables.
In this Form Wizard, let us choose tblProjects for Tables/Queries, and select a few
Available Fields such as ProjectID, ProjectName, ProjectStart, and ProjectEnd. These
fields will now move to Selected Fields.
Now select tblTasks for Tables/Queries and send over the TaskID, ProjectID, TaskTitle,
StartDate, DueDate and PercentComplete. Click Next.
Here, we want to retrieve data from a couple of different objects. We can also choose
from options on how we want to arrange our form. If we want to create a flat form, we
can choose to arrange by tblTasks, which will create that single form, with all the fields
laid out in flat view as shown above.
However, if we want to create a hierarchical form based on that one-to-many relationship,
we can choose to arrange our data by tblProjects.

In the above window, we have the option to include a subform for tblTasks, or we can
make that a linked form. This linked form is where tblProjects will have a button that will
launch that second form filtered to the project that we have selected in that underlying
projects form. Let us now select the Form with subform(s), and then click Next.
In the following screen, you can choose a layout for your subform. The Datasheet View
gets selected by default. The Datasheet View is similar to Table View. Now, click Next.

In the following screen, you need to provide a name for your forms. Enter the name you
want and click Finish.
Access will give you a preview of what your form looks like. On top, you have the
controls on your main form, which is from our Projects table. As you go down, you will
see a subform. It's like a form within a form.

Multiple Item Form


You may also want to create a specific kind of form. For this, you can click on the More
Forms drop-down menu.
From the menu, you can create a Multiple Items form, a Datasheet form, a Split form, or
even a Modal Dialog form. These are typically bound forms; select the object that you
would like to be bound to that form. This does not apply to the Modal Dialog forms.
To create this type of form, you will need to select the object in navigation pane first. Let
us select tblEmployees here.

Proceed by clicking on More Forms and Multiple Items.


The above step will further create a Multiple Items form, listing out all the employees.
Split Form
This type of form is divided in equal halves, either vertically or horizontally. One half
displays a single item or record, and the other half displays a list or a datasheet view of
multiple records from the underlying data source.
Let us now select tblEmployees in the navigation pane and then on Create tab.
Select Split Form option from More Forms menu and you will see the following form in
which the form is divided vertically.

Ms Access - Modify Form


We have learnt several ways to create simple data entry forms. Although the forms ease
the process of data entry; these may not serve other purposes that you would want. They
may not be catchy or user-friendly for what you have intended.
Upon creating a form, the first thing you will probably want to do is resize or move
the controls around.
 You might also need to add a control or remove a control.

We will now discuss how to modify your form in an easy way.


Controls
It is merely a generic term used to describe any object on a form or report that displays
data, performs actions or items used for decorations such as a line. In other words, a
control is just about anything that is placed on a form or report.
The following can be considered as controls −
 Objects such as labels.
 Unbound or bound text boxes that you can use to add or edit or even calculate an
expression.
 Command buttons that perform actions like Save, Open an e-mail or Print and these
buttons are also known as controls.
 It is just a generic term for any object on a form or report.

We will now look at the different aspects of making a form presentable and understand
how to edit and modify a form. Let us now open our Multiple Items form which lists out
all employees from tnlEmployees.

As you can see a list of employees, but doesn't really look like a very user friendly list.
Our controls are oversized. They are too big, spaced apart and do not provide a very
useful list view.
To edit the appearance of your controls on this form, you have two form views that you
can use. In the Home tab, click the View drop-down.

You have the Layout View or the Design View, and both of these views are used to edit
your form. The Form View opens up by default; this is the view you will use to interact
with or edit the underlying data source.
To edit the appearance of the form itself, we need to go to the Layout View first.
When you switch to the Layout View, you will see a series of contextual tabs appear.
At the top of Access, you will see an area marked Form Layout Tools with three tabs —
Design tab, an Arrange tab, and a Format tab and each of these tabs have different options
for formatting the look or appearance of the form.
When you take your mouse and click on any one of these controls, you will notice that
Access will highlight a given area of that form and all controls within that area are shaded
a light orange whereas the actual control that you select will be shaded darker than the
previous one or have a darker orange border around where you click.

Here you can resize your controls as you want by clicking and dragging your mouse to
resize the height or width or both of that one control.
On this particular form, when you resize any single control, you also change the size of
the rest of your controls on your form, this is because of how these controls are grouped.
Let us now adjust all the fields the way you want by using the click and drag function of
the mouse.

That is one quick way of editing the height and width of controls in your form from this
Layout View.
Themes
In Access, there are some basic ways to format your forms by using built-in themes,
colors, and font styles, customizing fill colors and shading alternate rows. Let us now
open frmEmployees.
The forms that Access creates are plain and simple. They have a blue bar on the top and a
white background.
If you want to see how else you can stylize these forms, you can go to the Design View or
Layout View and explore some of the options you have on the Design tab in the Themes
area.
If you click on the Themes' drop-down gallery, you have many pre-created themes to try
out from. Hovering your mouse over any one of them will give you a preview of changing
things like colors and font sizes and the actual font used. To apply a particular style,
simply click your mouse on it and you can see what that looks like.

If you like the theme but you want to change the colors, you can adjust the colors by
going back to the Themes group on the Design tab and choosing the color you like. You
can also create custom colors to match your company's colors.

Similarly, you also have a series of font styles to choose from. You can choose one from
the many that come prebuilt with the Office Suite or you can customize those fonts,
choosing a specific heading font, a body font and even creating a custom name for that
font group and saving.

Let us go back to frmEmployees. In this form, you will see that every alternate row is
shaded light gray.

The formatting option is referred to as Alternate Row Color and if you want to adjust
that in a multiple form, go to the Design View.
Select that detail section and then go to the Format tab and in background group you
should see an option for Alternate Row Color. You can change the colors for alternate
rows. To see what that looks like, simply go to the Form View or the Layout View.

If you don't want any shading at all, you can choose No Color as your Alternate Row
Color and that is more the traditional look from earlier versions of Access.
Ms Access - Navigation Form
Access includes a Navigation Control that makes it easy to switch between various forms
and reports in your database. A navigation form is simply a form that contains a
Navigation Control. Navigation forms are a great addition to any desktop database.
 Microsoft Access offers several features for controlling how users navigate the
database.
 We have already used navigation pane to navigate through all of the Access objects
we create, such as forms, queries, tables, etc.
 If you want to create your own navigational structure and make it easier for the users
to find the specific objects that they really need, you can build navigation form,
which is a form that uses a navigation control so users can use or view forms and
reports right from within that main navigation form.
Example
Let us now take a simple example in which we will create the navigation form. For this,
go to the Create tab; in the Forms group, you will see this navigation drop-down menu.
In this menu, you will see different layouts for how to arrange your forms and reports that
you would like to embed on this navigation form.
 There is one with horizontal tabs, one with vertical tabs — where all the tabs are
aligned to the left, a vertical tabs layout where all the tabs are aligned to the right.
 There is a horizontal tabs layout that has two levels to it, so if you have a lot of
objects that you want to display across the top, you can make use of this.
 You can have one where you have both horizontal tabs and vertical tabs, either
aligned to the left or to the right.
In the following example, we will be using Horizontal Tabs and Vertical Tabs. To create
that layout or that navigation form, simply click on it, and Access will create an unbound
form, with a navigation control on it.

To add objects to this navigation form, the easiest way to do is through your layout view,
by simply dragging and dropping objects to where you want them to appear.
Let us now drag frmProjects form from the navigation pane and drop it on the [Add
New] on the top.

Similarly, drag frmAuthers form from the navigation pane and drop it to the left of the
Add New Button.

Let us now add other forms related to Projects such as frmSubTasks,


frmCurrentProjects etc.
Let us now add additional tabs across the top. We will first add the frmEmployees form.

Now, you will see that your other project buttons have disappeared from the left and that
is because they are attached to Project tab. All the buttons you view on the left are linked
to whatever you have selected up the top. Now with the Employee tab selected, let us drag
employees-related information to the left.
Now we have project information on one tab, employee information on the other.
Similarly, you can add more tabs as per your requirements. As you can see that the name
of the tabs is not appropriate, so let us start renaming some of these tabs to make them
more user-friendly. The easiest way is to double-click on any tab or any button on the left
and rename it as shown in the following screenshot.
HTML stands for Hyper Text Markup Language, which is the most widely used
language on Web to develop web pages. HTML was created by Berners-Lee in late 1991
but "HTML 2.0" was the first standard HTML specification which was published in 1995.
HTML 4.01 was a major version of HTML and it was published in late 1999. Though
HTML 4.01 version is widely used but currently we are having HTML-5 version which is
an extension to HTML 4.01, and this version was published in 2012.
Why to Learn HTML?
Originally, HTML was developed with the intent of defining the structure of documents
like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific
information between researchers. Now, HTML is being widely used to format web pages
with the help of different tags available in HTML language.
HTML is a MUST for students and working professionals to become a great Software
Engineer specially when they are working in Web Development Domain. I will list down
some of the key advantages of learning HTML:
 Create Web site - You can create a website or customize an existing web template if
you know HTML well.
 Become a web designer - If you want to start a carrer as a professional web
designer, HTML and CSS designing is a must skill.
 Understand web - If you want to optimize your website, to boost its speed and
performance, it is good to know HTML to yield best results.
 Learn other languages - Once you understands the basic of HTML then other
related technologies like javascript, php, or angular are become easier to understand.
Hello World using HTML.
Just to give you a little excitement about HTML, I'm going to give you a small
conventional HTML Hello World program, You can try it using Demo link.
<!DOCTYPE html>
<html>
<head>
<title>This is document title</title>
</head>
<body>
<h1>This is a heading</h1>
<p>Hello World!</p>
</body>
</html>

Applications of HTML
As mentioned before, HTML is one of the most widely used language over the web. I'm
going to list few of them here:
 Web pages development - HTML is used to create pages which are rendered over
the web. Almost every page of web is having html tags in it to render its details in
browser.
 Internet Navigation - HTML provides tags which are used to navigate from one
page to another and is heavily used in internet navigation.
 Responsive UI - HTML pages now-a-days works well on all platform, mobile, tabs,
desktop or laptops owing to responsive design strategy.

 Offline support HTML pages once loaded can be made available offline on the
machine without any need of internet.
 Game development- HTML5 has native support for rich experience and is now
useful in gaming developent arena as well.
Audience
This HTML tutorial is designed for the aspiring Web Designers and Developers with a
need to understand the HTML in enough detail along with its simple overview, and
practical examples. This tutorial will give you enough ingredients to start with HTML
from where you can take yourself at higher level of expertise.
Prerequisites
Before proceeding with this tutorial you should have a basic working knowledge with
Windows or Linux operating system, additionally you must be familiar with −
 Experience with any text editor like notepad, notepad++, or Edit plus etc.
 How to create directories and files on your computer.

 How to navigate through different directories.

 How to type content in a file and save them on a computer.

 Understanding about images in different formats like JPEG, PNG format.

HTML stands for Hypertext Markup Language, and it is the most widely used language
to write Web Pages.
 Hypertext refers to the way in which Web pages (HTML documents) are linked
together. Thus, the link available on a webpage is called Hypertext.
 As its name suggests, HTML is a Markup Language which means you use HTML
to simply "mark-up" a text document with tags that tell a Web browser how to
structure it to display.
Originally, HTML was developed with the intent of defining the structure of documents
like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific
information between researchers.
Now, HTML is being widely used to format web pages with the help of different tags
available in HTML language.
Basic HTML Document
In its simplest form, following is an example of an HTML document −
<!DOCTYPE html>
<html>

<head>
<title>This is document title</title>
</head>
<body>
<h1>This is a heading</h1>
<p>Document content goes here.....</p>
</body>
</html>

HTML Tags
As told earlier, HTML is a markup language and makes use of various tags to format the
content. These tags are enclosed within angle braces <Tag Name>. Except few tags, most
of the tags have their corresponding closing tags. For example, <html> has its closing
tag </html> and <body> tag has its closing tag </body> tag etc.
Above example of HTML document uses the following tags −
Sr.N Tag & Description
o

1 <!DOCTYPE...>
This tag defines the document type and HTML version.

2 <html>
This tag encloses the complete HTML document and mainly
comprises of document header which is represented by
<head>...</head> and document body which is represented by
<body>...</body> tags.

3 <head>
This tag represents the document's header which can keep other
HTML tags like <title>, <link> etc.

4 <title>
The <title> tag is used inside the <head> tag to mention the
document title.

5 <body>
This tag represents the document's body which keeps other
HTML tags like <h1>, <div>, <p> etc.

6 <h1>
This tag represents the heading.

7 <p>
This tag represents a paragraph.

To learn HTML, you will need to study various tags and understand how they behave,
while formatting a textual document. Learning HTML is simple as users have to learn the
usage of different tags in order to format the text or images to make a beautiful webpage.
World Wide Web Consortium (W3C) recommends to use lowercase tags starting from
HTML 4.
HTML Document Structure
A typical HTML document will have the following structure −
<html>
<head>
Document header related tags
</head>
<body>
Document body related tags
</body>
</html>
We will study all the header and body tags in subsequent chapters, but for now let's see
what is document declaration tag.
The <!DOCTYPE> Declaration
The <!DOCTYPE> declaration tag is used by the web browser to understand the version
of the HTML used in the document. Current version of HTML is 5 and it makes use of the
following declaration −
<!DOCTYPE html>
There are many other declaration types which can be used in HTML document depending
on what version of HTML is being used. We will see more details on this while
discussing <!DOCTYPE...> tag along with other HTML tags.
Heading Tags
Any document starts with a heading. You can use different sizes for your headings.
HTML also has six levels of headings, which use the elements <h1>, <h2>, <h3>, <h4>,
<h5>, and <h6>. While displaying any heading, browser adds one line before and one
line after that heading.
Example

<!DOCTYPE html>
<html>

<head>
<title>Heading Example</title>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
This will produce the following result −
Paragraph Tag
The <p> tag offers a way to structure your text into different paragraphs. Each paragraph
of text should go in between an opening <p> and a closing </p> tag as shown below in the
example −
Example

<!DOCTYPE html>
<html>
<head>
<title>Paragraph Example</title>
</head>
<body>
<p>Here is a first paragraph of text.</p>
<p>Here is a second paragraph of text.</p>
<p>Here is a third paragraph of text.</p>
</body>
</html>
This will produce the following result −
Line Break Tag
Whenever you use the <br /> element, anything following it starts from the next line.
This tag is an example of an empty element, where you do not need opening and closing
tags, as there is nothing to go in between them.
The <br /> tag has a space between the characters br and the forward slash. If you omit
this space, older browsers will have trouble rendering the line break, while if you miss the
forward slash character and just use <br> it is not valid in XHTML.
Example

<!DOCTYPE html>
<html>

<head>
<title>Line Break Example</title>
</head>
<body>
<p>Hello<br />
You delivered your assignment ontime.<br />
Thanks<br />
Mahnaz</p>
</body>
</html>
This will produce the following result −
Centering Content
You can use <center> tag to put any content in the center of the page or any table cell.
Example

<!DOCTYPE html>
<html>

<head>
<title>Centring Content Example</title>
</head>
<body>
<p>This text is not in the center.</p>
<center>
<p>This text is in the center.</p>
</center>
</body>
</html>
This will produce following result −
Horizontal Lines
Horizontal lines are used to visually break-up sections of a document. The <hr> tag
creates a line from the current position in the document to the right margin and breaks the
line accordingly.
For example, you may want to give a line between two paragraphs as in the given
example below −
Example

<!DOCTYPE html>
<html>

<head>
<title>Horizontal Line Example</title>
</head>
<body>
<p>This is paragraph one and should be on top</p>
<hr />
<p>This is paragraph two and should be at bottom</p>
</body>
</html>
This will produce the following result −
Again <hr /> tag is an example of the empty element, where you do not need opening
and closing tags, as there is nothing to go in between them.
The <hr /> element has a space between the characters hr and the forward slash. If you
omit this space, older browsers will have trouble rendering the horizontal line, while if
you miss the forward slash character and just use <hr> it is not valid in XHTML
Preserve Formatting
Sometimes, you want your text to follow the exact format of how it is written in the
HTML document. In these cases, you can use the preformatted tag <pre>.
Any text between the opening <pre> tag and the closing </pre> tag will preserve the
formatting of the source document.
Example

<!DOCTYPE html>
<html>

<head>
<title>Preserve Formatting Example</title>
</head>
<body>
<pre>
function testFunction( strText ){
alert (strText)
}
</pre>
</body>
</html>
This will produce the following result −
Try using the same code without keeping it inside <pre>...</pre> tags
Nonbreaking Spaces
Suppose you want to use the phrase "12 Angry Men." Here, you would not want a
browser to split the "12, Angry" and "Men" across two lines −
An example of this technique appears in the movie "12 Angry Men."
In cases, where you do not want the client browser to break text, you should use a
nonbreaking space entity &nbsp; instead of a normal space. For example, when coding
the "12 Angry Men" in a paragraph, you should use something similar to the following
code −
Example

<!DOCTYPE html>
<html>
<head>
<title>Nonbreaking Spaces Example</title>
</head>
<body>
<p>An example of this technique appears in the movie
"12&nbsp;Angry&nbsp;Men."</p>
</body>
</html>
This will produce the following result −
An example of this technique appears in the movie "12 Angry Men."
An HTML element is defined by a starting tag. If the element contains other content, it
ends with a closing tag, where the element name is preceded by a forward slash as shown
below with few tags −
Start Tag Content End Tag

<p> This is paragraph content. </p>

<h1> This is heading content. </h1>

<div> This is division content. </div>

<br />

So here <p>....</p> is an HTML element, <h1>...</h1> is another HTML element. There


are some HTML elements which don't need to be closed, such
as <img.../>, <hr /> and <br /> elements. These are known as void elements.
HTML documents consists of a tree of these elements and they specify how HTML
documents should be built, and what kind of content should be placed in what part of an
HTML document.
HTML Tag vs. Element
An HTML element is defined by a starting tag. If the element contains other content, it
ends with a closing tag.
For example, <p> is starting tag of a paragraph and </p> is closing tag of the same
paragraph but <p>This is paragraph</p> is a paragraph element.
Nested HTML Elements
It is very much allowed to keep one HTML element inside another HTML element −
Example

<!DOCTYPE html>
<html>

<head>
<title>Nested Elements Example</title>
</head>
<body>
<h1>This is <i>italic</i> heading</h1>
<p>This is <u>underlined</u> paragraph</p>
</body>
</html>
This will display the following result −
This is italic heading

This is underlined paragraph


If you use a word processor, you must be familiar with the ability to make text bold,
italicized, or underlined; these are just three of the ten options available to indicate how
text can appear in HTML and XHTML.
Bold Text
Anything that appears within <b>...</b> element, is displayed in bold as shown below −
Example

<!DOCTYPE html>
<html>

<head>
<title>Bold Text Example</title>
</head>
<body>
<p>The following word uses a <b>bold</b> typeface.</p>
</body>
</html>
This will produce the following result −
Italic Text
Anything that appears within <i>...</i> element is displayed in italicized as shown below

Example

<!DOCTYPE html>
<html>

<head>
<title>Italic Text Example</title>
</head>
<body>
<p>The following word uses an <i>italicized</i> typeface.</p>
</body>
</html>
This will produce the following result −
Underlined Text
Anything that appears within <u>...</u> element, is displayed with underline as shown
below −
Example

<!DOCTYPE html>
<html>

<head>
<title>Underlined Text Example</title>
</head>
<body>
<p>The following word uses an <u>underlined</u> typeface.</p>
</body>
</html>
This will produce the following result −
Strike Text
Anything that appears within <strike>...</strike> element is displayed with
strikethrough, which is a thin line through the text as shown below −
Example

<!DOCTYPE html>
<html>
<head>
<title>Strike Text Example</title>
</head>
<body>
<p>The following word uses a <strike>strikethrough</strike> typeface.</p>
</body>
</html>
This will produce the following result −
Monospaced Font
The content of a <tt>...</tt> element is written in monospaced font. Most of the fonts are
known as variable-width fonts because different letters are of different widths (for
example, the letter 'm' is wider than the letter 'i'). In a monospaced font, however, each
letter has the same width.
Example

<!DOCTYPE html>
<html>

<head>
<title>Monospaced Font Example</title>
</head>
<body>
<p>The following word uses a <tt>monospaced</tt> typeface.</p>
</body>
</html>
This will produce the following result −
Superscript Text
The content of a <sup>...</sup> element is written in superscript; the font size used is the
same size as the characters surrounding it but is displayed half a character's height above
the other characters.
Example

<!DOCTYPE html>
<html>
<head>
<title>Superscript Text Example</title>
</head>
<body>
<p>The following word uses a <sup>superscript</sup> typeface.</p>
</body>
</html>
This will produce the following result −
Subscript Text
The content of a <sub>...</sub> element is written in subscript; the font size used is the
same as the characters surrounding it, but is displayed half a character's height beneath the
other characters.
Example

<!DOCTYPE html>
<html>

<head>
<title>Subscript Text Example</title>
</head>
<body>
<p>The following word uses a <sub>subscript</sub> typeface.</p>
</body>
</html>
This will produce the following result −
Inserted Text
Anything that appears within <ins>...</ins> element is displayed as inserted text.
Example

<!DOCTYPE html>
<html>

<head>
<title>Inserted Text Example</title>
</head>
<body>
<p>I want to drink <del>cola</del> <ins>wine</ins></p>
</body>
</html>
This will produce the following result −
Deleted Text
Anything that appears within <del>...</del> element, is displayed as deleted text.
Example

<!DOCTYPE html>
<html>

<head>
<title>Deleted Text Example</title>
</head>
<body>
<p>I want to drink <del>cola</del> <ins>wine</ins></p>
</body>
</html>
This will produce the following result −
Larger Text
The content of the <big>...</big> element is displayed one font size larger than the rest of
the text surrounding it as shown below −
Example

<!DOCTYPE html>
<html>

<head>
<title>Larger Text Example</title>
</head>
<body>
<p>The following word uses a <big>big</big> typeface.</p>
</body>
</html>
This will produce the following result −
Smaller Text
The content of the <small>...</small> element is displayed one font size smaller than the
rest of the text surrounding it as shown below −
Example

<!DOCTYPE html>
<html>

<head>
<title>Smaller Text Example</title>
</head>

<body>
<p>The following word uses a <small>small</small> typeface.</p>
</body>

</html>
This will produce the following result −
Grouping Content
The <div> and <span> elements allow you to group together several elements to create
sections or subsections of a page.
For example, you might want to put all of the footnotes on a page within a <div> element
to indicate that all of the elements within that <div> element relate to the footnotes. You
might then attach a style to this <div> element so that they appear using a special set of
style rules.
Example

<!DOCTYPE html>
<html>

<head>
<title>Div Tag Example</title>
</head>
<body>
<div id = "menu" align = "middle" >
<a href = "/index.htm">HOME</a> |
<a href = "/about/contact_us.htm">CONTACT</a> |
<a href = "/about/index.htm">ABOUT</a>
</div>

<div id = "content" align = "left" >


<h5>Content Articles</h5>
<p>Actual content goes here.....</p>
</div>
</body>
</html>
This will produce the following result −
The <span> element, on the other hand, can be used to group inline elements only. So, if
you have a part of a sentence or paragraph which you want to group together, you could
use the <span> element as follows.
Example

<!DOCTYPE html>
<html>

<head>
<title>Span Tag Example</title>
</head>
<body>
<p>This is the example of <span style = "color:green">span tag</span>
and the <span style = "color:red">div tag</span> alongwith CSS</p>
</body>
</html>
INTRODUCTION TO C PROGRAMMING
C programming is a general-purpose, procedural, imperative computer programming
language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to
develop the UNIX operating system. C is the most widely used computer language. It
keeps fluctuating at number one scale of popularity along with Java programming
language, which is also equally popular and most widely used among modern software
programmers.
Why to Learn C Programming?
C programming language is a MUST for students and working professionals to become
a great Software Engineer specially when they are working in Software Development
Domain. I will list down some of the key advantages of learning C Programming:
 Easy to learn
 Structured language
 It produces efficient programs
 It can handle low-level activities
 It can be compiled on a variety of computer platforms
Facts about C
 C was invented to write an operating system called UNIX.
 C is a successor of B language which was introduced around the early 1970s.
 The language was formalized in 1988 by the American National Standard Institute
(ANSI).
 The UNIX OS was totally written in C.
 Today C is the most widely used and popular System Programming Language.
 Most of the state-of-the-art software have been implemented using C.
Hello World using C Programming.
Just to give you a little excitement about C programming, I'm going to give you a small
conventional C Programming Hello World program, You can try it using Demo link.
#include <stdio.h>

int main() {
/* my first program in C */
printf("Hello, World! \n");
return 0;
}
Applications of C Programming
C was initially used for system development work, particularly the programs that make-up
the operating system. C was adopted as a system development language because it
produces code that runs nearly as fast as the code written in assembly language. Some
examples of the use of C are -
 Operating Systems
 Language Compilers
 Assemblers
 Text Editors
 Print Spoolers
 Network Drivers
 Modern Programs
 Databases
 Language Interpreters
 Utilities
Audience
This tutorial is designed for software programmers with a need to understand the C
programming language starting from scratch. This C tutorial will give you enough
understanding on C programming language from where you can take yourself to higher
level of expertise.
Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of Computer
Programming terminologies. A basic understanding of any of the programming languages
will help you in understanding the C programming concepts and move fast on the
learning track.
C is a general-purpose, high-level language that was originally developed by Dennis M.
Ritchie to develop the UNIX operating system at Bell Labs. C was originally first
implemented on the DEC PDP-11 computer in 1972.
In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available
description of C, now known as the K&R standard.
The UNIX operating system, the C compiler, and essentially all UNIX application
programs have been written in C. C has now become a widely used professional language
for various reasons −
 Easy to learn
 Structured language
 It produces efficient programs
 It can handle low-level activities
 It can be compiled on a variety of computer platforms
Facts about C
 C was invented to write an operating system called UNIX.
 C is a successor of B language which was introduced around the early 1970s.
 The language was formalized in 1988 by the American National Standard Institute
(ANSI).
 The UNIX OS was totally written in C.
 Today C is the most widely used and popular System Programming Language.
 Most of the state-of-the-art software have been implemented using C.
 Today's most popular Linux OS and RDBMS MySQL have been written in C.
Why use C?
C was initially used for system development work, particularly the programs that make-up
the operating system. C was adopted as a system development language because it
produces code that runs nearly as fast as the code written in assembly language. Some
examples of the use of C might be −
 Operating Systems
 Language Compilers
 Assemblers
 Text Editors
 Print Spoolers
 Network Drivers
 Modern Programs
 Databases
 Language Interpreters
 Utilities
C Programs
A C program can vary from 3 lines to millions of lines and it should be written into one or
more text files with extension ".c"; for example, hello.c. You can use "vi", "vim" or any
other text editor to write your C program into a file.
This tutorial assumes that you know how to edit a text file and how to write source code
inside a program file.
If you want to set up your environment for C programming language, you need the
following two software tools available on your computer, (a) Text Editor and (b) The C
Compiler.
Text Editor
This will be used to type your program. Examples of few a editors include Windows
Notepad, OS Edit command, Brief, Epsilon, EMACS, and vim or vi.
The name and version of text editors can vary on different operating systems. For
example, Notepad will be used on Windows, and vim or vi can be used on windows as
well as on Linux or UNIX.
The files you create with your editor are called the source files and they contain the
program source codes. The source files for C programs are typically named with the
extension ".c".
Before starting your programming, make sure you have one text editor in place and you
have enough experience to write a computer program, save it in a file, compile it and
finally execute it.
The C Compiler
The source code written in source file is the human readable source for your program. It
needs to be "compiled", into machine language so that your CPU can actually execute the
program as per the instructions given.
The compiler compiles the source codes into final executable programs. The most
frequently used and free available compiler is the GNU C/C++ compiler, otherwise you
can have compilers either from HP or Solaris if you have the respective operating
systems.
The following section explains how to install GNU C/C++ compiler on various OS. We
keep mentioning C/C++ together because GNU gcc compiler works for both C and C++
programming languages.
Installation on UNIX/Linux
If you are using Linux or UNIX, then check whether GCC is installed on your system by
entering the following command from the command line −
$ gcc -v
If you have GNU compiler installed on your machine, then it should print a message as
follows −
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr .......
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)
If GCC is not installed, then you will have to install it yourself using the detailed
instructions available at https://gcc.gnu.org/install/
This tutorial has been written based on Linux and all the given examples have been
compiled on the Cent OS flavor of the Linux system.
Installation on Mac OS
If you use Mac OS X, the easiest way to obtain GCC is to download the Xcode
development environment from Apple's web site and follow the simple installation
instructions. Once you have Xcode setup, you will be able to use GNU compiler for C/C+
+.
Xcode is currently available at developer.apple.com/technologies/tools/.
Installation on Windows
To install GCC on Windows, you need to install MinGW. To install MinGW, go to the
MinGW homepage, www.mingw.org, and follow the link to the MinGW download page.
Download the latest version of the MinGW installation program, which should be named
MinGW-<version>.exe.
While installing Min GW, at a minimum, you must install gcc-core, gcc-g++, binutils, and
the MinGW runtime, but you may wish to install more.
Add the bin subdirectory of your MinGW installation to your PATH environment
variable, so that you can specify these tools on the command line by their simple names.
After the installation is complete, you will be able to run gcc, g++, ar, ranlib, dlltool, and
several other GNU tools from the Windows command line.
Before we study the basic building blocks of the C programming language, let us look at a
bare minimum C program structure so that we can take it as a reference in the upcoming
chapters.
Hello World Example
A C program basically consists of the following parts −
 Preprocessor Commands
 Functions

 Variables

 Statements & Expressions

 Comments

Let us look at a simple code that would print the words "Hello World" −
#include <stdio.h>

int main() {
/* my first program in C */
printf("Hello, World! \n");
return 0;
}
Let us take a look at the various parts of the above program −
 The first line of the program #include <stdio.h> is a preprocessor command, which
tells a C compiler to include stdio.h file before going to actual compilation.
 The next line int main() is the main function where the program execution begins.
 The next line /*...*/ will be ignored by the compiler and it has been put to add
additional comments in the program. So such lines are called comments in the
program.
 The next line printf(...) is another function available in C which causes the message
"Hello, World!" to be displayed on the screen.
 The next line return 0; terminates the main() function and returns the value 0.
Compile and Execute C Program
Let us see how to save the source code in a file, and how to compile and run it. Following
are the simple steps −
 Open a text editor and add the above-mentioned code.
 Save the file as hello.c
 Open a command prompt and go to the directory where you have saved the file.
 Type gcc hello.c and press enter to compile your code.
 If there are no errors in your code, the command prompt will take you to the next line
and would generate a.out executable file.
 Now, type a.out to execute your program.
 You will see the output "Hello World" printed on the screen.
$ gcc hello.c
$ ./a.out
Hello, World!
Make sure the gcc compiler is in your path and that you are running it in the directory
containing the source file hello.c.
You have seen the basic structure of a C program, so it will be easy to understand other
basic building blocks of the C programming language.
Tokens in C
A C program consists of various tokens and a token is either a keyword, an identifier, a
constant, a string literal, or a symbol. For example, the following C statement consists of
five tokens −
printf("Hello, World! \n");
The individual tokens are −
printf
(
"Hello, World! \n"
)
;

Semicolons
In a C program, the semicolon is a statement terminator. That is, each individual
statement must be ended with a semicolon. It indicates the end of one logical entity.
Given below are two different statements −
printf("Hello, World! \n");
return 0;

Comments
Comments are like helping text in your C program and they are ignored by the compiler.
They start with /* and terminate with the characters */ as shown below −
/* my first program in C */
You cannot have comments within comments and they do not occur within a string or
character literals.
Identifiers
A C identifier is a name used to identify a variable, function, or any other user-defined
item. An identifier starts with a letter A to Z, a to z, or an underscore '_' followed by zero
or more letters, underscores, and digits (0 to 9).
C does not allow punctuation characters such as @, $, and % within identifiers. C is
a case-sensitive programming language. Thus, Manpower and manpower are two
different identifiers in C. Here are some examples of acceptable identifiers −
mohd zara abc move_name a_123
myname50 _temp j a23b9 retVal
Keywords
The following list shows the reserved words in C. These reserved words may not be used
as constants or variables or any other identifier names.
auto else long switch
break enum register typedef

case extern return union

char float short unsigned

const for signed void

continue goto sizeof volatile

default if static while

do int struct _Packed

double

Whitespace in C
A line containing only whitespace, possibly with a comment, is known as a blank line,
and a C compiler totally ignores it.
Whitespace is the term used in C to describe blanks, tabs, newline characters and
comments. Whitespace separates one part of a statement from another and enables the
compiler to identify where one element in a statement, such as int, ends and the next
element begins. Therefore, in the following statement −
int age;
there must be at least one whitespace character (usually a space) between int and age for
the compiler to be able to distinguish them. On the other hand, in the following statement

fruit = apples + oranges; // get the total fruit
no whitespace characters are necessary between fruit and =, or between = and apples,
although you are free to include some if you wish to increase readability.
Data types in c refer to an extensive system used for declaring variables or functions of
different types. The type of a variable determines how much space it occupies in storage
and how the bit pattern stored is interpreted.
The types in C can be classified as follows −
Sr.No Types & Description
.

1 Basic Types
They are arithmetic types and are further classified into: (a)
integer types and (b) floating-point types.

2 Enumerated types
They are again arithmetic types and they are used to define
variables that can only assign certain discrete integer values
throughout the program.

3 The type void


The type specifier void indicates that no value is available.

4 Derived types
They include (a) Pointer types, (b) Array types, (c) Structure
types, (d) Union types and (e) Function types.

The array types and structure types are referred collectively as the aggregate types. The
type of a function specifies the type of the function's return value. We will see the basic
types in the following section, where as other types will be covered in the upcoming
chapters.
Integer Types
The following table provides the details of standard integer types with their storage sizes
and value ranges −
Type Storage size Value range

char 1 byte -128 to 127 or 0 to 255

unsigned char 1 byte 0 to 255

signed char 1 byte -128 to 127

int 2 or 4 bytes -32,768 to 32,767 or -


2,147,483,648 to
2,147,483,647

unsigned int 2 or 4 bytes 0 to 65,535 or 0 to


4,294,967,295

short 2 bytes -32,768 to 32,767

unsigned 2 bytes 0 to 65,535


short

long 8 bytes or (4bytes for 32 bit -9223372036854775808


OS) to
9223372036854775807

unsigned long 8 bytes 0 to


18446744073709551615

To get the exact size of a type or a variable on a particular platform, you can use
the sizeof operator. The expressions sizeof(type) yields the storage size of the object or
type in bytes. Given below is an example to get the size of various type on a machine
using different constant defined in limits.h header file −
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <float.h>

int main(int argc, char** argv) {

printf("CHAR_BIT : %d\n", CHAR_BIT);


printf("CHAR_MAX : %d\n", CHAR_MAX);
printf("CHAR_MIN : %d\n", CHAR_MIN);
printf("INT_MAX : %d\n", INT_MAX);
printf("INT_MIN : %d\n", INT_MIN);
printf("LONG_MAX : %ld\n", (long) LONG_MAX);
printf("LONG_MIN : %ld\n", (long) LONG_MIN);
printf("SCHAR_MAX : %d\n", SCHAR_MAX);
printf("SCHAR_MIN : %d\n", SCHAR_MIN);
printf("SHRT_MAX : %d\n", SHRT_MAX);
printf("SHRT_MIN : %d\n", SHRT_MIN);
printf("UCHAR_MAX : %d\n", UCHAR_MAX);
printf("UINT_MAX : %u\n", (unsigned int) UINT_MAX);
printf("ULONG_MAX : %lu\n", (unsigned long) ULONG_MAX);
printf("USHRT_MAX : %d\n", (unsigned short) USHRT_MAX);

return 0;
}
When you compile and execute the above program, it produces the following result on
Linux −
CHAR_BIT : 8
CHAR_MAX : 127
CHAR_MIN : -128
INT_MAX : 2147483647
INT_MIN : -2147483648
LONG_MAX : 9223372036854775807
LONG_MIN : -9223372036854775808
SCHAR_MAX : 127
SCHAR_MIN : -128
SHRT_MAX : 32767
SHRT_MIN : -32768
UCHAR_MAX : 255
UINT_MAX : 4294967295
ULONG_MAX : 18446744073709551615
USHRT_MAX : 65535
Floating-Point Types
The following table provide the details of standard floating-point types with storage sizes
and value ranges and their precision −
Type Storage size Value range Precision

float 4 byte 1.2E-38 to 3.4E+38 6 decimal places

double 8 byte 2.3E-308 to 1.7E+308 15 decimal places

long double 10 byte 3.4E-4932 to 1.1E+4932 19 decimal places

The header file float.h defines macros that allow you to use these values and other details
about the binary representation of real numbers in your programs. The following example
prints the storage space taken by a float type and its range values −
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <float.h>
int main(int argc, char** argv) {

printf("Storage size for float : %d \n", sizeof(float));


printf("FLT_MAX : %g\n", (float) FLT_MAX);
printf("FLT_MIN : %g\n", (float) FLT_MIN);
printf("-FLT_MAX : %g\n", (float) -FLT_MAX);
printf("-FLT_MIN : %g\n", (float) -FLT_MIN);
printf("DBL_MAX : %g\n", (double) DBL_MAX);
printf("DBL_MIN : %g\n", (double) DBL_MIN);
printf("-DBL_MAX : %g\n", (double) -DBL_MAX);
printf("Precision value: %d\n", FLT_DIG );

return 0;
}
When you compile and execute the above program, it produces the following result on
Linux −
Storage size for float : 4
FLT_MAX : 3.40282e+38
FLT_MIN : 1.17549e-38
-FLT_MAX : -3.40282e+38
-FLT_MIN : -1.17549e-38
DBL_MAX : 1.79769e+308
DBL_MIN : 2.22507e-308
-DBL_MAX : -1.79769e+308
Precision value: 6
The void Type
The void type specifies that no value is available. It is used in three kinds of situations −
Sr.No Types & Description
.

1 Function returns as void


There are various functions in C which do not return any value
or you can say they return void. A function with no return
value has the return type as void. For example, void exit (int
status);

2 Function arguments as void


There are various functions in C which do not accept any
parameter. A function with no parameter can accept a void. For
example, int rand(void);

3 Pointers to void
A pointer of type void * represents the address of an object, but
not its type. For example, a memory allocation function void
*malloc( size_t size ); returns a pointer to void which can be
casted to any data type.

A variable is nothing but a name given to a storage area that our programs can
manipulate. Each variable in C has a specific type, which determines the size and layout
of the variable's memory; the range of values that can be stored within that memory; and
the set of operations that can be applied to the variable.
The name of a variable can be composed of letters, digits, and the underscore character. It
must begin with either a letter or an underscore. Upper and lowercase letters are distinct
because C is case-sensitive. Based on the basic types explained in the previous chapter,
there will be the following basic variable types −
Sr.No. Type & Description

1 char
Typically a single octet(one byte). It is an integer type.

2 int
The most natural size of integer for the machine.

3 float
A single-precision floating point value.

4 double
A double-precision floating point value.

5 void
Represents the absence of type.

C programming language also allows to define various other types of variables, which we
will cover in subsequent chapters like Enumeration, Pointer, Array, Structure, Union, etc.
For this chapter, let us study only basic variable types.
Variable Definition in C
A variable definition tells the compiler where and how much storage to create for the
variable. A variable definition specifies a data type and contains a list of one or more
variables of that type as follows −
type variable_list;
Here, type must be a valid C data type including char, w_char, int, float, double, bool, or
any user-defined object; and variable_list may consist of one or more identifier names
separated by commas. Some valid declarations are shown here −
int i, j, k;
char c, ch;
float f, salary;
double d;
The line int i, j, k; declares and defines the variables i, j, and k; which instruct the
compiler to create variables named i, j and k of type int.
Variables can be initialized (assigned an initial value) in their declaration. The initializer
consists of an equal sign followed by a constant expression as follows −
type variable_name = value;
Some examples are −
extern int d = 3, f = 5; // declaration of d and f.
int d = 3, f = 5; // definition and initializing d and f.
byte z = 22; // definition and initializes z.
char x = 'x'; // the variable x has the value 'x'.
For definition without an initializer: variables with static storage duration are implicitly
initialized with NULL (all bytes have the value 0); the initial value of all other variables
are undefined.
Variable Declaration in C
A variable declaration provides assurance to the compiler that there exists a variable with
the given type and name so that the compiler can proceed for further compilation without
requiring the complete detail about the variable. A variable definition has its meaning at
the time of compilation only, the compiler needs actual variable definition at the time of
linking the program.
A variable declaration is useful when you are using multiple files and you define your
variable in one of the files which will be available at the time of linking of the program.
You will use the keyword extern to declare a variable at any place. Though you can
declare a variable multiple times in your C program, it can be defined only once in a file,
a function, or a block of code.
Example
Try the following example, where variables have been declared at the top, but they have
been defined and initialized inside the main function −
#include <stdio.h>

// Variable declaration:
extern int a, b;
extern int c;
extern float f;

int main () {

/* variable definition: */
int a, b;
int c;
float f;
/* actual initialization */
a = 10;
b = 20;
c = a + b;
printf("value of c : %d \n", c);

f = 70.0/3.0;
printf("value of f : %f \n", f);
return 0;
}
When the above code is compiled and executed, it produces the following result −
value of c : 30
value of f : 23.333334
The same concept applies on function declaration where you provide a function name at
the time of its declaration and its actual definition can be given anywhere else. For
example −
// function declaration
int func();

int main() {

// function call
int i = func();
}

// function definition
int func() {
return 0;
}

Lvalues and Rvalues in C


There are two kinds of expressions in C −
 lvalue − Expressions that refer to a memory location are called "lvalue" expressions.
An lvalue may appear as either the left-hand or right-hand side of an assignment.
 rvalue − The term rvalue refers to a data value that is stored at some address in
memory. An rvalue is an expression that cannot have a value assigned to it which
means an rvalue may appear on the right-hand side but not on the left-hand side of an
assignment.
Variables are lvalues and so they may appear on the left-hand side of an assignment.
Numeric literals are rvalues and so they may not be assigned and cannot appear on the
left-hand side. Take a look at the following valid and invalid statements −
int g = 20; // valid statement

10 = 20; // invalid statement; would generate compile-time error


An operator is a symbol that tells the compiler to perform specific mathematical or logical
functions. C language is rich in built-in operators and provides the following types of
operators −
Arithmetic Operators

 Relational Operators

 Logical Operators

 Bitwise Operators

 Assignment Operators

 Misc Operators

We will, in this chapter, look into the way each operator works.
Arithmetic Operators
The following table shows all the arithmetic operators supported by the C language.
Assume variable A holds 10 and variable B holds 20 then −
Show Examples
Operato Description Example
r

+ Adds two operands. A+B=


30

− Subtracts second operand from the first. A−B=


-10

* Multiplies both operands. A*B=


200

/ Divides numerator by de-numerator. B/A=2

% Modulus Operator and remainder of after an B%A=


integer division. 0

++ Increment operator increases the integer value by A++ =


one. 11

-- Decrement operator decreases the integer value A-- = 9


by one.

Relational Operators
The following table shows all the relational operators supported by C. Assume
variable A holds 10 and variable B holds 20 then −
Show Examples
Operato Description Example
r

== Checks if the values of two operands are equal or (A == B)


not. If yes, then the condition becomes true. is not
true.

!= Checks if the values of two operands are equal or (A != B)


not. If the values are not equal, then the condition is true.
becomes true.

> Checks if the value of left operand is greater than (A > B)


the value of right operand. If yes, then the is not
condition becomes true. true.
< Checks if the value of left operand is less than the (A < B)
value of right operand. If yes, then the condition is true.
becomes true.

>= Checks if the value of left operand is greater than (A >= B)


or equal to the value of right operand. If yes, then is not
the condition becomes true. true.

<= Checks if the value of left operand is less than or (A <= B)


equal to the value of right operand. If yes, then is true.
the condition becomes true.

Logical Operators
Following table shows all the logical operators supported by C language. Assume
variable A holds 1 and variable B holds 0, then −
Show Examples
Operato Description Example
r

&& Called Logical AND operator. If both the (A &&


operands are non-zero, then the condition B) is
becomes true. false.

|| Called Logical OR Operator. If any of the two (A || B)


operands is non-zero, then the condition becomes is true.
true.

! Called Logical NOT Operator. It is used to !(A &&


reverse the logical state of its operand. If a B) is
condition is true, then Logical NOT operator will true.
make it false.

Bitwise Operators
Bitwise operator works on bits and perform bit-by-bit operation. The truth tables for &, |,
and ^ is as follows −
p q p&q p|q p^q

0 0 0 0 0
0 1 0 1 1

1 1 1 1 0

1 0 0 1 1

Assume A = 60 and B = 13 in binary format, they will be as follows −


A = 0011 1100
B = 0000 1101
-----------------
A&B = 0000 1100
A|B = 0011 1101
A^B = 0011 0001
~A = 1100 0011
The following table lists the bitwise operators supported by C. Assume variable 'A' holds
60 and variable 'B' holds 13, then −
Show Examples
Operato Description Example
r

& Binary AND Operator copies a bit to the result if (A & B)


it exists in both operands. = 12,
i.e., 0000
1100

| Binary OR Operator copies a bit if it exists in (A | B) =


either operand. 61, i.e.,
0011
1101

^ Binary XOR Operator copies the bit if it is set in (A ^ B)


one operand but not both. = 49,
i.e., 0011
0001

~ Binary One's Complement Operator is unary and (~A ) =


~(60),
has the effect of 'flipping' bits. i.e,. -
0111101

<< Binary Left Shift Operator. The left operands A << 2 =


value is moved left by the number of bits 240 i.e.,
specified by the right operand. 1111
0000

>> Binary Right Shift Operator. The left operands A >> 2 =


value is moved right by the number of bits 15 i.e.,
specified by the right operand. 0000
1111

Assignment Operators
The following table lists the assignment operators supported by the C language −
Show Examples
Operato Description Example
r

= Simple assignment operator. Assigns values C=A+


from right side operands to left side operand B will
assign the
value of
A + B to
C

+= Add AND assignment operator. It adds the right C += A is


operand to the left operand and assign the result equivalent
to the left operand. to C = C
+A

-= Subtract AND assignment operator. It subtracts C -= A is


the right operand from the left operand and equivalent
assigns the result to the left operand. to C = C -
A

*= Multiply AND assignment operator. It multiplies C *= A is


the right operand with the left operand and equivalent
assigns the result to the left operand. to C = C
*A

/= Divide AND assignment operator. It divides the C /= A is


left operand with the right operand and assigns equivalent
the result to the left operand. to C = C /
A

%= Modulus AND assignment operator. It takes C %= A


modulus using two operands and assigns the is
result to the left operand. equivalent
to C = C
%A

<<= Left shift AND assignment operator. C <<= 2


is same as
C = C <<
2

>>= Right shift AND assignment operator. C >>= 2


is same as
C = C >>
2

&= Bitwise AND assignment operator. C &= 2 is


same as C
=C&2

^= Bitwise exclusive OR and assignment operator. C ^= 2 is


same as C
=C^2

|= Bitwise inclusive OR and assignment operator. C |= 2 is


same as C
=C|2

Misc Operators ↦ sizeof & ternary


Besides the operators discussed above, there are a few other important operators
including sizeof and ? : supported by the C Language.
Show Examples
Operato Description Example
r

sizeof() sizeof(a), where a is


Returns the size of a variable.
integer, will return 4.

& &a; returns the actual


Returns the address of a variable.
address of the variable.

* Pointer to a variable. *a;

?: If Condition is true ? then


Conditional Expression. value X : otherwise value
Y

Operators Precedence in C
Operator precedence determines the grouping of terms in an expression and decides how
an expression is evaluated. Certain operators have higher precedence than others; for
example, the multiplication operator has a higher precedence than the addition operator.
For example, x = 7 + 3 * 2; here, x is assigned 13, not 20 because operator * has a higher
precedence than +, so it first gets multiplied with 3*2 and then adds into 7.
Here, operators with the highest precedence appear at the top of the table, those with the
lowest appear at the bottom. Within an expression, higher precedence operators will be
evaluated first.
Show Examples
Category Operator Associativity

Postfix () [] -> . ++ - - Left to right

Unary + - ! ~ ++ - - (type)* & sizeof Right to left

Multiplicative */% Left to right

Additive +- Left to right

Shift << >> Left to right

Relational < <= > >= Left to right


Equality == != Left to right

Bitwise AND & Left to right

Bitwise XOR ^ Left to right

Bitwise OR | Left to right

Logical AND && Left to right

Logical OR || Left to right

Conditional ?: Right to left

Assignment = += -= *= /= %=>>= <<= &= ^= |= Right to left

Comma , Left to right

Decision making structures require that the programmer specifies one or more conditions
to be evaluated or tested by the program, along with a statement or statements to be
executed if the condition is determined to be true, and optionally, other statements to be
executed if the condition is determined to be false.
Show below is the general form of a typical decision making structure found in most of
the programming languages −
C programming language assumes any non-zero and non-null values as true, and if it is
either zero or null, then it is assumed as false value.
C programming language provides the following types of decision making statements.
Sr.No Statement & Description
.

1 if statement
An if statement consists of a boolean expression followed by
one or more statements.

2 if...else statement
An if statement can be followed by an optional else
statement, which executes when the Boolean expression is
false.

3 nested if statements
You can use one if or else if statement inside another if or else
if statement(s).

4 switch statement
A switch statement allows a variable to be tested for equality
against a list of values.

5 nested switch statements


You can use one switch statement inside
another switch statement(s).

The ? : Operator
We have covered conditional operator ? : in the previous chapter which can be used to
replace if...else statements. It has the following general form −
Exp1 ? Exp2 : Exp3;
Where Exp1, Exp2, and Exp3 are expressions. Notice the use and placement of the colon.
The value of a ? expression is determined like this −
 Exp1 is evaluated. If it is true, then Exp2 is evaluated and becomes the value of the
entire ? expression.
 If Exp1 is false, then Exp3 is evaluated and its value becomes the value of the
expression.
 You may encounter situations, when a block of code needs to be executed several
number of times. In general, statements are executed sequentially: The first statement
in a function is executed first, followed by the second, and so on.
 Programming languages provide various control structures that allow for more
complicated execution paths.
 A loop statement allows us to execute a statement or group of statements multiple
times. Given below is the general form of a loop statement in most of the
programming languages −

 C programming language provides the following types of loops to handle looping


requirements.
Sr.No Loop Type & Description
.

1 while loop

Repeats a statement or group of statements while a given


condition is true. It tests the condition before executing the
loop body.

2 for loop
Executes a sequence of statements multiple times and
abbreviates the code that manages the loop variable.

3 do...while loop
It is more like a while statement, except that it tests the
condition at the end of the loop body.

4 nested loops
You can use one or more loops inside any other while, for, or
do..while loop.

 Loop Control Statements


 Loop control statements change execution from its normal sequence. When execution
leaves a scope, all automatic objects that were created in that scope are destroyed.
 C supports the following control statements.
Sr.No Control Statement & Description
.

1 break statement

Terminates the loop or switch statement and transfers


execution to the statement immediately following the loop or
switch.

2 continue statement
Causes the loop to skip the remainder of its body and
immediately retest its condition prior to reiterating.

3 goto statement
Transfers control to the labeled statement.

A while loop in C programming repeatedly executes a target statement as long as a given


condition is true.
Syntax
The syntax of a while loop in C programming language is −
while(condition) {
statement(s);
}
Here, statement(s) may be a single statement or a block of statements.
The condition may be any expression, and true is any nonzero value. The loop iterates
while the condition is true.
When the condition becomes false, the program control passes to the line immediately
following the loop.
Flow Diagram

Here, the key point to note is that a while loop might not execute at all. When the
condition is tested and the result is false, the loop body will be skipped and the first
statement after the while loop will be executed.
Example

#include <stdio.h>
int main () {

/* local variable definition */


int a = 10;

/* while loop execution */


while( a < 20 ) {
printf("value of a: %d\n", a);
a++;
}
return 0;
}
When the above code is compiled and executed, it produces the following result −
value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 15
value of a: 16
value of a: 17
value of a: 18
value of a: 19
A for loop is a repetition control structure that allows you to efficiently write a loop that
needs to execute a specific number of times.
Syntax
The syntax of a for loop in C programming language is −
for ( init; condition; increment ) {
statement(s);
}
Here is the flow of control in a 'for' loop −
 The init step is executed first, and only once. This step allows you to declare and
initialize any loop control variables. You are not required to put a statement here, as
long as a semicolon appears.
 Next, the condition is evaluated. If it is true, the body of the loop is executed. If it is
false, the body of the loop does not execute and the flow of control jumps to the next
statement just after the 'for' loop.
 After the body of the 'for' loop executes, the flow of control jumps back up to
the increment statement. This statement allows you to update any loop control
variables. This statement can be left blank, as long as a semicolon appears after the
condition.
 The condition is now evaluated again. If it is true, the loop executes and the process
repeats itself (body of loop, then increment step, and then again condition). After the
condition becomes false, the 'for' loop terminates.
Flow Diagram
Example

#include <stdio.h>
int main () {

int a;
/* for loop execution */
for( a = 10; a < 20; a = a + 1 ){
printf("value of a: %d\n", a);
}
return 0;
}
When the above code is compiled and executed, it produces the following result –
value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 15
value of a: 16
value of a: 17
value of a: 18
value of a: 19
The do...while loop
Unlike for and while loops, which test the loop condition at the top of the loop,
the do...while loop in C programming checks its condition at the bottom of the loop.
A do...while loop is similar to a while loop, except the fact that it is guaranteed to execute
at least one time.
Syntax
The syntax of a do...while loop in C programming language is −
do {
statement(s);
} while( condition );
Notice that the conditional expression appears at the end of the loop, so the statement(s)
in the loop executes once before the condition is tested.
If the condition is true, the flow of control jumps back up to do, and the statement(s) in
the loop executes again. This process repeats until the given condition becomes false.
Flow Diagram

Example

#include <stdio.h>
int main () {

/* local variable definition */


int a = 10;

/* do loop execution */
do {
printf("value of a: %d\n", a);
a = a + 1;
}while( a < 20 );
return 0;
}
When the above code is compiled and executed, it produces the following result −
value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 15
value of a: 16
value of a: 17
value of a: 18
value of a: 19
C programming allows to use one loop inside another loop. The following section shows a
few examples to illustrate the concept.
Syntax
The syntax for a nested for loop statement in C is as follows −
for ( init; condition; increment ) {

for ( init; condition; increment ) {


statement(s);
}
statement(s);
}
The syntax for a nested while loop statement in C programming language is as follows −
while(condition) {

while(condition) {
statement(s);
}
statement(s);
}
The syntax for a nested do...while loop statement in C programming language is as
follows −
do {
statement(s);

do {
statement(s);
}while( condition );

}while( condition );
A final note on loop nesting is that you can put any type of loop inside any other type of
loop. For example, a 'for' loop can be inside a 'while' loop or vice versa.
Example
The following program uses a nested for loop to find the prime numbers from 2 to 100 −
#include <stdio.h>
int main () {

/* local variable definition */


int i, j;
for(i = 2; i<100; i++) {

for(j = 2; j <= (i/j); j++)


if(!(i%j)) break; // if factor found, not prime
if(j > (i/j)) printf("%d is prime\n", i);
}
return 0;
}
When the above code is compiled and executed, it produces the following result −
2 is prime
3 is prime
5 is prime
7 is prime
11 is prime
13 is prime
17 is prime
19 is prime
23 is prime
29 is prime
31 is prime
37 is prime
41 is prime
43 is prime
47 is prime
53 is prime
59 is prime
61 is prime
67 is prime
71 is prime
73 is prime
79 is prime
83 is prime
89 is prime
97 is prime
The break statement in C programming has the following two usages −
 When a break statement is encountered inside a loop, the loop is immediately
terminated and the program control resumes at the next statement following the loop.
 It can be used to terminate a case in the switch statement (covered in the next
chapter).
If you are using nested loops, the break statement will stop the execution of the innermost
loop and start executing the next line of code after the block.
Syntax
The syntax for a break statement in C is as follows −
break;
Flow Diagram

Example

#include <stdio.h>
int main () {

/* local variable definition */


int a = 10;

/* while loop execution */


while( a < 20 ) {
printf("value of a: %d\n", a);
a++;
if( a > 15) {
/* terminate the loop using break statement */
break;
}
}
return 0;
}
When the above code is compiled and executed, it produces the following result −
value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 15
The continue statement in C programming works somewhat like the break statement.
Instead of forcing termination, it forces the next iteration of the loop to take place,
skipping any code in between.
For the for loop, continue statement causes the conditional test and increment portions of
the loop to execute. For the while and do...while loops, continue statement causes the
program control to pass to the conditional tests.
Syntax
The syntax for a continue statement in C is as follows −
continue;
Flow Diagram

Example

#include <stdio.h>
int main () {

/* local variable definition */


int a = 10;

/* do loop execution */
do {
if( a == 15) {
/* skip the iteration */
a = a + 1;
continue;
}
printf("value of a: %d\n", a);
a++;
} while( a < 20 );
return 0;
}
When the above code is compiled and executed, it produces the following result −
value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 16
value of a: 17
value of a: 18
value of a: 19
A goto statement in C programming provides an unconditional jump from the 'goto' to a
labeled statement in the same function.
NOTE − Use of goto statement is highly discouraged in any programming language
because it makes difficult to trace the control flow of a program, making the program hard
to understand and hard to modify. Any program that uses a goto can be rewritten to avoid
them.
Syntax
The syntax for a goto statement in C is as follows −
goto label;
..
.
label: statement;
Here label can be any plain text except C keyword and it can be set anywhere in the C
program above or below to goto statement.
Flow Diagram

Example

#include <stdio.h>
int main () {

/* local variable definition */


int a = 10;

/* do loop execution */
LOOP:do {
if( a == 15) {
/* skip the iteration */
a = a + 1;
goto LOOP;
}
printf("value of a: %d\n", a);
a++;

}while( a < 20 );
return 0;
}
When the above code is compiled and executed, it produces the following result −
value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 16
value of a: 17
value of a: 18
value of a: 19

©SAYANTAN BERA

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy