Code 402 Class 10 Open Office-pages-Deleted
Code 402 Class 10 Open Office-pages-Deleted
42
5
to a streaming song and at the same time given a print command for a multipage document yet
chatting online with a friend while still a file is being uploaded. All these four tasks are occurring at
the same time.
Single User OS: Operating system that allows only one user to work at a time is called single user
operating system.
Examples: MS-DOS, IBM-DOS, Windows 95, Windows 98, Windows ME, Classic MacOS (1 to 9),
PalmOS for handheld devices.
Multi-user OS: Operating system that allows multiple users to work at the same time is called multi-user
operating system.
Examples: Unix, Linux, Windows NT, X-Window system and MVS Operating System for
Mainframe computers. Such operating systems are installed on a main powerful computer system
and other computers connect with it over a network. Users log on to the main computer and its
operating system manages all the users. User terminals are called clients or workstations.
Other Types of OS
Real-Time OS: Such operating systems are used to control the activities which need to be done
precisely at a given specific time. For example, launching a satellite in the designated orbit at a
precise time interval or an aircraft control system. RTOS are normally found embedded in the
devices themselves. They are not like general operating systems which need to be installed on the
computer. Some RTOS are VxWorks, FreeRTOS, Integrity, Ecos, Cocoon etc.
Mobile OS: Operating systems that runs on handheld devices like cellphones and tablet Pcs.
Examples: iPhone OS, Android OS, Windows Phone OS.
43
5
Distributed Operating System: This OS manages multiple computers over a network and
manages users and resources on them.
Examples: Windows Server, Linux Server, Ubuntu, Amoeba.
Windows Desktop
Once the computer is started, the screen which appears on the monitor is called the Desktop.
Various components of a desktop are:
1. Wallpaper 2. Icons 3. Gadgets 4. Taskbar
Let us discuss about these parts one by one.
Wallpaper: The wallpaper is the background picture on the desktop.
Icons: The small pictures on the screen are called the icons.
Gadgets: Gadgets are the small and helpful objects in a computer. They have their specific
functions. They are used to watch time, calender, weather, world time, etc. on a computer.
Taskbar: This is a horizontal bar at the bottom of the desktop. Now, let us learn about the various
parts of the taskbar.
Start Button: The Start button is found on the left side of the taskbar. When we click on the
Start button, a menu appears which is known as the Start menu. We can find and open all the
programs from the Start menu.
Middle Section: The middle section shows the programs and files we have opened and allows us
to quickly switch between them.
Quick Launch toolbar: The Quick Launch toolbar provides a fast and easy access to our
favourite programs. These programs can be opened in single-click.
System Tray: The system tray is used to show the date, time and various other notifications.
44
5
secondary names are separated by a dot (.). Folder or directory stores files and other folders. A
folder within a folder is called a sub-folder.
Sub
Folder
Files
Folder
Computer Window
Whatever files or folders you store in your computer, they are accessible from the Computer
window. It is also used to access and manage the files and folders stored in various external memory
devices. For example, CD, DVD, Pen Drive, etc.
To open the Computer window, click on the Start button → Computer or double-click on the
Computer icon on the Desktop.
Left/navigation Pane: It is located on the left side of the computer window. Here, storage drives
and directory tree can be seen. It contains the list of storage drives (hard disk, DVD drive), folders
and sub-folders that you have on the computer. It does not show/lists the files.
Right Pane: It is located on the right side of the window and it shows the content of the folder
which is selected at the left side.
Computer Window
45
5
Creating a File or Folder
1. Open the Computer window.
2. Open the location/drive (or folder) where you want to create a file or folder.
3. Right- click on the blank area, the context menu appears.
4. Select the New option. A submenu appears.
5. Click on the File or Folder option. A new file or folder is created and appears. Type a name
for the file or folder and press the Enter key. This way, various types of files can be created
like LibreOffice Calc, Writer, MS Excel, MS Word or Notepad etc.
1
2
5
3
Right-click on
4 the blank area.
46
5
Note: Shortcut
Deleted file or folder move to the Recycle Bin. To delete a file/folder permanently: Shift+Delete
Shortcut
Copy : Ctrl + C Cut : Ctrl + X Paste : Ctrl + V
LAB EXERCISE
1. Start Your computer and find out which operating system is installed on it.
2. Locate the icons of Computer and Recycle bin. Open them and observe how
different they look. Write any 3 major observations.
3. Locate the Taskbar. Using mouse try to move it to other corners of the
desktop.
4. Open notepad from Start menu, type some data. Save the file on the desktop.
Now delete and restore the file using Recycle bin. Then, permanently delete
the file.
5. Create a folder on drive D: by some name. Now, using notepad create and save
a file in this folder. Now, create another folder on desktop. Copy the file in the
desktop folder.
47
5
The Desktop
Ubuntu desktop is called GNOME 3 desktop. GNOME is an open-source standard desktop
environment for consistent look across various versions of operating system.
48
5
Activities Overview Button: Activities overview allows to type names to search applications,
files and online resources.
Below Activities, there is a bar called dash. It lists the icons of frequent applications and the
currently running applications (with a dot below the icon). Clicking on the icon launches the
corresponding application.
At the bottom of the dash, there is a grid icon. Clicking on this icon displays all the applications on
the screen.
Alt+F1 or the Switch between the Activities overview and desktop. In the
Super key overview, start typing to instantly search your applications,
contacts, and documents.
Alt+F2 Pop up command window (for quickly running commands).
Use the arrow keys to quickly access previously run commands.
49
5
Super+Tab Quickly switch between windows. Hold down Shift for reverse
order.
Super+` Switch between windows from the same application, or from the
selected application after Super+Tab.
This shortcut uses ` on US keyboards, where the ` key is above
Tab. On all other keyboards, the shortcut is Super plus the key
above Tab.
Ctrl+Alt+Tab Give keyboard focus to the top bar. In the Activities overview,
switch keyboard focus between the top bar, dash, windows
overview, applications list, and search field. Use the arrow keys to
navigate.
Super+V Show the notification list. Press Super+V again or Esc to close.
50
5
Managing Data Using The file manager
To start the file manager,
click on Files icon in the
Activities overview.
When the file manager
opens, you can double-click
any folder to view its
contents. You can also right-
click a folder to open it in a
new tab or new window.
You can quickly preview
each file by pressing the
space bar.
The Path bar above the list of files and folders shows you the location of the folder.
If you want to search for a file, in the folder, click on the search icon at the top of the window and
start typing name of the file in the search bar. The files that match the search string entered will be
listed. Press Escape key to come out of the search feature.
51
6 5
Note: Shortcut
Deleted file or folder move to the Trash Bin. To delete a file/folder permanently: Shift+Delete
Shortcut
Copy : Ctrl + C Cut : Ctrl + X Paste : Ctrl + V
52
5
LAB EXERCISE
1. Start Your computer and find out which operating system is installed on it.
2. Locate the icons of File Manager and Trash. Open them and observe how
different they look. Write any 3 major observations.
3. Locate the Top menu, Sidebar and Application Menu.
4. Open notepad from Start menu, type some data. Save the file on the desktop.
Now delete and restore the file using Recycle bin. Then, permanently delete
the file.
5. Create a folder on drive D: by some name. Now, using notepad create and save
a file in this folder. Now, create another folder on desktop. Copy the file in the
desktop folder.
53
5
6. Use safety devices like anti-static wrist band to prevent static electricity shocks harmful for
electronic device.
Computer maintenance schedule
1. Regularly scan computer with antivirus to check viruses.
2. Replace damaged cables, parts and hardware immediately.
3. Keep cables untangled.
4. Never use pirated or any software from unknown source.
5. Keep the operating system and anti-virus updated regularly.
6. Upgrade computer hardware if needed for optimum performance and data storage.
7. Take regular data backup using backup utility installed with the operating system.
8. At an interval of a few months, run a disk maintenance utility such as disk defragmenter to
optimise the storage for faster file access from the computer disk.
To create a backup of your system
1. Start > Control Panel > System and Security > Backup and Restore.
2. At the Back up or restore your files screen, click Set up backup.
3. Select where you want to save the backup and click Next.
4. Choose Let Windows choose (recommended).
5. Click Next and Verify the backup details.
6. Click Save settings and run backup.
To restore a backup
1. Start > Control Panel > System and Security > Backup and Restore.
2. At the Back up or restore your files screen, click Restore my files.
3. Browse to locate the backup file.
4. Click Next and select a location where you want to restore the backup file.
5. Click Restore.
6. When the process is complete, click Finish.
54
5
To defrag a hard disk
1. Open the Computer window and right-click the desired disk.
2. Select Properties. In the Properties dialog box, click the Tools tab.
3. Click the Defragment Now button.
4. Click the Analyze Disk button.
Wait while Windows checks the defragmentation on the media.
5. Click the Defragment Disk button.
55
5
Supplement: Computer Maintenance in Ubuntu
Backup and Restore
Ubuntu provides a backup-restore utility called Déjà Dup. It may be pre-
installed on Ubuntu otherwise you may install it. It is a free utility. Using Déjà
Dup, backups can be taken on local drives, remote drives over a network or on
cloud drives such as Google and Microsoft drives.
¤ To start backup, go to Activities and type backup in search bar. Click on
Backups icon. Backup pop-up will open.
56
5
Disk Cleanup
Ubuntu provides a disk clean up utility called Bleach Bit. It may be pre-installed on Ubuntu
otherwise you may install it. It is a free utility. Using Bleach Bit unnecessary files can be removed to
free disk space, temporary files and cache files can be removed. Temporary files are created by
various applications when you work with them. Cache files and cookies are used by browsers.
¤ Go to Activities and type Bleach in
search bar. It will list Bleach Bit. Click
on it. If it prompts to install, then click
Install button. Bleach Bit will install.
¤ Select your preferences to delete
(folders, clipboard, cache, temporary
files etc.).
¤ Click on Clean button.
¤ Finally, confirm delete in Delete
confirmation pop-up.
57
5
Stealth Virus
These viruses apply some way to avoid detection. For example, reducing the actual file size so that
anti-virus does not get suspicious. Some viruses change their program structure every time they
make a new copy. This makes them hard to detect. Such stealth viruses are also called
polymorphic viruses. Whale, Frodo, Joshi etc. work in stealth way.
Macro Virus
Modern word processors and spreadsheets allow us to write short programs which are the part of
the file. These programs are called macro programs. Macro virus is in the form of a macro
program and it hides itself in the document or spreadsheet as a macro. When the file is opened, it
gets activated. For example, Melissa, Wazzu, Crown.
Virus Symptoms
How will you figure out if your computer is infected with a virus? Look for following symptoms
while switching on and working on your computer:
¤ Your computer is starting up slowly and/or works slower than earlier.
¤ Computer suddenly hangs or crashes so that you need to restart it abnormally.
¤ Unwanted pop-ups and notifications appear which were not there earlier.
¤ Computer restarts suddenly on its own.
¤ Hard disk indicator on your computer shows disk activity even if you are not using any
program or opening/saving any file.
¤ Computer shows lesser hard disk space and memory usage is too high in Task Manager.
¤ Unwanted files are created.
¤ Files are not opening or crashing after opening.
¤ Programs taking too long to load and run.
¤ Strange error messages and dialog boxes.
Other Malware Programs
Viruses are not the only threat today. There are other malware programs also which infect
computers and user data in different ways. Let us learn about them.
Worm
Worms are another form of virus which copy themselves independently without the need of any
file to infect. They spread across computers over a computer and make the data transfer slow.
Some worms are capable of using email service to spread to other mail boxes. Examples:
MSBlast, ILOVEYOU.
Trojan Horse
This computer virus looks like a useful program and once installed or downloaded, it harms the
computer. User will install them thinking as a utility and when it runs the intended damage is done.
For example, Zelu, Rootkit, Exploit.
Spyware or Adware
Spyware installs itself on the computer without user's knowledge and monitors keystrokes, takes
screenshots, reads chat, collects device and user information and forwards it to the malicious
owners of such program. Loss of confidential information and identity theft are the threats posed
by spywares.
Protection from Spyware or Adware
¤ Install an effective spyware detecting software.
¤ Keep your operating system and browser updated.
¤ Check if any unnecessary software is being installed. It is often during the installation steps and
in the User Agreement.
58
5
¤ Carefully read and close any warning boxes that look like important messages.
¤ Be careful while installing free programs, games or shareware. Free programs may contain
spyware.
Preventive Measures Against Viruses
Basic Internet Discipline
1. Don’t open unwanted email and their attachments if source is strange or unknown.
2. Use spam blocking or filtering tools to block unsolicited emails, instant messages and pop-ups.
3. Avoid easy and obvious passwords and change them regularly. Keep passwords safe.
4. Avoid downloading files and programs from untrustworthy web sites.
Protect Your Computer
1. Take regular backup of your important data on a separate external disk.
2. Avoid keeping sensitive data like passwords, credit card details etc. on your computer.
3. Do not let everyone to use your computer.
Use Anti-virus Software
1. Install and use a good anti-virus for regular scanning of your computer.
2. Keep the anti-virus updated regularly to safeguard against new viruses.
Anti-virus Software
An anti-virus software detects the virus threats, scans files for viral infection and removes the
viruses. An anti-virus needs to be installed on the computer to prevent, detect and remove viruses.
It is necessary to update anti-virus at regular intervals of weeks or months to keep it aware of new
threats.
How Anti-virus Works?
An anti-virus detects viruses by their signature or behaviour. A virus signature is the unique
structure of a virus program which anti-viruses are aware of. Anti-viruses have a list of known virus
signatures with which they can identify the possible virus. That is why anti-viruses need regular
updates.
Anti-viruses also detect behaviour of the programs on the computer to detect any unusual action
such as accessing a file which is not meant for them. In case of any suspicious activity, it scans the
program for virus.
Some popular anti-viruses are given here:
59
5
Using an Anti-virus
Let us see how to use one of the popular and powerful anti-viruses -
McAfee.
Scan the Computer for Virus
1. Open McAfee Security Scan Plus from Start menu.
2. Click on Scan. button.
3. Select the type of scan you want to run.
60
5
Spyware or Adware
Spyware installs itself on the computer without user's
knowledge and monitors keystrokes, takes screenshots, reads
chat, collects device and user information and forwards it to
the malicious owners of such program. Loss of confidential
information and identity theft are the threats posed by
spywares.
Protection
¤ Install an effective spyware detecting software.
¤ Keep your operating system and browser updated.
¤ Check if any unnecessary software is being installed. It is often during the installation steps and
in the User Agreement.
¤ Carefully read and close any warning boxes that look like important messages.
¤ Be careful while installing free programs, games or shareware. Free programs may contain
spyware.
Spam
Spam is unsolicited or undesired junk email usually a
promotional material. Senders of such emails are called
spammers. Spams have a link that lures the user into clicking it.
This confirms user's email ID and that brings in more spam in
future.
Protection
¤ Use spam filtering settings in the email service.
¤ Share your personal email ID only with those you trust.
¤ Do not display your email ID online for everyone to access.
¤ Create separate email accounts for public use.
¤ Look out for spelling mistakes and bad grammar in the mail. These mistakes are done by
spammers to pass through the spam filter.
61
5
Protection
¤ Install anti-phishing software.
¤ Never give away any sensitive information related to finance and security like pins, passwords,
bank balance, transaction details, identification numbers etc. in reply to undesired emails and
never on phone.
¤ Always cross check the source of email and phone call with the concerned agency.
¤ Today, all authentic agencies like banks and
merchants have their own secured apps for
transactions. Download and use them on your mobile
phones instead of unknown third- party apps.
¤ Phishers address their targets with fancy terms like
“valued customer” but genuine agency will address
you by your correct name, username, customer ID
etc.
¤ Regularly check your financial statements and account details.
¤ Secured Socket Layer Certification is done for web sites by authorised Certification Authorities
(CA). CAs do not issue SSL certificates to any agency that is not properly identified and
cleared. Check the website's certificate icon of a padlock in the address bar. All secured web
sites have SSL certificates. If padlock icon is of open lock then web site is not secured and must
be left immediately.
¤ Never ignore operating system, anti-virus and browser upgrades. Do them as and when
prompted or required.
¤ Web sites should deploy effective firewalls with suitable settings to keep away unauthorized
access and intrusion. Let us understand what a firewall is and what does it do.
Firewall
A firewall is a security combination of hardware and software that is used to protect a server and
network resources from unauthorized access and intrusion. Firewall checks the incoming data
packets over the networks and filters out which do not have suitable and sufficient permission to
access the network. This way an extra level of protection is created right at the gates of the
network.
62
5
Internet Frauds and Scams
Today we virtually live and shop on Internet. Scammers send
the users tempting newsletters and prompts of getting rich
quick through online gambling, lottery or games alluring them
to click the link. Once you accept the offer they attempt to take
sensitive information like credit card numbers, pins etc.
Protection
¤ Ignore and do not fall for online offers that seem too
exciting to be true.
¤ Ask yourself: Do I really need it? Does it really concern me?
¤ Avoid individuals asking for donations.
¤ Avoid accepting or vouching for any financial transaction with online friends whom you have
never met especially those in known notorious regions of the world.
¤ Avoid charity involvement offers, placement schemes with instant visas, medical claims of
quacks to cure certain disease instantly.
63
5
PART B: Subject Specific Skills
Unit
Digital Documentation
1 (Advanced)
80
5 Digital Documentation (Advanced)
These styles can be seen in Styles and Formatting
window which can be displayed by clicking Style and
Formatting icon on the Sidebar.
Shortcut
To display Styles pane in Sidebar: F11
In this pane, the buttons for each of the style types are
displayed. Click on anyone to list the available styles.
They appear in the same sequence as their names are
listed earlier.
Applying Styles
To apply any style, select the part of the text (heading or paragraph or any text) and double click on the
desired style in the list under corresponding style type. For example, if you have to apply Example style
on some text, then select that text, click on Character style button and double click on Example style.
Shortcut
New Style from Selection:
Shift + F11
81
Digital Documentation (Advanced) 5
Create a New Style Using Drag and Drop
Formatting of a text can be save as a new style using simple drag-drop method. Click on the
desired Style type button on the Style pane in Sidebar. Select the pre-formatted text and drag-
drop it into the pane. Create Style popup appears.
Mention a relevant name of your style and click OK.
Shortcut
Updated Selected Style:
Ctrl + Shift + F11
82
5 Digital Documentation (Advanced)
Inserting Shapes Inserting Images
Drawing Toolbar
Shapes can be drawn and managed using Drawing toolbar in Toolbars under View menu.
Drawing toolbar provides a rich library of a variety of shapes arranged in various categories.
Shapes range from simple forms like Lines, Arrows, Rectangle, Circle to Curves and Polygons, Basic
Shapes (Diamond, Ring, Hexagon, etc.), Symbol shapes (Smiley, Cloud, Flower, etc.), Block Arrows,
Stars and Banners, Callouts, Flowchart, Text Box and FontWork Text.
Block Arrows
Flowchart Fontwork Gallery
83
Digital Documentation (Advanced) 5
Various Ways of Inserting Images
In Writer, images can be inserted in following ways:
1. Import graphics files using Insert menu > Picture > From
File option. (7.1.2.2 & higher versions: Insert > Image)
2. Link image by Insert menu > Picture > Link option or
embed image by breaking the link as Edit menu > Links
option and clicking Break Link button in the Edit Links
dialog box.
3. Scan the image by Insert menu > Picture > Scan option >
Select Source > OK. Then insert the scanned image using
Insert menu > Picture > Scan > Request option.
(7.1.2.2 & higher versions: Insert > Media > Scan >
Request)
4. Insert any copied image from the clipboard by using Edit
menu > Paste Special option.
5. Drag-dropping images in the document with Ctrl key ( images
are embedded in the document as its part.) or, Ctrl+Shift key (a link to the image is inserted
in the document. Actual image is not inserted.)
84
5 Digital Documentation (Advanced)
Drawing Object Properties Toolbar
When a shape or image is selected, the Drawing Object Properties Toolbar can be used to
manage the drawing object in following ways:
¤ Text wrapping: These options determine how the text around the inserted shape or object
should be arranged. There are following ways a text is wrapped around an object:
i. None: The text remains as it is above and below the object.
ii. Parallel: The text flows around the object.
iii. Optimal: Optimal Page Wrap prevents text from being placed to the side of the image if
the spacing between the image and the margin is less than 2 cm.
iv. Before: The object is placed to the right side of the text.
v. After: The object is place to the left side of the text.
vi. Through: The object floats over the text and hides the text.
Fill Color
Area
Style/Filling Note:
When we use the term object, we refer to an
image or shape inserted in the document.
Arrow Style Line Style
85
Digital Documentation (Advanced) 5
¤ Resizing object: To resize an object, select it. 8 handles will appear
around it. Grab any handle with the left mouse click and drag to resize
the object.
¤ Rotating object: The Rotate button on the Drawing Object Toolbar helps in rotarting
and skewing the object. Rotation means turning around the object on its central axis by
holding it with corner handles. Skewing means changing the shape of the object by stretching
it across horizontally or vertically by holding the handles on its margins.
¤ Grouping objects: Multiple shapes and images can be grouped together and ungrouped. To
do so, first select the first object, then pressing and holding down Shift key, select other
objects. This way all the desired objects will be selected. Then click on Group button on
the Drawing Object Properties toolbar.
To ungroup the objects, select the grouped objects and click on Ungroup button on the
Drawing Object Properties toolbar.
Note:
To edit any object which is a part of
an object group, use Enter group
button and to exit, use Exit
Group button on the Drawing
Object Properties tooolbar.
86
5 Digital Documentation (Advanced)
¤ Cropping Image: Cropping is the way to remove unwanted part of the image starting from its
outer edges. To crop the image, select it and click Crop button on the Image toolbar. 8
handles will appear around it. Grab any handle with the left mouse click and drag to inwards
to crop the image.
¤ Image Color Settings: Image colour settings such as brightness, contrast, colour channels can
be changed using Color button in the Image toolbar. In the Color pop-up, apply the
changes as required.
87
Digital Documentation (Advanced) 5
¤ Image Filters: Filters are certain special effects that can be applied on an
image to give it a completely different look. Filter button on the Drawing
toolbar provides various filters
EXERCISE
1. You own a multimedia design company. Write a small introduction of the
company then do the following:
a) Insert a picture depicting about your company.
b) Rotate and Resize the picture.
c) Click on the picture and try Cropping some of its part.
d) Save the file.
2. Create visiting cards of various post holders in your IT Club or school activity
club.
3. Open the document saved in the previous question and do the following:
a) Insert a picture of your school's building in the document.
b) Set its Layout Option to Parallel.
c) Set/move the picture to the right side of the document.
d) Save the file.
4. Make a poster to spread awareness about personal hygiene or environmental care.
5. Collect some images of any occasion or your friends and make a collage.
Finally, group all the images.
6. Create an invitation letter for teachers to a Stage Play students going to
present on teachers' day. Use various shapes in decorating the card.
88
5 Digital Documentation (Advanced)
Session-3 Document Template
A template is a pre-designed and pre-formatted document which can be used to fill in the content as
you need. Template saves time and effort that otherwise goes in designing and formatting the
document manually.
A template saves you time and effort as it contains all the formatting and design already applied in
it. You just need to enter your content and arrange it as you require.
Writer provides a rich library of templates like resume, CV, Modrn, MediaWiki, Simple, etc. Some of
the templates are installed when you install LibreOffice and many more templates can be accessed
online.
Open LibreOffice and select Writer Templates in the Templates drop-down in the left
Options Pane.
A variety of document templates will be listed which can picked up depending on the
requirement.
Creating a Template
You can create your own pre-formatted templates which you can pick and use later to save time
and hard work.
First, create a well formatted document
which you need frequently. For example,
a colourful newsletter.
Then, click on File tab> Save As option.
In the dialog box, enter the name by
which you wish to save the template.
89
Digital Documentation (Advanced) 5
Click on Save as type: drop
down list and select ODF Text
Document template. Finally,
click on Save button.
The Writer template document
will be saved as .ott file.
You can save your template
anywhere or in application
template folder. You can find
the path to the templates by
going to Tools menu >
Options option > LibreOffice
> Paths category.
Note:
To reset back to the default template, click on the Wheel icon at
the left bottom of the Templates dialog box and select Reset
Default Template > Text Document.
90
5 Digital Documentation (Advanced)
Importing a Template
One way is to select a template while creating a new document which we have learnt earlier. The
other way is to import a template of our choice. This can be done by clicking on
Import button at the bottom of the Templates dialog box.
User created template must be saved in one of the folders listed in Tools menu> Options option
> LibreOffice > Paths.
1. In the Templates dialog, click the Import button. The Select Category dialog appears.
2. Select the category where you want to import the template and click OK.
3. In Open dialog box, locate and select the template that you want to import and click Open.
The template appears in the selected category.
Editing template
In the Templates dialog, right-click on the desired template and select Edit. The template opens in
Writer. Edit the template as you need and save it as .ott file.
Updating a document from a changed template
If you have changed a template and if you open a document that was based on that template
earlier then a confirmation message is displayed. You can select Update Styles to apply the
changed styles in the template to the document or Keep Old Styles if you do not want to apply
the changed styles in
the template to the
document.
As shown here, earlier
Sample_Template1.ott
file had blue text and
Sample_Doc1.odt was
based on it. Then
Sample_Template1.ott
was changed to Red
and Green text. Later
when Sample_Doc1.odt
was opened, the
confirmation to update
template styles is
displayed.
Instaliing Online Templates using Extensions
You can install online templates by clicking Extensions button at the bottom of Templates dialog
box. In the popup, click on the link website bedise the desired template. It will take you to the
download page of that template. Download and save the template to use it.
91
Digital Documentation (Advanced) 5
Changing Template Using Template-Changer Extension
Go to
https://extensions.libreoffice.org/en/extensions/show/tem
plate-changer and download the Template Changer
extension. It is a .oxt file. Open it by File > Open in Writer.
The Extension Manager dialog box will appear to install it.
After installation close the dialog box and restart LibreOffice
application.
After that, you can open the document and use File >
Templates > Change template (current document).
Remember that changes made to the templates using Template
Changer are permanent and cannot be undone once saved.
92
5 Digital Documentation (Advanced)
Manually Changing a Template
1. In the Templates dialog, double-click the template you want to use.
2. Delete any unwanted content from it and save the document but keep it opened.
3. Open the document you want to change, select everything (Ctrl+A or Edit > Select All) in
this document and copy (Edit > Copy or Ctrl+C) the contents.
4. Go to the new document created in step 2. Paste (Edit > Paste or Ctrl+V) the contents into
this new document.
5. Save the new document (File > Save).
Now you can discard the old document.
Deleting a Template
Right click on the desired template in Templates dialog box and select Delete.
LAB EXERCISE
1. Using Writer create the document containing following text:
<<Your Name Here>>
INVITE YOU TO
<<name of the event>>
On
<<date>>
At
<<time>>
Venue: <<venue address>>
Looking forward to welcome you at the event.
Thank you.
Now, save the document as template by the name my_invite_template.ott.
2. Using Templates dialog box, import your template in My Templates category.
3. Open this template, create an invitation letter and save it as .odt document.
4. Open your template my_invite_template.ott to edit and make changes in the text
formatting and save it as a different name such as my_invite_template2.ott. Close
LibreOffice then open it again.
5. Now, open your document and confirm if you want to apply new styles or keep the old.
6. Try deactivating and activating the link between your document and the template using
Template Changer extension.
7. Try permanently unlinking the template from your document. (Now, if you make
changes in the template, document will not ask for applying any new styles.)
93
Digital Documentation (Advanced) 5
Session-4 Creating Table of Contents
A table of contents (ToC) contains the numbered list of topics in a document and the page number
on which they are located. In the soft copy of the document, each entry in the ToC functions as an
internal hyperlink to the topic content. User can use Ctrl+Mouse click to jump to the linked topic.
A ToC can be created automatically in any word processor. However, it is always advisable to
update ToC after major changes in the document.
Creating a ToC
The table of content depends on the headings in the document. It is necessary that document
contains adequately defined standard headings such as Heading 1, Heading 2, Heading 3, etc.
To create a quick ToC in the document, first place the cursor where you need the ToC to appear.
Then do the following:
l Go to Insert menu > Table of Contents and Index > Table of Contents, Index or
Bibliography option.
l In the dialog box of similar name,
in Title tab, specify the title of the
table, specify the number of levels
of headings as required.
l Protect against manual
changes checkbox keeps the
table from being modifed like
common text.
l Click OK.
The ToC will be inserted.
94
5 Digital Documentation (Advanced)
Customising a ToC
To customise a ToC, right click on it and select Edit
Index option.
Ÿ In the dialog box, go to Styles tab.
Ÿ Select level in Levels list and a style in
Paragraph Styles list.
Ÿ To change the style, click on Edit button below
the Paragraph Styles list.
Ÿ In Paragraph Styles dialog box, change style such as font colour and click OK.
Ÿ Click on Assign button.
Ÿ Click OK.
95
Digital Documentation (Advanced) 5
Updating a ToC
Table of Content is not updated automatically by Writer if any changes are done in the document.
The ToC needs to be updated manually. To do so, right-click anywhere in the TOC and select
Update Index.
Deleting a ToC
To delete the TOC from a document, right-click anywhere in the TOC and choose Delete Index
Remember that Writer will not confirm the deletion.
EXERCISE
Create a multipage document describing about your school. Keep main title as
My School and some sub headings such as About My School, Academics, Sports,
Staff etc. Apply some styles to all the headings and create a well formatted table
of contents for the document.
96
5 Digital Documentation (Advanced)
Main document: It is the document that contains the content which is common across all the
copies. This is the document whose multiple copies are generated.
Data source: This document contains the variable data such as names of the recipients, address,
city, state, pincode, country, designation, department, etc. These values are arranged as rows or
records in a tabular format and the first row contains the headings of each column. During the
mail merge process, these values are merged with the main document and as many copies as the
number of records merged, are created.
Merged document: This is generated as the output of the mail merge. The values in the Data
source are merged with the Main document to create merged document. User just has to specify
where the merged values should appear in the merged document. The location of merged values
are specified by the help of merged fields. Merged fields are the placeholders which indicate
where the merged values must appear.
Data
source
Main document
97
Digital Documentation (Advanced) 5
The Main Document
Main document is the main letter that can be drafted and saved beforehand or it can be created
new during the process of mail merge. Main document of notice reminder looks like this.
Notice, the missing values after the words To, since, Rs. and the second since. Here, the values will
be inserted (merged) from the data source.
98
5 Digital Documentation (Advanced)
3. Click on Settings button.
Shortcut
View Data Sources: Ctrl+Shift+F4
9. In the Explorer, open the table under the name of your data source. The records of the data
source will be displayed. Click on the fields in the data source and drag-drop them in the
main document where ever required as shown here.
99
Digital Documentation (Advanced) 5
10. In the Mail Merge toolbar, click on
Next Mail Merge Entry button to
see the first merged letter.
LAB EXERCISE
Your school is going to organize annual sports meet. Use mail merge feature as
specified here:
1. Create an invitation letter to invite all the schools of your zone/district to participate in
this event.
2. Create a list of 10 schools that you want to invite.
The fields should be: PRINCIPAL_NAME
SCHOOL_NAME
SCHOOL_ADDRESS
3. Perform mail merge to generate individual letters for each school.
Address Labels
Labels contain the addresses
which can be printed for
mailing purpose. All the labels
may contain same address on
all of them or different address.
Once you have the data source
for labels is ready and
registered with LibreOffice like
you did earlier, you can begin
creating a document containing labels out of it. We are going to use a Writer document
addresses.odt as data source that contains all the data for labels as shown here.
100
5 Digital Documentation (Advanced)
Creating Label Document
1. Go to File menu > New > Labels options. In the
Labels dialog box, do all the settings for the labels. We
shall create multiple labels with different addresses.
2. In Labels tab, selected your registered data source in
Database drop-down and Table 1 as the data table.
101
Digital Documentation (Advanced) 5
At this time if you change the format of any
label and click on Synchronize Labels button
in the Synchronize popup, the format will be
applied to all other labels.
8. Click on Next Mail Merge Entry button
to preview the labels.
9. Click on Edit Individual Document
button. The document with labels will be
displayed.
Note:
Try making the name of one
recipient bold and colourful then
click on Synchronize Labels
button in the Synchronize
popup. Notice that same format is
applied to all the other labels.
LAB EXERCISE
1. Create labels of dimension 4 X 5 inches to paste on the notebooks. Label should
contain your school name and space to write Name, Class, Section and Subject.
2. Create multiple visiting cards on single page for your friend containing a fictitious
company name, Address and Contact Number.
102
5 Digital Documentation (Advanced)
Unit
Electronic Spreadsheet
2 (Advanced)
107
Electronic Spreadsheet (Advanced) 5
LAB EXERCISE
Mr. Rajan has a sheet containing the names of the students, their houses (Red, Green,
Blue, Orange) at school and their score in sports. He wants to calculate number of
students for each house and average score of each house. Help Mr. Rajan.
Data Consolidation
This feature allows you to bring together data from different spreadsheets and workbooks into a
consolidated form where sum or average or other calculations are done on the data values. Let us
see a simple example. Sheets named East Sale and West Sale need to be consolidated as their
average in sheet Average Sale.
LAB EXERCISE
Mrs. Sengupta has English marks of some students for exams Term1, Term2 and PreBoard
in separate sheets by the same names. Help her to consolidate the average marks of the
three exams into a fourth sheet in the same workbook.
What-if Analysis
What-if analysis is a way to do forecast on the basis of assumed but realistic figures. It is the process
that allows to see “what” changes would happen “if ” the data values are changed in a particular
manner. For example. “What” should be the commission “if ” the sale is increased? There are
various ways to perform what-if analysis in electronic spreadsheets such as applying scenarios,
goal-seek etc.
What-if Analysis with Scenario
Scenario is a way to perform what-if analysis. A scenario is defined by a set of values which can be
applied on an existing data-set. The original data-set is substituted by the scenario data-set and user
108
5 Electronic Spreadsheet (Advanced)
can analyse the changes. Various scenarios
can be created and applied on the original
data-set to analysis different situations
predicted in the scenario. This way, user can
analyse different business scenarios by using
Scenario feature.
Creating Scenarios
Let us understand it with the example shown
here. In this example, we shall apply different
scenarios of prices to see the change in the
commissions. The new set of prices are
labelled as NEW PRICE 1 and NEW PRICE 2.
These will be applied to the origirnal prices in
column C.
First, select all the original price values in
range C2:C10.
Go to Tools menu > Scenarios option. In the Create
Scenarios dialog box, mention the name of the scenario
(ORIGINAL PRICE) and click OK.
Repeat this step once more but this time save the scenario
with different name (NEW PRICE 1).
Now, copy-paste the values of NEW PRICE 1 i.e.
A13:A21 on the original range i.e. C2:C10. Now the
second scenario has different values.
Again, select all the values in range C2:C10 and create
yet another scenario (NEW PRICE 2)
Now, copy-paste the values of NEW PRICE 2 i.e.
B13:B21 on the range C2:C10. Now the third scenario
has different values.
Applying Scenarios
As you select different scenarios form the drop-down, you
can observe and analyse the changing values of
Commission.
109
Electronic Spreadsheet (Advanced) 5
LAB EXERCISE
Mr. Ben is investing Rs. 12000 per month with a guaranteed return of 13% on the annual
amount (i.e. 12 * 12000). Create a scenario to help Mr. Ben see the amount he should get
in return after 15 years if he invests Rs. 15000 per month. Also, prepare a scenario to
check what will be the return after 10 years on investing Rs. 12000 per month but at a rate
of 15%. Assume the layout of the data.
So, 98 more sofas (total 298) need to be sold to achieve the goal
of Rs. 2000000 commission.
110
5 Electronic Spreadsheet (Advanced)
LAB EXERCISE
Ravi wants to apply the “cause and effect” on his studies. His exams are approaching and
he has to prepare for 7 subjects. Each subject has 12 chapters to be prepared. He takes 4
hours to prepare one chapter. He studies 6 hours daily. He needs to know, how many
hours does he need to study daily to complete the preparation of all the 7 subjects.
111
Electronic Spreadsheet (Advanced) 5
Ÿ In Limiting Conditions section, one-by-
one select cells C4, C5, C6 and C7 and for
each of them select the Operator as >=
and specify Values as 10000000.
Finally, click on Solve button.
Solver Status popup will show the
calculation being done. You can click on
Continue button to recalculate new figures.
Once satisfied, click on OK.
You can save (Keep Result button) or
discard (Restore Previous button) the
result in Solving Result popup.
Note:
To calculate values as integers you can click on Options
button on Solver dialog box and select Solver engine as
LibreOffice Linear Solver and select Assume variable as
integer option.
Solver engines
Solver engines are based on following algorithms:
DEPS – Evolutionary algorithm best suited for calculating closest approximate result.
SCO – Evolutionary algorithm based on social cognitive optimisation techniques.
In above two, a group of solutions is generated. The best solution is selected by evaluating it against the
input values (changing cells) and output values (objective cell). This is used for complex calculations.
LibreOffice Linear Solver - Good for optimising linear equations.
LibreOffice Swarm Non-Linear Solver - Good for optimising non-linear equations.
112
5 Electronic Spreadsheet (Advanced)
LAB EXERCISE
Consider the sales sheet given here.
The objective is to achieve the
profit of 100000. You need to
manipulate 3 variables: number of
burgers needed to sell (C2), the
price per burger (C3), the cost of
one burger (C6).
The constraints to consider are:
1. The number of burgers sold (C2) should be a whole number (integer).
2. The price of one burger (C3) should not exceed 65.
Notice that cell B3 contains the sales figures of North region in all the sheets names JAN, FEB
and MAR. To calculate the total of these 3 values, you need to mention the name of the sheet,
followed by ! sign and then the cell address B3 in the formula as shown in the sheet QRT1.
=JAN!B3+FEB!B3+MAR!B3
113
Electronic Spreadsheet (Advanced) 5
Referring to Sheets as a Range
If the worksheets are in sequence then they can be referred to as a range of sheets which includes
the name of the first sheet in the range and the name of the last sheet in the range, both separated
by a :
Consider the sheets JAN, FEB and MAR in the previous example. The formula to calculate total
sale of Quarter1 can also be calculated by the formula as shown here: =SUM(JAN:MAR!B3)
Note:
If sequence of first or last sheet is changed then the formula will consider only the sheets in the new range.
For instance, if there are 10 sheets named from sheet1 till sheet10 and formula is:
=SUM(sheet1:sheet10!B3) and if sheet10 is moved before sheet5 then the sequence of sheets
would be sheet1, sheet2, sheet4, sheet10, sheet5, sheet6, sheet7, sheet8, sheet9. In this case,
SUM function will refer to only the sheets sheet1, sheet2, sheet4 and sheet10.
114
5 Electronic Spreadsheet (Advanced)
LAB EXERCISE
1. There are 5 sheets named Class1, Class2, Class3 and Class4. Each sheet contains
average marks of English in cell A1, average marks of Hindi in cell B1 and average
marks of Math in cell C1. Calculate overall average marks in a sheet Class5 of all three
subjects by referring to above cell addresses using + arithmetic operator.
2. Calculate the above using SUM().
3. Create a new worksheet Sheet1 with the names of some countries and their
populations in columns A and B. In column C type the percentage rate at which their
population is increasing (e.g. 5, 3, 10 etc).
In Sheet 2, in column A, display the populations of those countries after 3 years. The
formula for calculating this is: ((Population * Percentage Increase) / 100) * 3.
Notice the common path to both the files: D:\myprojects\project20\reports. This is called Base
address. So, if the source file (that contains the hyperlink) and the linked file are sharing a
common path, then hyperlink can be created by omitting the base (common) path. This is called
relative hyperlinking. Therefore, in above example, relative hyperlink address in summary.ods will
be details\details.ods. When user clicks on a relative hyperlink, application looks for the path
from the current folder onwards and not from the very beginning (root) of the path. In this case,
folder details is always going to be under folder reports so, no matter where you copy folder
reports on any computer the relative path is not going to change.
115
Electronic Spreadsheet (Advanced) 5
Setting up and inserting hyperlinks
¤ G o t o t h e To o l s m e n u >
Options option. In the Options
dialog box, go to Load/Save >
General and check Save URLs
relative to file system and
Save URLs relative to internet
check boxes. Click OK.
¤ To insert a hyperlink into the
spreadsheet do any of these:
¤ Go to the desired cell or select
the desired text. Then, Insert
menu > Hyperlink option,
Or
¤ Click the Insert Hyperlink button on the Standard toolbar.
¤ Drag-drop an item from the Navigator to the desired cell.
¤ Type the target web address or URL or Shortcut
path to the target document at the point To display Insert Hyperlink dialog box : Ctrl + K
where you want to insert the hyperlink.
Hyperlink Dialog Box
Ÿ Internet section: It allows to mention the web (http/https) or file (ftp) url and hyperlink text. For ftp
links, you need to provide username and password to access the ftp service.
Ÿ Document section: It allows to set the path to the target document or part of that document.
You can also insert the mail reference to a mail recipient in Mail section or create a new hyperlinked
document by going to New Document section.
The hyperlink can be inserted as a form button if you select Button option in Form drop-down.
Finally click on Apply or OK button.
116
5 Electronic Spreadsheet (Advanced)
Editing a Hyperlink
To edit a hyperlink, go to the cell that contains the hyperlink and do any of the following:
Ÿ Right click on the hyperlink text and select Edit Hyperlink option in the popup menu.
Ÿ Insert menu > Hyperlink option.
Ÿ Press Ctrl + K.
Removing a Hyperlink
To remove a hyperlink, right click on it and select Remove
Hyperlink option in the popup menu.
Opening a Hyperlink
To open or follow a hyperlink, right click on it and select Open
Hyperlink option in the popup menu. Or, left click with Ctrl
key down.
LAB EXERCISE
Ankita has created a sheet for her team to be filled individually. She created the data
format in Sheet2 of the workbook and mentioned the instructions in Sheet1. In cell A1 of
Sheet1, she needs to create an internal hyperlink to the instructions in Sheet1. Help
Ankita.
117
Electronic Spreadsheet (Advanced) 5
Note:
Use Data menu > Define
Range option to name a
selected data range.
Linking the registered database: Go to View menu > Data Sources option. Registered data
sources will be listed in the Data Source Window. Navigate to the desired database and table in it.
Select the whole table by clicking in top-left blank gray cell. Then, drag-drop the table to the sheet or
click on Data to Text button in the Table Data toolbar.
Update any changes in the data in datasource by selecting the data range in the sheet and using Data
menu > Refresh Range option.
118
5 Electronic Spreadsheet (Advanced)
LAB EXERCISE
A. Open a new worksheet and insert two hyperlinks - one to a document saved on your
computer and the other to a web url.
B. Get a database StudentDB made by your teacher that contains a table named
Student. The table should store First Name, Surname, Date of Birth, Class, Section,
House and Percentage Marks. Import this data in a spreadsheet.
119
Electronic Spreadsheet (Advanced) 5
When you change and save a shared
worksheet, there are following possible
scenarios:
1. If no other user has modified the
sheet meanwhile then it will be
saved.
2. If another user has modified the
sheet then Calc will prompt you to
choose other changes (Keep
Other/ Keep All Others) or your
changes (Keep Mine/Keep All
Mine) in Resolve Conflict dialog
box.
3. If you have already opened the
sheet, the other user will be
displayed the message that the file
is locked for changes and he/she
may save the file later.
LAB EXERCISE
If your lab has computers networked with each other, ask your teacher to have a worksheet
copied on a shared drive which you can access then try editing the sheet at the same time
along with some of your classmates.
120
5 Electronic Spreadsheet (Advanced)
Preparing a sheet before sharing
When multiple users are likely to make changes in a sheet, it is a
good practice to switch on the tracking of changes. This way, the
changes made by anyone in the sheet are visible clearly for
review by others.
To do so, go to Edit menu > Track Changes > Record option.
Shortcut
Switch on Recording Changes: Ctrl + Shift + C
Once the recording of changes in the sheet is on, any changes made in the sheet are recorded.
Changed cells are indicated by red border
with a red dot in top-left corner of the cell.
Cells B4, B6 and C5 are shown as changed
here. As you bring the mouse pointer over
any changed cell, the information appears
in a yellow pop-up.
Reviewing Changes in the Sheet
To review the changes, open the sheet. Go to Edit menu >
Track Changes > Manage option.
121
Electronic Spreadsheet (Advanced) 5
Adding and Reviewing Comments
Instead of making specific changes, users can also suggest changes by adding popup comments to
the cells in the sheet. Calc provides two types of comments - comments on changes and general
comments. Track changes comments are added to the changed cells and appear in the Manage
Changes dialog box while reviewing the sheet but general changes do not.
¤ To add/edit comments on changes in the selected cell, go to Edit menu > Track Changes
> Comment. A comment pop-up appears for the user to enter the comment.
Shortcut
Insert general comments: Ctrl + Alt + C
Formatting Comments
General comments can be formatted like
text and graphics. To format the
comment:
¤ Right click on the cell that contains
the comment and select Show Comment option.
¤ Using buttons in Text Formatting toolbar and Drawing Object
Properties toolbar comment text and comment box can be formatted.
¤ After formatting, right click on the cell and select Hide Comment
option.
122
5 Electronic Spreadsheet (Advanced)
Editing and Deleting Comments
General comments can be edited and deleted by right clicking on the cell
that contains the comment and selecting Edit Comment and Delete
Comment options respectively.
LAB EXERCISE
Practice adding certain changes and comments in a spreadsheet using Track Changes.
Then, exchange spreadsheets with your classmate. Practice accepting/rejecting changes in
the sheet.
123
Electronic Spreadsheet (Advanced) 5
LAB EXERCISE
Create a sheet to store 5 records of your friends names with their marks in 3 subjects. Make a
copy of this sheet. Make some changes in the copy. Also, delete a record so that the copy
has only 4 records. Now, merge the copy to the original sheet. Discuss your observations
with the teacher.
Do not forget to switch on recording of changes in the original file before making its copy.
Recording a Macro
A macro can be recorded by running the macro recorder and performing the desired task to be
automated. Macro recorder records all the steps. Once done, macro recorder is stopped and
macro is saved.
Enabling Macro Recorder: Go to Tools menu > Options option > In Options dialog box,
LibreOffice > Advanced and select Enable macro recording (may be limited) checkbox.
Then, click OK.
124
5 Electronic Spreadsheet (Advanced)
Example: Creating a New Macro to Sort Data
First, open a sheet with some data to sort. Begin macro recording by following the steps explained
before. Select the data and go to Data menu > Sort option. Select the desired field on sort in the
Data Sort dialog box and click OK. After sorting, click on Stop Recording button. Now follow
the steps below to save the macro:
¤ When you stop the macro recording, Basic Macros dialog box opens. Macros are organised
under modules and modules under libraries. By default macros are saved in Module1.
¤ You can create your own module by clicking on New Module button.
¤ In New Module pop-up, enter the relevant name of the module (e.g. Routine_Tasks) and click
OK button.
¤ Mention a relevant name of the macro (e.g. Sort_BallsPlayed) in Macro Name field and click
on Save button.
125
Electronic Spreadsheet (Advanced) 5
¤ Here, go to Keyboard tab and in
Shortcut Keys section, scroll and
select a combination of shortcut keys
e.g., Ctrl+Alt+Shift+B.
¤ In Category tree, expand the tree to
locate and select the module name.
¤ In Functions section, select the desired
macro.
¤ In Keys section, select the shortcut key
displayed
¤ Click OK button.
Now, when you get new data to be sorted,
copy-paste it in the sheet at exact location
of the older data and press the shortcut key
for the macro. Data will be sorted.
Alternatively, you can run the macro by
pressing Run button in Basic Macros
dialog box.
LAB EXERCISE
Assume a blank colourful, formatted layout and record the macro to create it. The fields
are Serial No., Name, Address, Street, City, Pincode, State, Landline No., Mobile Phone
No., WhatsApp No., Email ID, School Name, School Address, School Phone and School
Email ID.
After recording the macro, test it by the help of the shortcut key.
126
5 Electronic Spreadsheet (Advanced)
This will open up the macro program editor window. If you
have recorded any macro earlier in your selected module
then the code of that macro will be displayed by the name of
the macro preceded by the keyword Sub. Sub denotes a
sub-procedure or in simple terms, a macro. A sub block ends with keyword End Sub. Scroll down
in the program editor until cursor comes to end sub. Press Enter key to take a new line. Here, we
shall insert the code for our function named DA as shown here. After completing the code, close
the editor’s window.
127
Electronic Spreadsheet (Advanced) 5
Structure and working of a function: A function must have a unique, relevant, short name in
a module such as DA. The function name is preceded by the keyword Function. A function block
ends by the keyowords End Function.
Any function arguments are mentioned after the function name within parentheses, separated by
comma. E.g., Function DA(basic_salary, da_perc). These arguments hold the values passed to
the function when it is called later. These values are used in the function for processing.
Once all the calculations are done by the function, the result is returned by it. To return the result
of the processing, the result value is assigned to the function name.
Note:
Zero-based indexing is a way to locate items in a collection. Here, first item has index 0,
second has 1 and so on. So, if there are 10 items in a collection then, the index of the last item
will be 9. Hence, by formula it is n - 1 where n is the total count of items in the collection.
Sheets object also has another method getByName(string) which takes the name of the sheet
and returns its reference.
Sheet object: This object refers to the single sheet out of all the sheets in the Sheets object. It has
method getCellByPosition(col, row) that returns the reference to the cell at given column
number and row number. Remember that here also, the column position and row numbers are
zero-based indices. For example,
ThisComponent.Sheets(1).getCellByPosition(0,0)
This is referring to first column, first row i.e. cell A1 in the second sheet (Sheets(1)) in the current
workbook.
128
5 Electronic Spreadsheet (Advanced)
You can also access a cell range by using the method getCellRangeByName(“starting
cell:ending cell”) which returns the reference to the given cell range. For example,
ThisComponent.Sheets(1).getCellRangeByName(“A1:B5”)
Cell Range object: This object refers to a cell range. It has method getData() that returns all the
rows in a range.
Cell object: This object refers to a particular cell in a sheet. It has methods getValue() to retrieve
a number in it; getString() to retrieve text stored in it and getFormula() that returns any formula
stored in the cell.
Functions LBound() and Ubound(): These functions return the index position of the first item
and index of last item in a collection respectively. For example, LBound(Sheets) will return the
position of the first sheet in a collection of sheets while UBound(Sheets) will return the index
position of the last sheet.
Example 1
Here, object ThisComponent is storing reference to the current sheet in user defined object
workbook. It has the collection Sheets which is taken into user defined object sheets. Its index
0 is mentioned to access the first sheet i.e. Sheet1. It is taken into user defined object sheet.
Now, on this sheet object, method getCellByPosition(0,1) is called to access first column i.e. A
and second row i.e. 2 (A2). Reference to cell A2 is created in user defined object cell. On this
object, method getString() is called because this cell contains text value i.e. APPLE. Method
getString() returns string APPLE in user defined variable cell_value. Finally, a function
MsgBox(cell_value) is used to display it in a popup message box.
Example 2
129
Electronic Spreadsheet (Advanced) 5
The returned cell range is stored in user defined reference range. Its method getData() returns
the rows in the range i.e. rows 2, 3, 4, 5 and 6. These rows are stored in user defined collection
rows.
In collection rows, the rows are arranged on zero-based index i.e. row 2 is at
index 0, row 3 at index 1 and so on.
This range has only one column so the column index is 0. Thus, first cell in the
range can be accessed as rows(0)(0), second cell as rows(1)(0) and so on.
Here, first index is row and second index is column. So, all the values are
accessed and their sum is stored in user defined variable total. Its value is
1319. Next, ThisComponent.Sheet(0).getCellByPosition(1,6) returns the
cell B7 (column B at index 1 and row 7 at index 6) into user defined reference
cell. Finally, cell.setValue(total) is storing the value of variable total i.e.
1319 in the cell B7.
For Loop
Loop is a way to execute program statements muliple times as long as we need. When all the
statements within a loop are executed, it runs again and again as long as a condition allows or on
the basis of a counter. For loop is one such loop that runs on the basis of available counts. It is
denoted by For - Next keywords. With For, a counter variable is associated which is set to count
from a lower value to a higher value using the keyword to. Keyword Next increases the value of
counter variable by 1 by default (or, mention the numbers to skip. E.g., Next 3). The syntax of For
loop is:
For counter_variable = start value to end value
statement
statement
statement
statement
Next
130
5 Electronic Spreadsheet (Advanced)
As shown in the example function for_demo(). Here, loop counter is variable
x which is set to start value 0 till the end value 10. This means, the loop will
run 11 times. This loop has two statements which will execute 11 times. In first
iteration of the loop, statement
cell = ThisComponent.Sheets(0).getCellByPosition(5,x)
will access cell F1 (i.e. 5, 0) since value of variable x is 0. Second statement
cell.setValue(x) will store 0 in cell F1. Next, the value of variable x will be 1.
So, its value 1 will be stored in cell F2, then 2 in cell F3 and so on. Finally, cell
F11 will have value 10 and the loop will terminate.
Note:
With for loop, Step keyword can be used to specify a number by which the loop counter
should skip. E.g. For x = 1 to 5 Step 2 means x will count 1, 3 and 5 (skipping by 2).
131
Electronic Spreadsheet (Advanced) 5
¤ Go to Tools menu > Macros > Organize Macros > Basic option.
¤ Select the module under which you need to create macro and click on Edit button.
¤ Type the following code in the macro editor.
LibreOffice Basic language provides two main objects that help in sorting:
SortField object: This object has property Field to specify the field on which the sorting should
be done in the selected range. Field 0 means first column in the selected range and so on. For
sorting on multiple fields, we need to create an array of this object. This object is defined in a
package util which is part of package star under package sun under com. See how it is accessed in
line 3. New keyword is used to create an object of the specified type. Dim keyword is used to
declare a variable or object. So, here, array of 2 objects of SortField by the name sortfields(1) is
created. This array has 2 elements - element 0 and element 1 - one for each of the two fields on
which we have to do sorting. Element 0 will be used for column Class and element 1 for column
Section.
PropertyValue object: This object just needs the reference of SortFields object to apply sorting.
See line 4 how a new array sortdesc(0) of type PropertyValue is created.
Let us now understand rest of the program.
Lines 6 and 7 are familiar. They are used to create an object range_to_sort which refers to the
range B2:C13 in the sheet named Data1.
In Line 8, method select() is passed with the range object range_to_sort to select the range in
the sheet.
132
5 Electronic Spreadsheet (Advanced)
In Lines 10 and 11, properties Field and SortAscending of element 0 of array sortfields are
being set to 0 and TRUE respectively. Value of property Field is 0 that refers to the first column in
the selected range i.e. Class. Property SortAscending is boolean type that can be either set to
TRUE or FALSE - TRUE means sort in ascending order otherwise descending. So, lines 10 and
11 means sort on column Class in ascending order. Similarly, in lines 12 and 13, element 1 refers
to the second column of the selected range i.e. Section and sorting order is set to descending by
setting property SortAscending to FALSE. So, lines 12 and 13 means sort on column Section in
descending order.
Now, the specified sorting settings need to be loaded into object sortdesc of type PropertyValue.
Line 15 has property Name of sortdesc(0) is set to a string “SortFields”. So, lines 10 and 11
means sort on column Class in ascending order. In line 18, finally, the sorting is applied by passing
object array sortdesc() into the method Sort of range object range_to_sort as argument.
LAB EXERCISE
1. Write a macro function SortNames() to sort the names of 10
cities and their population in descending order of cities and
ascending order of population.
2. Consider the given data set. Write macro CalcAvg() to
calculate average marks for each subject in correspoinding
coloured cells.
133
Electronic Spreadsheet (Advanced) 5
Unit
Database
3 Management System
138
5 Database Management System
approach, the data is stored at a central location and is shared among multiple users. Thus, the
main advantage of DBMS is centralization of data.
Advantages of Database Management System
a) The ability to update and retrieve data: This is the fundamental feature of a DBMS.
Without the ability to view or manipulate data, there would be no point to using a database
system. Updating data in a database includes adding new records, deleting existing records
and changing information within a record.
b) Support Concurrent Updates: Concurrent updates occur when multiple users make
updates to the database simultaneously. Supporting concurrent updates is also crucial to
database management as this ensures that updates are made correctly. Otherwise it would
lead to the loss of important data and/or inaccurate data stored.
c) Recovery of Data: DBMS provides ways to backup and recover database. There are times
computers may crash, a fire or other natural disaster may occur, or a user may enter incorrect
information invalidating or making records inconsistent.
d) Security: To prevent unauthorized access to the database, DBMS uses features like
encryption, authentication, authorization and views to provide security to the database.
e) Data Integrity: Data integrity is a set of rules that DBMS provides to see that data incorrect
or inconsistent data is not stored.
f) Controlled data redundancy: During database design, various files are integrated and each
logical data item is stored at central location. This removes replicating the data item in
different files, and ensures consistency and saves the storage space.
g) Data sharing: The data stored in the database can be shared among multiple users or
application programs. Due to shared data, it is possible to integrate new applications without
having to create any additional data or with minimal modification.
h) Ease of application development: The application programmer needs to develop the
application programs according to the users' needs. The other issues like concurrent access,
security, data integrity, etc., are handled by the DBMS itself. This makes the application
development an easier task.
Application Areas of Database System
Database systems support businesses of almost every nature now a days. Some of the most
common database applications are listed here.
Travel Industry: Airlines, railways, hotels and cab industry use online databases for reservation,
room bookings and for displaying the schedule information.
Banking & Finance: Databases are used for storing information such as sales, purchases of stocks
and bonds or data useful for online trading, customers, accounts, loans, and other transactions.
Education: Schools and colleges use databases for course registration, result, and other
information.
E-commerce: Integration of heterogeneous information sources (for example, catalogues) for
business activity such as online shopping, booking of holiday package, consulting a doctor, etc.
Health Care Industry: Databases are used for maintaining the patient health care details.
Digital libraries & publishing: Databases manage bulk text & multimedia data.
Human resources: Organizations use databases for storing information about their employees,
salaries, benefits, taxes, and for generating salary cheques.
139
Database Management System 5
Components of Database Management System
User: Any person who can access the data by using a DBMS is called database user.
Database Administrator: A database administrator is a person who directs or performs all
activities related to maintaining a successful database environment. Responsibilities include
designing, implementing and maintaining the database system, and providing security & training
to employees in database management system.
Application Program: An application program is any program designed to perform a specific
function directly for the user or, in some cases, for another application program or operating system.
Relational Data Model (RDM)
The relational data model is both flexible and natural. This model depicts the storage of data in
symmetrical layouts of tables. tables are the simplest form of organised data. A table stores the data
in rows. Details about any object or event constitute one row. Each data value in a row is identified
a unique label or name. This way, similar data values are found in a single vertical column called
field with a unique name. More than one table together store the data about entire enterprise or
business. These tables are called relations hence the term relational data model. To locate complete
information from the tables, they are linked with each other through common fields.
Properties of relational data model:
Types of Database
Databases are essential for record keeping. You can set up databases with database software
packages, or even spreadsheet applications. Either way, both include options for database tables.
Establishing database tables are a big part of database design, and the number of database tables is
the main contrast between flat file and relational databases.
1. Flat File Database: Flat file is a database with one database table. One single database table
can include all the database's fields.
A single table flat file database can be okay if the database is only a small one with a few
fields. However, some require much larger and more extensive databases with lots of fields.
With lots of multiple fields, some record details can then become duplicated within a single
database table. As such, flat file databases are not ideal for larger database models.
2. Relational Database: Relational databases are more widespread than the flat file database
alternatives. Relational databases break up the single table of flat file database mode.
Relational databases are based on relational data model explained earlier. Links between the
tables are established with primary and foreign keys which are unique identifiers for the
database tables. These links between the database tables are known as relationships and can
be one-to-one, many-to-one or one-to-many. We shall learn about primary and foreign keys in
coming sessions.
140
5 Database Management System
Database Servers
Database servers are dedicated computers that hold the actual databases and run onlythe DBMS
and related software. Typically databases available on the database servers are accessed through
command line or graphic user interface tools referred to as Frontends; database servers are
referred to as Back-ends. Such type of data access is referred to as a client-server model.
LAB EXERCISE
1. Your school library runs on the database of books. Try to find out how your librarian
uses that database.
2. Design the structure of a table BOOK with fields namely: Book_No, Book_Title, Author.
3. Design another table BOOK_ISSUE with the fields namely: Book_No,
Student_Registration_No, Issue_Date, Return_Date.
4. Decide the primary key and foreign key in the above tables and mention the reasons.
Why?
141
Database Management System 5
e. Cardinality: The number of
rows in the table is called its
cardinality. For example, table
STUDENT given below has
cardinality 8 (number of rows).
Query
The purpose of a database is not only to store and accumulate information, but also to ensure
information retrieval according to specific criteria. A query can be used for selection of
information in one or several tables. The result of a query can be displayed in data table, form and
report views; it is possible to specify the table fields to be included.
Form
In databases, it is possible to use forms for
the creation, display and modification of
records. Data entry in a form is visually
easier to understand than in a table, and
is simpler for the user. Forms may contain
fields for data entry, field descriptions
(names), action buttons, menus, pictures,
and design elements.
Report
Reports are formal presentation of data in a particular design and layout. Reports are created using
query or table data. Creating database reports is ideal when you want to:
¤ Reports help in analysing data and take decisions for future plans.
¤ Provide hard-copy printouts for review at a meeting.
¤ Include data from your site in a printed publication.
¤ Mark up the information in your database that needs updating.
142
5 Database Management System
Data types
Data types are used to identify which type of data (value) we are going to store in the database.
Fields themselves can be of different types depending on the data they contain. Data types in
Open Office base is broadly classified into five categories listed below.
• Numeric Types.
• Alphanumeric Types.
• Binary Types.
• Date time.
• Other Variable Types.
Numeric Types
Numeric data types are used for describing numeric values for the field used in the table of a
database. Numeric data types in a database can be using for storing information such as mobile
number, roll number, door number, year of school admission, true or false statements, statistical
values, etc. The different types of numeric data types available are listed here.
¤ BOOLEAN (yes / no): Values as 0 or 1. Example: True or False, Yes or No.
¤ TINYINT (tiny integer): Integer range between 0 and 255
-1
¤ SMALLINT (small integer): Integer range between -215 to +215
-1
¤ INTEGER: Integer range between -231 and + 231
-1
¤ BIGINT (big integer): Range between -263 to + 263
¤ NUMERIC: Maximum precision of e(+/-)231
¤ DECIMAL: Maximum precision of e(+/-)231
-1074 -52 1023
¤ REAL: 2 to (2-2 )* 2
-1074 -52 1023
¤ FLOAT: 2 to (2-2 )* 2
-1074
¤ DOUBLE: 2 to (2-2-52)* 21023
Alphanumeric Types
¤ LONGVARCHAR or memo: Stores up to the max length or number indicated by user. It
accepts any UTF 8 character.
¤ CHAR text (fix): Stores exactly the length specified by user. Pads with trailing spaces for
shorter strings. Accepts any UTF 8 Character.
¤ VARCHAR (text): Stores up to the specified length. No padding (Same as long var char).
¤ VARCHAR_IGNORECASE (text): Stores up the specified length. Comparisons are not case
sensitive but stores capitals as you type them.
Binary Types
Binary data types are used for storing data in binary formats. Binary data types in a database can
be using for storing photos, music files, etc. In general, files of any format can be stored using the
binary data type. The different types of binary data types available are listed here.
¤ LONGVARBINARY (image): Stores any array of bytes (images, sounds, etc.). No validation
required.
¤ BINARY (fix): Stores any array of bytes. No validation required.
¤ VARBINARY: Stores any array of bytes. No validation required.
143
Database Management System 5
Date time
Date time data types are used for describing date and time values for the field used in the table of
a database. Date time data types in a database can be using for storing information such as date of
birth, date of admission, date of product sale, etc. The different types of date time data types
available are listed here.
¤ Date stores month, day and year information 1/1/99 to 1/1/9999.
¤ Time stores hour, minute and second info Seconds since 1/1/1970.
¤ Timestamp stores date and time information.
Database Keys
Each table has a set of attributes and values of each attribute are different from each other in the
form of data types. Each table has a number of rows that represent to a single record. So how do
databases keep all of these records straight? It's through the use of keys.
Primary Key
Primary key uniquely identifies each record in the table. Primary key consists of a single attribute or
multiple attributes in a combination.
Properties of Primary Key
a) It must have a non-null value for each instance of the entity.
b) The value must be unique for each instance of the entity.
c) The value must not change or become null during the life of each entity.
Foreign Key
The foreign key refers to a referencing
key present in child table to a matching
value in a column in another table
(parent). It cannot contain the values
other than that column. It can contain the
duplicate values also.
Candidate Key
In some instances, an entity will have more than one attribute that can serve as a primary key. Any
key or minimum set of keys that could be a primary key is called a candidate key. Once candidate
keys are identified, choose one and only one primary key for each entity.
Let's assume that for each employee in an organization there are three candidate keys: Employee's
ID, Social Security Number and Insurance Policy No. So you can choose only one column as a
primary key.
Properties of Candidate Key are same as of Primary Key.
144
5 Database Management System
Alternate Key
The Candidate Key, which is not chosen as a Primary Key is known as Alternate Key.
Let's assume that for each employee in an organization there are three candidate keys:
“Employee's ID”, “Social Security Number” and “Insurance Policy No. that serve as unique
identifiers in the given table.
If for example “Emp_Id” was chosen as Primary Key then “Social_Security_No” and
“Insurance_Policy_No” would become the alternate key.
Combination of “Emp_Id”, “Social_Security_No” and “Insurance_Policy_No” is known as Candidate Key.
Composite primary key
There are certain cases where a single field may not qualify to become a primary key then unique
combination of more than one key can be considered as a primary key. Such fields which together
function as primary key are called composite primary key fields.
LAB EXERCISE
1. Go to a grocery shop in your neighbourhood and analyse that if you create a table to
store the details of all the items in that shop then what will be the data types of each
field in the table. Justify your choice of data type.
2. Which type of data should be suitable for the fields Phone_Number and Pin_Code?
Justify your answer.
3. Why does database have a variety of data types?
4. How is a form different from a report? Give example.
5. Why table is the most important object of a database?
6. List 2 basic differences between primary key and foreign key.
146
5 Database Management System
4. Click Next.
5. Keep the option to Yes, register the database
for me and Open the database for editing
selected.
6. Click Finish.
7. In the Save As dialog box, select the desired
location for the database and enter the name of
the database file. Note that, LibreOffice database
file has the extension ODB.
8. Click on Save button.
LAB EXERCISE
Create a database in LibreOffice Base by the name Library.
147
Database Management System 5
Transaction Table : Sales
As shown here, one by one, type the name of the field, select the field type. For currently selected
field, properties of that field are displayed in the Field Properties pane at the bottom.
Some common field properties are as below:
148
5 Database Management System
Entry required: If Yes, it means that data entry in this field is mandatory. Such fields cannot be
left blank. For example, in the Item table above, all fields are mandatory for data entry.
Length: Refers to maximum number of letters allowed in a text field. For numeric field, the length
refers to the number of digits entered. E.g., 6 means values from 0 to 999999.
Default value: A value can be defined in this property which will be taken if user does not enter
any value. For example, in the garments shop, mostly the size is 32. So, a default value of 32 can
be set for the field that is going to store the size (E.g., Item_Size).
Decimal places: Number of places after decimal for numeric and monitory values.
Format example: Specifies formats of dates, time, currencies etc. You will learn about them in a
later session.
The field property settings for each field are given below:
Field Name Property Settings
ITEM_CODE
ITEM_NAME
ITEM_SIZE
ITEM_TYPE
PRICE
149
Database Management System 5
Setting the Primary Key
We know that primary key uniquely identifies a record on a table. If none of the fields (alone or
combined) qualify for primary key then you can provide an additional field to do so. Here, such
primary key field id ITEM_CODE. To set a field as Primary Key, in the Design View, right click on
the left hand side gray area showing a green arrow beside the desired field and select Primary
Key option from the context menu.
Notice that an icon of a key is displayed beside the primary key field now where you had right clicked.
Note:
If you try saving the table without setting any primary key, database will
display a prompt warning you of the same and lets you decide what
action you would like to take further.
150
5 Database Management System
LAB EXERCISE
Create database FLORAL GARMENTS and create table Item. Then, create table Sales as
shown here. TRANSACTION_ID is primary key in Sales table.
151
Database Management System 5
2. In the Table Wizard, select a sample
table and add desired fields. Click Next
button.
152
5 Database Management System
After the table is created, you can right click on its name and select Edit option to open it in
Design View. Here, select the field BeginTime and click on the browse (...) button of the property
Format example. In the Field Format dialog box, select Category Time and select desired time
format. Click OK. This way, you can change the formats of other fields too such as StartDate,
EndDate and EndTime etc.
LAB EXERCISE
Open database Library created earlier and create table Book with following
fields:
Field Name Field Type Size Decimal Places Other details
BookID Number 4 None Primary Key
Title Varchar 100 None
Author Varchar 100 None
Publisher Varchar 100 None
Price Decimal 4 2
Copies Number 3
153
Database Management System 5
CREATE TABLE <table name>
(
<field name> <data type> <constraint>,
<field name> <data type> <constraint>,
<field name> <data type> <constraint>,
<field name> <data type> <constraint>
);
154
5 Database Management System
Some common examples of field definitions with constraints in SQL
GuestID int GENERATED BY DEFAULT AS This is an auto-increment field with
IDENTITY unique values.
Refund BOOLEAN default ‘Yes’ This will store either Yes (or 1) or,
No (or 0).
Create table Invitation (EventID integer foreign key EventID of table Invitation points to
(EventID) references "School_Events"("EventID") the primary key field EventID of
table School_Events.
Create table Voter(age int, check(age >=18)) Check constraint validating applies
if age of the voter is 18 or more.
155
Database Management System 5
LAB EXERCISE
A. Delete the table Book created earlier and create it by giving SQL command.
Then, fill the following data in it as shown here.
BookID Title Author Publisher Price Copies
------------------------------------------------------------------------------------------------------------------------------
100 Eye of the Needle Ken Follet Rupa 545 5
101 The Firm John Grisham DigiMedia 399 2
102 The Third Twin Ken Follet Rupa 400 2
103 Clear and Present Danger Tom Clancy Rupa 760 1
104 The Innocent Man John Grisham DigiMedia 324 3
105 The Hunt for Red October Tom Clancy DigiMedia 575 2
Apply following constraints:
¤ Book ID is primary key.
¤ Title should be unique.
¤ Title, author and publisher cannot be blank.
¤ Price should not be 0.
¤ Copies should be by default 2.
B. Create a table Employee to store Employee code (PK), Employee Name, Date
of birth, date of joining, basic salary, gender and city of posting.
¤ Add a field Contact_Number Varchar(15).
¤ Rename the fields for Employee code and employee name to emp_code and
emp_name.
¤ Add a constraint to basic salary to check that it should be at least 1000.
¤ Set default date of joining as today’s date.
¤ Rename the table to Employee_Master.
156
5 Database Management System
To sort the data on the basis of any field, select the field and click on Sort Ascending or Sort
Descending buttons on Table Data toolbar.
To delete a record, simply select it and select Delete Record option in Edit menu.
157
Database Management System 5
Session-6 Relationships and Referential Integrity
Real life databases store the data in more than one table for easier management of data. The tables
are related on the basis of primary key fields and foreign keys to retrieve the data from them.
Managing data in multiple tables raises the need of maintaining accurate and consistent data. For
example, if a business deals in selling 5 items then in sales table no record for a non-existent item
should be accepted or if a record in parent table is deleted then the related records in child tables
should also be deleted. This concept is called referential integrity.
Referential Integrity
Referential integrity is the concept to ensure that accurate and consistent data is maintained in the
database tables which are related.
In Base, referential integrity addresses following 3 aspects:
a. Value entered in foreign key in child table must match a primary key value in the parent table.
b. Any update in the key of the parent table will automatically update the matching values in
child table. This is called Update cascade.
c. Any delete operation on a record in the parent table will automatically delete the matching
records in child table. This is called Delete cascade.
Types of Relationship
Relationships between the two tables can be of 3 types:
1. One to many 2. One to one 3. Many to many
One to Many Relationship: This means one record in one table has many matching records in the
other related table. One is denoted by number 1 and Many is denoted by infinite (∞) sign.
For example, an author can write many books.
Author
1
writes ∞ Book
One to One Relationship: This means one record in one table has exactly one matching record
in the other related table. For example, in a school library, one book can be issued to a student at
a time.
1 can be 1
Book issued to Student
Many to Many Relationship: This means multiple records in one table have many matching
records in the other related table. For example, in a college, many students are pursuing many
courses.
∞ can ∞
Student pursue Course
158
5 Database Management System
Steps to Set up Relationship Between the Tables
1. In Tools menu, click Relationships option.
2. In the Add Tables popup, select the tables and click Add
button one-by-one to add desired tables to Relationship
Design View.
3. In the table structures, drag desired matching field from one table and drop it to the matching
field of the other. The relationship is established and denoted by a thread.
159
Database Management System 5
5. In Relations popup, specify desired update and
delete options and click OK. Here, Update cascade
and Delete cascade are selected.
Below, in the table Sales, Item_Code J015 does not exist in related table Item, so an Integrity
constraint violation error is displayed indicating J015 is not found in parent table.
LAB EXERCISE
Create a master table Furniture to store FurnitureID, Furniture Name and Furniture
Price. Create another table Sales table to store FurnitureID, SaleDate and SaleQuantity.
Relate the two tables so that for any update and delete in table Furniture, update
cascade and Delete cascade occur in Sales table.
Test the relationship by entering sample data and performing updates and deletions.
160
5 Database Management System
Create query using Query Wizard
To create query using Query Wizard, following are the steps by example.
161
Database Management System 5
4. Specify the search conditions
such as price smaller than
1000.
Match all of the following
option filters records that
satisfy all of the multiple
conditions.
Match any of the following
option filters records that
satisfy any of the multiple
conditions.
Click Next button.
162
5 Database Management System
7. Specify a relevant name to the query.
Click Finish button.
The query will be created by the
specified name. You can double click
on the name to run the query and
display the output of the query.
Fo example, the result of the query
Item_with_price_1K_or_less is sown
here.
LAB EXERCISE
Create a master table Furniture to store FurnitureID, Furniture Name and Furniture
Price. Create another table Sales table to store FurnitureID, SaleDate and SaleQuantity.
Create a query to display the names of those furniture items whose quantity more than
100 is sold before January 1. Enter some sample data that matches the criteria.
163
Database Management System 5
2. From the table structure (field list),
drag-drop desired fields which
you need to show in the query
output into the Field section.
Alias is display name of the field
which can be changed optionally.
Specify sort order in the Sort
section exactly below the desired
field.
In Visible section, uncheck the
boxes for the fields you do not
need to show on the query result.
In Criterion section, specify the
record filter criteria.
Once done, close query design
and save the query with a relevant
name.
Note:
It is possible sometimes that none of the records in the table satisfy any of the criteria given in
the query. In this case, query will show zero records or blank output.
BETWEEN Operator
Between operator is used to specify a range of numeric or date values. For example, for a field
named age the range of age from 25 to 60 can be specified as Between 25 and 60.
164
5 Database Management System
LAB EXERCISE
Create a master table Furniture to store FurnitureID, Furniture Name and Furniture
Price. Create another table Sales table to store FurnitureID, SaleDate and SaleQuantity.
Create a query to display the names and SaleDate of those furniture items whose quantity
between 10 and 50 is sold on Feb 5. Enter some sample data that matches the criteria.
Wildcards
Wildcards are a shortcut way to specify value patterns that are shared by multiple values in a table.
For example, you may need to display the records of all the students whose names begin with
letter 'R' or those having letters 'sh' in their names. Or, you may need to list records of those student
whose names have exactly 5 letters.
To specify wildcard patterns, LIKE operator is used. There are 2 wildcards: * and ?.
* : This symbol means any number of occurrences of any letter.
? : This symbol means exactly one letter.
Other example are LIKE 'D*' means values starting with letter D, LIKE ‘*N’ means values ending
with letter N.
165
Database Management System 5
LAB EXERCISE
Create a master table Furniture to store FurnitureID, Furniture Name and Furniture
Price. Create another table Sales table to store FurnitureID, SaleDate and SaleQuantity.
Create a query to display the following:
i. All the details of furniture items who have exactly 5 letters in their name.
ii. All the details of furniture items whose names contain letter ‘A’.
iii. All the details of furniture items whose names begin with letter ‘T’ and letter ‘E’.
iv. All the details of furniture items whose names either contain letter ‘H’ or ‘P’.
Perform calculations
Queries can store formulas based on the fields to perform calculations. When query executes, the
formula is executed and displayed as an additional field but it is not saved in the table. Such fields are
called calculated fields. To perform calculations in a query, in Design View, these are the steps:
In the Field section, specify the formula. Enter an Alias name for the formula. For example, if
table Item has field PRICE and table Sales has field QTY_SOLD then the sale_value can be
calculated as PRICE * QTY_SOLD in Field section. Another example is to calculate discount of
10% on PRICE as PRICE * 0.10.
Let us calculate sale_value as Item.PRICE * Sales.QTY_SOLD.
.One more scenario could be where we wish to know how many days before an item was sold. To
calculate differences between dates, DateDiff() is used. It takes 3 arguments:
First argument is a defined value for taking difference on the basis of year, month or day.
Smaller or earlier date.
Larger or later date.
For example,
DATEDIFF(‘DAY’, SALE_DATE, TODAY) takes difference of ‘days’ between current system
date and sale_date values. Note that in Alias section, the name of the calculated field is
mentioned as DAYS_SOLD_BEFORE. If we assume that current system date is October 30, 2022
then the output of the query is given here.
166
5 Database Management System
Difference of days taken on 30/10/22 between TODAY and
SALE_DATE displayed as alias DAYS_SOLD_BEFORE
LAB EXERCISE
Create a master table Furniture to store FurnitureID, Furniture Name and Furniture
Price. Create another table Sales table to store FurnitureID, SaleDate and SaleQuantity.
Create a query to calculate and display Sale Amount by multiplying SaleQuantity with
Furniture Price. [Hint: Precede field name with table name such as Furniture.Price *
Sales.SaleQuantity]
Grouping data
Many times it is required that calculations are done on the basis of a data group. For example,
calculating total price of JEANS and JACKETS separately, or calculating average price sale qualityt
of all items, or calculating total of sale made in each region, or counting how may employees are
there in each department.
To do so, in query design, we need to select keyword Group in the
Function section of that field which is used for grouping. Then, we
select suitable aggregate function in the Function section of that
field on which calculation needs to be done. COUNT, SUM,
AVERAGE etc. are aggregate functions because they perform
calculation on a group of multiple values.
In the example given here, garments are grouped on the basis of
item names (JACKET, JEANS) and SUM function is applied on the
field PRICE. Thus, total prices of jeans and jackets will be
displayed. Compare the output with table data. TOTAL_VALUE is
the Alias name given to the calculated field.
167
Database Management System 5
LAB EXERCISE
Create a master table Furniture to store FurnitureID, Furniture Name, Furniture Material
and Furniture Price. Furniture Material can be Wood, Plastic or Metal. Create another
table Sales table to store FurnitureID, SaleDate and SaleQuantity.
i. Create a query to display total furniture price Furniture-Material-wise.
ii. Create a query to display total sale amount (price * sale quantity) Furniture-Material-
wise.
Editing query
To edit the query, right click on it and select Edit option.
Select Create query in SQL view option in the tasks of Query object. In SQL View, type:
SELECT *from Item;. Press F5 or Run SQL command directly button in SQL toolbar.
168
5 Database Management System
The interface with the SQL
statement and with the output
will look like this:
Note:
SQL is not case sensitive in typing the commands but field
names should be typed in exact the case they have been
created in the table.
Note:
1. Text values in condition should be enclosed in single quote, not double quotes.
2. Data value are compared with case sensitivity. Here, JEANS will not match with 'jeans' or 'Jeans' etc.
169
Database Management System 5
Sorting Output
Output of the query result can be sorted in ascending or descending order,on the basis of one or
more fields.
Let us display the output of above SQL
statement in the descending order of price.
Select ITEM_NAME, ITEM_SIZE,
ITEM_TYPE, PRICE
from Item
where PRICE > 800
order by PRICE Desc
Note:
Default sort order is ascending (keyword Asc)
170
5 Database Management System
Following SQL statement displays price after discount along with all item details.
Select Item.*, PRICE * 0.1 as DISCOUNT, PRICE - (PRICE * 0.1) as
PRICE_AFTER_DISCOUNT
from Item
Here, notice Item.* in select command. Here, dot (.) is used as an operator to specify * as all the
fields in the table named Item. This is necessary here because * is also used as arithmetic operator
for multiplication in the formulas. Item.* tells the application that this * is not arithmetic operator.
Assuming that a table Marks has fields eng, math and IT which store marks in the corresponding
subjects out of 100. Then total marks can be calculated using + operator with field names to be added:
Select (eng + math + IT) as total
from Marks
This way, using arithmetic operators, calculations can be performed on the fields by creating a formula
depending on the requirements.
Applying Aggregate Functions on the Fields
Sometimes we need to perform calculations on a
set of values in a field. For example, calculating total
price of all the items. This is done by using built-in
aggregate functions. They are called aggregate
functions because they perform calculations on a
set of values at a time. See these examples. SUM() applied on field PRICE
171
Database Management System 5
Here, SUM() is returning the total of all values in the field PRICE. Aggregate functions have a set of
parentheses in which the name of the field is passed.
Here, group by clause is used to
calculate SUM of PRICE on unique
values in the field ITEM_NAME (i.e.
JEANS and JACKET).
Some common aggregate
functions are SUM, AVG, MAX,
MIN and COUNT
SUM of PRICE grouped on ITEM_NAME
Note:
1. The table name should be in double quotes.
2. The sequence of fields and that of values should
be same.
3. Non numeric values need to be enclosed in
single quotes.
Deleting Records
Deleting records is a very sensitive issue and should be dealt with care. Always consider before hitting
Execute button if you really need to delete the intended records. Delete statement should generally have
some condition associated with it otherwise all the records in the table will be deleted.
172
5 Database Management System
The syntax of Delete statement is:
Delete from <table name>
Where <criteria>
Let us delete all the items which have price less than 700.
Delete from “Item” where PRICE < 700;
Updating Records
Updating records is a also very sensitive issue and should be dealt with care. Always consider before
hitting Execute button if you really need to update the intended records. Update statement should
generally have some condition associated with it otherwise all the records in the table will be
updated with the given same value.
Update is used to make changes in the data values of existing records.
The syntax for update statement is:
Update “<table name>”
Set “<field_name>” = '<value> or <formula>'
Where <criteria>
Let us increase the price of STRETCH type jeans by 5%.
update "Item"
set "PRICE" = PRICE + (PRICE * 0.05)
where "ITEM_TYPE"='STRETCH';
LAB EXERCISE
A. Table Book is given here.
Book ID Title Author Publisher Price Copies
------------------------------------------------------------------------------------------------------------------------------------
100 Eye of the Needle Ken Follet Rupa 545 5
101 The Firm John Grisham DigiMedia 399 2
102 The Third Twin Ken Follet Rupa 400 2
103 Clear and Present Danger Tom Clancy Rupa 760 1
104 The Innocent Man John Grisham DigiMedia 324 3
105 The Hunt for Red October Tom Clancy DigiMedia 575 2
To work on the table Book issue SQL commands to find out the following:
1. List all the details of all the books.
173
Database Management System 5
2. Display title, publisher and price of all the books.
3. Display title, author and price of all the books whose price is less than 400.
4. Who are the authors whom 'Rupa' publication has published?
5. What are the prices of the books written by ‘Tom Clancy’?
6. List details of all the books in descending order of Price.
7. Display the names of the authors with book titles in ascending order of Price.
8. Refer to question 4 and display the output sorted on Book Title.
9. Which books and their authors are published by 'DigiMedia'?
10.What are the titles and prices of books whose more than 2 copies are there in
library.
11. Who has written which books cheaper than 300.
12. Here, BookID is primary key. Why not any other field is considered as primary
key? Explain briefly.
B. Change the price of Book number 5 to 430.
C. Delete the all the book which are priced higher than 400.
D. Deleted the books which have just 1 copy in the library.
E. Write the SQL Statement to create the table Tea as described below.
Tea_Code A number to identify each tea flavour
Tea_Flavour Stores name of the flavour such as Ginger, Lemon, Honey etc.
Size Size is Large, Medium, Small
Sugar_Type Sugar, Sugar free
Price A value with two decimal places
In the above table, which field should be the primary key and why?
F. Write the SQL Statement to create the table Flight as described below.
Sector For example, KOL-DEL, DEL-BAN, CHN-DEL etc.
Date Date of flight
Day1 3 letter weekday name
Day2 3 letter weekday name
Day3 3 letter weekday name
Capacity number of seats
In the above table, which field should be the primary key? Why?/Why not? Suggest a
remedy also if why not.
174
5 Database Management System
Creating Form with Form Wizard
A form can be created in two ways - Using Form Design
View and Using Form Wizard.
Here, we shall learn to use Form Wizard.
175
Database Management System 5
d) Select the data entry mode either to
enter only new records and not to
display the records already entered in
the table or to display all the records.
Here, you can also select to disallow
modification and deletion of existing
data and entry of new data. Let us
select to display all data with every
action allowed. Then, click Next.
176
5 Database Management System
Navigating Form and Searching Records
Once form is opened in the working mode, you can use the Previous/ Next/ First/ Last Record buttons
in the Form Navigation toolbar. If it is not visible, select it from Toolbars submenu under View
menu.
Short cut
Previous Record: Ctrl + Alt + Left arrow Next Record: Ctrl + Alt + Right arrow
First Record: Ctrl + Alt + Home Last Record: Ctrl + Alt + End
To skip to a blank record for entering new data values, click on New Record button on this
toolbar.
LAB EXERCISE
A. For table Book created in previous session create:
1. A form named View_Books only to view the records.
2. A form named Add_Books only to add records of new books in the table. Delete
and update should not be allowed through this form.
3. A form named Modify_Books only to modify existing records of books in the
table. New entry and delete should not be allowed through this form.
B. Open these three forms and test if they are working as desired.
177
Database Management System 5
Editing Form
Once a form is created using wizard, to edit it, right click on it and select Edit. The form will open
in Form Design View. Using design view, a new form can also be created from scratch. Form
contains 3 types of controls:
Data Controls: These controls are bound with a field in the concerned table and they
display the data value of that field.
Calculated Controls: These controls store formulas and functions for calculations. They
are not bound with any field in the table.
Design Controls: These controls are used in giving desired
look to the form and to organise controls over the form. For
example, line, rectangle, group box etc.
To open a form for editing, right click on the name of the form and select
Edit option.
178
5 Database Management System
Setting Properties of the Controls
Binding a control with a field in a table
¤ In the Form Properties box, Content property of a control allows to select the desired table,
query or SQL command whose data that control should display. To select the desired table,
you must select Table in its Content type property.
¤ Once table is selected, right click on the control and select Control Properties. Here, go to
Data tab and select the desired field in the Data field property drop-down.
179
Database Management System 5
General Control Properties
Right click on the desired control and select Control Properties. In the properties box, various
properties are there.
General Properties
¤ Name: Unique name given to the control.
¤ Enabled (Yes/No): If no, disables the control.
¤ Visible (Yes/No): If no, hides the control.
¤ Background color: Sets backgorund colour of the control.
¤ Border: Sets border to flat or 3D look.
¤ Max text length: Sets maximum number of characters to enter in a Text Box.
¤ Text type: Single or multi-line text.
¤ Password character: Character to display in place of letters in a password text box.
Changing a Label Background
Right click on the Label control and select
Control Properties. In the properties box, go
to General tab. Scroll down to Background
color property drop-down and select the
desired colour from the colour box as shown
here.
180
5 Database Management System
LAB EXERCISE
Create a master table Furniture to store FurnitureID, Furniture Name, Furniture Material,
Furniture Price and Out of Stock. Furniture Material can be Wood, Plastic or Metal. Design
a new Form using Form Design View. Keep FurnitureID non editable assuming that it is an
autoincrement value. Furniture Material should be a List Box. Out of Stock should be a
Check Box, checked means Yes otherwise No.
At the top of the form display a big title: FURNITURE DATA ENTRY SCREEN
Perform some colour and font settings also on the controls to make the form look formally
appealing.
181
Database Management System 5
If you don't want to group the data, you don't need to group headers or footers. However, make
sure that your reports contain enough information to make them meaningful and easy to
understand.
Creating Report
1. Click on the category Reports in Database pane and select
Use Wizard to Create Report… option in the Tasks pane.
182
5 Database Management System
5. You can sort the report output on
the basis of one or more fields.
Select the fields on which report
data should be sorted in ascending
or descending order. Here, data is
sorted in ascending order of
ITEM_NAME, ITEM_TYPE and
PRICE. Click Next.
Another sample report is shown here. Its header has title, details section has report data. The
report is grouped on item type and sorted on item name, size and price.
183
Database Management System 5
LAB EXERCISE
A. Create a report named FURNITURE SALES listing FurnitureID, Furniture
Name, Furniture Material, Furniture Price, Sale Quantity and Sale Amount
as Price * Quantity. You need to create a query on which report must be
created. Give the alias name SALE AMOUNT to the calculated field Price *
Quantity.
B. Practice creating various reports on the tables created in earlier sessions.
C. Practice Section D of Assessment in lab.
184
5 Database Management System
Unit
Web Applications
4 and Security
190
5 Web Applications and Security
by the computer with the currently active key. For example, if user has pressed Window key on the
keyboard then it will remain active. Now, if user clicks only letter E then it will ne interpreted as
Windows+E and Windows Explorer will open up.
Once enabled, sticky keys icon will appear in the system tray.
Turn on Toggle Keys checkbox allows user to hear an alert sound every time a key like caps lock,
num lock etc. is pressed.
Turn on Filter Keys check box, when selected, makes keyboard ignore rapidly repeated or long
pressed key to avoid repeated typing of the same key thereby helping people who type with
trembling hand.
Text or Visual Alternatives to Sound
People with hearing impairment have great use to this feature where they can see the visual
feedback or cues on the screen instead of sound.
Click on Use text or visual alternatives for sounds in Ease of Access Center.
or Turn on visual notifications for
sounds (Sound Sentry) option replaces
system sounds with visual warnings like
flashing caption bar of active window,
flashing the active window itself and flash
desktop. Select the desired visual warning.
Any sound that reads the screen can be
turned into text caption that appear on the
screen by checking Turn on text
captions for spoken dialog checkbox.
Make the Computer Easier to See
In Ease of Access Center, click Make the computer easier to see link.
Choose a High Contrast Theme: Select the option to turn high contrast on/ off by pressing left
Shift + left Alt and Print Screen keys. This lets visually challenged people see screen
comparatively clearly.
Turn on Narrator option allows read aloud of any text on
the screen and Turn on Audio Description option lets
visually impaired person hear descriptions of what is
happening in any videos.
Turn on Magnifier option lets user move mouse pointer
on the screen and see the objects larger in size. This mode is
called lens mode. In docked mode a portion of the screen
can be left magnified and rest of the screen remains normal.
This portion can be changed as required. Full screen
mode magnifies whole screen. Lens size, focus area, zoom
level etc. can be set by the user.
Set the thickness of the blinking cursor option makes
blinking cursor thicker and larger to see them easily.
191
Web Applications and Security 5
Make the Mouse Easier to Use
In Ease of Access Center, click Make the mouse keys
easier to use link.
Here, you can change the colour and size of mouse
pointers. You can turn on mouse keys of numeric keypad.
You can set option to activate any window just by bringing
mouse pointer over it instead of having to click it.
LAB EXERCISE
1. Enable mouse keys on numeric keypad and test them to move mouse pointer on
screen. Try opening a file using it.
2. Enable sticky keys then open any word processor and type some text. Now press Ctrl
key and leave it. Then press other keys like A, C followed by V, P and observe what
happens. These letters must make combination of command shortcuts Ctrl+A,
Ctrl+C, Ctrl+V and Ctrl+P.
3. Open notepad and turn on Filter Key option. Now practice typing letters with brief
pauses. Observe how the repeated strokes of same letter are ignored.
4. Enable toggle keys option and test them by pressing them on the keyboard.
5. Turn on Sound Sentry and open notepad. In notepad open Print dialog box and then
try clicking in the notepad. Observe how it gives visual warning.
6. Try out various settings of Magnifier and see how screen looks like in various modes
of magnifier.
7. Try out mouse ease of access options by changing cursor colours and size.
192
5 Web Applications and Security
Note:
Universal Access can also be opened by pressing Super key to switch to Activities Overview mode
and typing Accessibility.
Seeing
This section provides visual settings such as
contrast settings, text size, zoom, enabling screen
reader and sounds for keys like Num and Caps
lock. User can set the screen contrast and text size
as needed. User can enable/disable zoom feature.
Hearing
This section allows the user to set up a visual
indicator on the screen when system produces a
sound alert. Users with hearing impairment may
not hear the sound so they can see the flashing
Title bar of the opened window or entire screen
flashes. User can select a suitable option.
Typing
This section allows the user to
enable/disable onscreen keyboard
Typing Assistant for touch screens,
Sticky keys that allow user to keep the
modifier key (Shift, Ctrl etc.) active
when it is pressed, Slow keys which
allow setting up a time delay between
the key press and its acceptance by the
computer. This is good for elderly
person or anyone who tends to have
slower typing speed and Bounce keys
that set up the delay between the
repeated press of a key to avoid
accidental duplicate typing of a key.
Pointing and Clicking
This section allows user to enable keyboard arrow keys on the numeric keypad to be used as
Mouse Keys and move the mouse pointer on the screen. Simulated Secondary Click can be
enabled to set a time delay for how long the left mouse button should be pressed to be accepted
as right click. Hover Click option can be enabled to trigger mouse click just by bringing the
mouse pointer over the desired option or object. The time delay and motion threshold can be set
for this.
193
Web Applications and Security 5
Accessibility feature refers to the assistance in the following impairments:
Visual impairments: Poor or low vision and blindness are assisted by the screen readers,
contrast settings, changing text size, magnifying or zooming parts of screen and by blinking the
cursor while typing.
Hearing impairments: These is assisted by visuals on the screen by flashing window Title bar or
the whole screen.
Mobility impairments: These are assisted by mouse speed, using keyboard as mouse, adjusting
click speed, simulating right click with left button, click by hovering, setting slow keys, bounce keys
and sticky keys, setting repeated key press delay, on-screen keyboard and navigating applications
by keyboard.
Orca Preferences
Orca preferences dialog box can be used to setup Orca utility. In the Speech tab you can enable
speech by selecting Speech system as GNOME speech services, Speech synthesizer, Voice settings
and Human voices. You can also set the Rate, Pitch and Volume of the speech. To enable/disable
speech you can also press Insert + S after Orca is enabled.
194
5 Web Applications and Security
If you need to display the Orca preferences for any currently opened application then press Ctrl +
Insert + Spacebar.
To learn the commands to use Orca, first enable Orca and then enter the learning mode by
pressing Insert + H. Now, press keys on the keyboard, Orca will read aloud the key name and the
commands associated with that key. To come out of learning mode, press Esc key.
You can refer to https://help.gnome.org/users/orca/stable/commands_reading.html.en to explore
about Orca reading commands.
Go to https://help.gnome.org/users/orca/stable/commands_structural_navigation.html.en to explore
Orca navigation commands.
LAB EXERCISE
Try out the lab activities given in the previous lab exercise for Windows. Explore
Ubuntu features to do them.
195
Web Applications and Security 5
In Client-Server network computers which are
dedicated to provided services and access to resources
are called Servers and computers that access these
services and resources over the network from the
servers are called Clients. Depending on the service
they provide, servers are called file server, print server,
database server, internet access server (proxy server)
etc.
Servers are equipped with powerful processors and
larger storage as compared to clients. In certain
networks, clients even rely on server for their data
processing. Such clients are called dumb clients.
196
5 Web Applications and Security
Wide Area Network (WAN)
A Wide Area Network (WAN) is a geographically
independent communication network. It covers a large
geographical area. For example, network between two
or more countries. A Wide Area Network may be
privately owned or rented. It has lower data
transmission rate. For example, mobile network set up
by BSNL
Internet
Networks all over the world are globally inter connected to form Internet. This is the reason why
internet is called 'network of networks'. Today, almost every computer and handheld
communication device is part of Internet. Computers over internet communicate through
communication protocols.
Internet is one of the most useful technologies of modern times which help us in our daily,
personal and professional life. Internet is widely used by students, educational institutes; scientist
and professionals to gather information for research and general information. Businesses use the
Internet to access complex databases such as financial database. The Internet is the largest
encyclopedia for all age groups. The Internet helps in maintaining contact with friends and
relatives who live across different locations via Internet chatting systems and email software.
Internet is also becoming a major source of entertainment for the general public.
The first workable form of internet came in 1969 with the creation of Advanced Research Projects
Agency NETwork (ARPANET) in USA under the U.S. Department of Defense. ARPANET allowed
multiple computers to communicate on a single network. In 1990s, Internet came in wider use
when computer scientist Tim Berners-Lee invented the World Wide Web.
World Wide Web
World Wide Web (www) is the largest information system on internet. It contains millions of web
sites that provide information in the form of text, animations, pictures and videos. Thus, it is like a
library that contains millions of books or information in the form of web pages.
What is the difference between Internet and World Wide Web? Internet is a massive network of
computer networks. It connects millions of computers together globally, forming a network in
which any computer can communicate with any other computer (as long as they are connected to
the Internet).
The World Wide Web, or simply Web, is a way of accessing information over the medium of the
Internet. It is an information-sharing model that is built on top of the Internet. The Web uses the
HTTP/HTTPS protocol to transmit data.
The Web also utilizes browsers, such as Internet Explorer or Mozilla Firefox, to access Web
documents called Web pages that are linked to each other via hyperlinks.
Advantages of networking
Data Sharing: One of the most important uses of networking is to allow the sharing of data. User
scan send text files, spread sheets, documents, presentations, audio files, video files, etc. to other
users.
Hardware Sharing: Hardware components such as printers, scanners, etc. can also be shared.
For example, instead of purchasing 10 printers for each user, one printer can be purchased and
shared among multiple users thus saving cost.
197
Web Applications and Security 5
Internet Access Sharing: You can purchase a single Internet connection and share it among
other computers in a network instead of purchasing multiple Internet connection for each
computer. This is very commonly found in Internet café (browsing centres), schools, colleges,
companies, etc.
Usage of network based applications such as web browsers, email clients, chat application,
audio & video calling, remote desktop applications etc. is another advantage.
Getting Access to Internet
To connect your computer with internet you need some additional hardware and software. These
are as follows:
¤ A telephone or cable line or a dongle (internet data card) for internet connection by the
Internet Service Provider.
¤ A modem: Modem is a device that enables a computer to transmit the data through telephone
or cable lines. A modem modulates outgoing digital signals from a computer to analog signals
for a conventional copper twisted pair telephone line and demodulates the incoming analog
signal and converts it to a digital signal for the digital device. Modem can be wired (Digital
Subscriber Line, dial-up, cables) or wireless (Wi-Fi, 3G/4G etc.).
¤ Software (browser): A browser/web browser is an application software that is used to access
the information (web sites) on the web. Mozilla Firefox, Internet Explorer, Google Chrome,
Safari, Opera are some commonly used browsers.
Internet Service Provider
A company or organisation that provides the access to internet. Access is provided through a cable
and a modem that connects your computer with the service providers internet server. Connectivity
provides a wide choice of data transfer speed and other services along with internet access. The
kind of connectivity available to you depends connectivity facilities in your area.
Types of Common Internet Connectivity
Connectivity to internet can be broadly categorised into wired and wireless. There are different
types of Internet Connectivity available today; it can be widely categorized into wired and wireless
access. Following table is a summary of different types of Internet connectivity categorized into
wired and wireless:
198
5 Web Applications and Security
Dial-up connections are extremely slow and in most cases, it is replaced by a high speed
connection such as DSL or Cable Modem.
DSL: Digital subscriber line(DSL) provide Internet access by transmitting digital data over wires of
a local telephone network. DSL service is delivered along with wired telephone service on the
same telephone line. On the customer premises, a DSL filter removes the high frequency
interference, enabling simultaneous use of the telephone and data transmission. For using a DSL
connection, you need a DSL modem and a subscription.
Cable Internet Access: Cable Internet Access is a form of broadband Internet access that uses
the cable television in frastructure. Cable Internet Access is provided through existing cable TV
networks; this is similar to DSL that is provided over existing telephone lines.
3G/4G/5G: 3G, short for 3rd Generation is a set of standards used for mobile devices and mobile
telecommunication services and networks. High-Speed Downlink Packet Access (HSDPA) is 3G
mobile telephony communications protocol that allows higher data transfer speeds and capacity.
3G can transfer multimedia at very high speed rate. Advanced forms of 3G are 4G and 5G.
While 3G speed is 8 Mbps, that of 4G is 28 Mbps. 5G promises to be 10 times faster than 4G. If your
mobile device supports any of these, you can subscribe for them with your ISP in order to get high
speed Internet connection on your phone.
WiMAX: WiMAX (Worldwide Interoperability for Microwave Access) is a wireless
communications standard designed to provide mobile broadband connectivity across cities and
countries through a variety of devices. WiMAX is a long range system, covering many kilometres
and is typically used where DSL or Cable Internet Access cannot be used; this could be difficulty in
laying out cables for home or offices located in remote locations but need access to the Internet.
WI-Fi: Wi-Fi is a popular technology that allows an electronic device such as computers or
mobile phones to exchange data wirelessly over a network, including high-speed Internet
connections. Wi-Fi devices such as personal computer, smart phones, video game console, etc.
can connect to a network resource such as Internet through a device called the Wireless Access
Point (WAP). Wi-Fi is used where cables cannot be run (such as old buildings, outdoor areas)to
provide network and Internet access. Wi-Fi can also be used where users require mobile
connectivity. Wi-Fi connectivity is used in home & offices, hotels, college & school campus
typically for Internet Access. Shopping malls, coffee shops, resorts mostly offer free or paid Wi-Fi
access to the Internet for their customers.
Data transfer on the Internet
Let us see how a piece of data, say a Web page, when it is transferred over the Internet:
¤ The data is broken up into bits of same sized pieces called packets.
¤ A header is added to each packet explaining where the data has come from, where it should
end up and where it fits in with the rest of the packets.
¤ Each packet is sent from computer to computer until it finds its destination. Each computer on
the way decides where next to send the packet. All packets may not take the same route.
¤ At the destination, the packets are examined. If any packets are missing or damaged, a message
is sent as king for them to be re-sent. This continues until all packets have been received intact.
¤ The packets are now reassembled into their original form. All this is done in seconds!
To access the Internet, you need an active internet connection. You need to gather and
understand your requirement carefully before subscribing to an internet connection plan. In this
exercise, you will learn how to choose an Internet connection.
199
Web Applications and Security 5
Some of the common questions that help you in your decision are:
¤ What is the purpose of getting this connection?
¤ Will you use the connection regularly?
¤ How much data will be downloaded on an
average per month?
¤ How much speed do you need?
¤ What technology is available in your
particular area?
¤ What are the different plans available from
the ISP?
¤ Is there any limitation or catch for the
selected plan?
Use the following table to compare different
subscription plans to get an estimate and
analyse if that would suit your requirement.
To access Wi-Fi, you need an access point with an active Internet
connection. Usually when you subscribe to an Internet connection,
the ISP provides options to purchase or rent a Wi-Fi router that can
act as both an internet connectivity device and an access point for
Wi-Fi connectivity. Setting up a Wi-Fi network requires technical
expertise; how ever, you can access the Wi-Fi network by
connecting to an access point that is already setup for use. On
computers that run Windows, you can view the list of wireless
networks available by using the following procedure:
Windows will display the list of available Wi-Fi networks; you can
choose any of the connection from the list. Select by Double-
clicking on the name displayed in the list.
EXERCISE
1. How is internet different from the network in a closed, small area like your computer
lab?
2. How WWW is different from internet?
3. What is a modem?
4. What is the role of internet service provider in accessing internet?
5. How does data travel on internet?
200
5 Web Applications and Security
Most instant messaging software include the option for performing file transfers, audio chat, video
calling and conferencing, sharing desktops, etc. a part from standard text chat. Instant messaging
software is widely used for personal and commercial use. In this session, you will be introduced to
the concept of instant messaging, the steps to create an instant messaging account and also work
with instant messaging software.
Unlike email, instant messaging happens in real-time and the response from participants can be
spontaneous. Some instant messaging software allows users to view messages received when they
are not logged on. These are called “Offline Messages”.
For utilizing audio and video chat or conferencing, you need to have microphones and headsets
or speakers and web cameras so that users can talk or see each other.
Key features of an instant messaging are as follows:
¤ Text Messages can be sent to one or more person (Similar to SMS).
¤ Audio calling and conferencing.
¤ Video calling and conferencing.
¤ File transfers (Not limited to documents, spreadsheets, audio files, video files, etc.).
¤ Message history (Save messages for future reference).
Instant Messaging Account
Participants messaging to each other need to be signed in to the same instant messaging software.
To use instant messaging software, a user must have a valid instant messaging account.
Instant messaging accounts differ in formats; some instant messaging software such as Windows
Live Messenger use email addresses for managing the account and software such as Skype use
standard names.
Instant Messaging Services
There are two kinds of instant messaging software – application based and Web based.
¤ Application based instant messaging software is downloaded and installed on user's computer.
Some of the popular instant messaging software are:
l Google Talk – Now known as Google Hangout.
l Yahoo! Messenger (now discontinued).
l Skype.
l Windows Live Messenger.
l RediffBol, etc.
¤ Web based instant messaging software is accessed using browsers such as Internet Explorer,
Mozilla Firefox, Google Chrome, etc. Some of the popular web based instant messaging
software are:
l Meebo.
l MSN Web Messenger.
l IMO, etc.
Instant Messaging with Google Hangout
Google Hangout was earlier available as an installable application GTalk. Hangout provides
chatting, voice calls and video calls for free over Internet.
This facility comes along with the e-mail account. Besides Google Hangout, Facebook Instant
201
Web Applications and Security 5
Messaging,WhatsApp, Skype provide this facility on different interfaces.
To use Hangout, login to your Gmail account. You will see your hangout connections on the right
hand side as shown here.
LAB EXERCISE
Go to Gmail and create an account if you do not have already.
202
5 Web Applications and Security
To begin chatting, double click on the contact
name. A chat window will popup where
messages can be typed, sent and seen.
Chat Etiquettes
1. Messages should be short and to the point.
2. Always introduce yourself by name if your
screen name doesn't reflect it.
3. Always ask if the other person has time to
chat first-regardless of how important you
think what you have to say is, it's not going
to be well received if the recipient is busy.
4. In a business environment, know exactly
what you want to discuss.
5. TYPING YOUR MESSAGES IN UPPER
CASE is extremely rude-it's considered
shouting and very aggressive.
6. Give people time to respond - Multiple
questions sent to a recipient before they've
had a chance to answer can seem more
like an interrogation rather than a
conversation.
7. Wherever possible, give the person you are communicating with your undivided attention. It's
not just a sign of respect, but if you have multiple conversations happening or are allowing
other issues to distract you, you may miss an important point in the other person's messages
or lose the gist of the conversation.
8. It's important to properly end an IM conversation - you may think the chat is over, but the
other person may not. While you're off doing other things, they may be sitting there staring at
the screen waiting for further communication from you!!
LAB EXERCISE
Go to Gmail and practice instant messaging with some of your classmates with teacher's
permission.
203
Web Applications and Security 5
also use off line blog software to create content first and later publish the content when an active
internet connection is available.
There are hundreds of websites that offer blog service for free. Some of the popular blogs include:
• www.WordPress.com
• www.blogger.com
• www.blog.com
• www.weebly.com
• www.blogsome.com
Creating a Blog Account
Let us learn how to create a blog account on WordPress.
1. Open the browser and go to https://wordpress.com/
2. Click on Get Started on top right corner.
204
5 Web Applications and Security
5. Fill in Create Site form and click on Continue.
6. Enter blog address for your site and click on Create for free account.
205
Web Applications and Security 5
Starting with New Blog Post
1. In your account page, click on Add beside Blog Posts.
You can decide to publish immediately or any future date. Click on green colured Publish!
button. It will show your published page. Click on Visit Site.
206
5 Web Applications and Security
Posting Comments on Other Posts
When you visit other blogs and read posts,
you can post comments on the post. The
options for posting comments are usually
given at the end of the post which you
might find after scrolling down the post
page.
Key in your comments and details and click
on Post Comment.
LAB EXERCISE
1. Go to WordPress or Blogger.com to create a blog account and create a small blog
post about your school.
2. After publishing blogs share it with your classmates online through Facebook. Post
comments on each other's blog posts.
207
Web Applications and Security 5
Click on Create in the popup.
208
5 Web Applications and Security
The post will be published and an
update will be displayed on the page.
209
Web Applications and Security 5
Working with Qumana
Qumana can be downloaded and installed from https://www.softpedia.com/get/Internet/News-
Newsgroups-Blog-Tools/Qumana.shtml
Qumana makes blogging very easy. You can add pictures, audio, video and images to your blog.
You can easily manage you blog and publish it online.
Once installed, open Qumana by clicking Start > All Programs > Qumana > Qumana or by
clicking Qumana shortcut on the desktop.
Connecting with Online Blog
210
5 Web Applications and Security
Qumana interface will open up listing your blog posts.
2. Make changes in your post in the editor. You can use formatting toolbar. If you have basic
knowledge of HTML, you can insert content with HTML using Insert HTML button at the
top. Insert Ad button lets you insert advertisement in your post page. Once changes are
done, click on Save button to save your post offline on your computer.
Publishing the Blog Post
1. To publish changes to your blog site, click on Update Post button.
211
Web Applications and Security 5
2. Qumana will take a while and publish the changes to your online post.
LAB EXERCISE
1. Go to WordPress, register yourself and create a simple blog.
2. Publish a post using MS Word.
3. Download and install Qumana.
4. Use the editor to connect with your online blog.
5. Edit the online blog created in previous session using offline editor and publish the
changes.
212
5 Web Applications and Security
1. User registers on the website.
2. User searches for products and browses through product catalogues.
3. User selects, reviews and adds the products in online shopping cart.
4. User reviews the cart and finalises the products in the cart.
5. User fills in the shipping address.
6. User fills in the online payment details.
7. User furnishes the payment and checks out.
8. Website sends SMS and Email to the user, acknowledging the payment received and
regarding the dispatch of the products purchased.
9. Finally, products are delivered to the dispatch address.
Let us understand this process with Amazon.in.
Online Transaction Using Amazon
Amazon is one of the premiere online stores where you can purchase a variety of consumer goods,
books, apparels, mobile phones, groceries, toys, sports goods and several other goods.
Amazon offers multiple payment methods like credit card, debit card, net banking, e-gift voucher,
and Cash on Delivery.
You can make purchase and transactions on Amazon without registering but every time you make
payments you will have to enter all your details again hence otos recommended that your create
an account on Amazon.in and log into it to make online purchase.
Shopping on Amazon.in
1. Open any browser and go to www.amazon.in.
2. Bring the mouse pointer over Your Orders and click on Sign In to login to
your account.
3. On next page enter your email ID, click Continue, enter your password and
click Continue.
Amazon home page will provide you a wide variety of products organised into
various categories. Page also displays various deals.
You can also search for the products from the search bar at the top which
provides choice for product categories.
213
Web Applications and Security 5
Browsing Product Catalogue
Products in a catalogue can be sorted according price, reviews and popularity. You can narrow
down your search on the basis of manufacturer, product price range, discounts, availability etc.
The catalogue interface is seamlessly provided with search, links and category choices that your
can easily look around.
Shopping Cart and Wish List
When you click on a product or its image, its features, any technical details, discount schemes,
customer reviews and payment options are displayed on a new page.
It is not necessary to buy the products immediately. You can add the product into a wish list to
review it later. If you like the product, you can add it to your shopping cart and continue shopping.
Finally, you can decide which products you really need to buy and delete rest from the cart. Once
your shopping cart contents are finalised, you can proceed to payment.
With each item, there is Delete link to remove the item from the cart.
Once finalised, click on Proceed to Checkout button.
Enter your Delivery address and Shipping preferences. Amazon will
save it for future use. Click Continue.
Select Payment options through all standard credit and debit cards,
Netbanking, EMI (if applicable), Cash on Delivery, Gift Cards, Vouchers
etc. Select the suitable method and click Continue.
214
5 Web Applications and Security
Fill on your payment details like card details, login credentials etc. Click
Continue. On next page, click on Place Your Order and Pay. This will
take you to the payment gateway and once the payment is successful you
will receive an acknowledgment mail regarding product, payment and
delivery details.
Online Transaction for Booking Rail Tickets
Let us see how we can use an online ticketing service for booking train
tickets. Here we shall use IRCTC website for this purpose.
Open the browser and go to IRCTC website: https://www.irctc.co.in
On website's home page, fill in the details of your journey like cities to
travel from and to, date of journey and preferred travel class. Then, click
on Find trains. You can login into IRCTC account which you may have
created earlier. Registering on IRCTC is the same standard process as on
any other public services website. To login, click Login option in the drop-
down menu on top right corner.
The trains will be listed. Click on Check
Availability to check the seats available. You can
change the travel class to check seats for other
classes. Once you decide to book a seat, click on
Book Now.
215
Web Applications and Security 5
On the next screen,
fill the passenger
details as shown
here. If you have
passenger details
already saved in the
website then you
can pick up details by clicking My Saved Passenger(s) List. To add more passenger details, click
on Add Passenger.
Scroll down, fill in mobile number and captcha details and click Continue Booking. Review
booking page will appear. When sure, click on Continue Booking.
On payments page, select the suitable payment
option for example Net banking, select the Bank
and click on Make Payment.
This will take to the payment portal. Furnish the
payment and your ticket will be displayed to
download and print.
Viewing Transactions
In the main menu, click on
MY ACCOUNT and hover
mouse pointer on My Transactions. You will see choices namely Booked
Ticket History, Failed Transaction History, Ticket Cancellation
History. You can select the desired choice.
LAB EXERCISE
1. Create an account on any online shopping site of your choice with teacher's
permission. Add some items in shopping cart, go upto payment option and then
logout without buying the items.
2. Register yourself on IRCTC website and practice booking a ticket. (Do not book
actual ticket. Stop when payment page appears.)
3. Check you email ID of there is any mail from shopping website and IRCTC.
216
5 Web Applications and Security
scammers. The Internet is as secured as safely we use it. Exchanging information may often
involves high risk of intrusion.
Though Internet is a valuable and vast source of information. It is also the most preferred source
and virtual place of entertainment. But it makes your computer prone to many online threats.
Ensuring security of our login credentials on various sites like bank sites, our credit card and online
banking information from unauthorized users is a must. Some web sites can also install Malware
on the computer without user consent thereby leaving the computer damaged or insecure.
Online threats such as Phishing, email spoofing, chat spoofing, etc. can increase the chances of
users getting compromised.You can reduce the risks by using best practices such as using Antivirus
Software, Antispyware Software, Firewalls, strong passwords, etc. in addition to spreading
awareness of the best practices.
Best Practices for Security
Use strong passwords, with combination of letters in both cases, numbers, and special characters
which makes a password difficult to crack or guessed by others. Do not keep easy-to-guess obvious
passwords like your birth date, birth place, friend's name, relative's birth date, mobile number etc.
Change your pass word frequently at least monthly or fortnightly.
Most web sites like Gmail, Facebook, bank web sites and important transactional web sites check
for password effectiveness when you register for the first time or change the password.
Following is a general guideline for managing strong passwords.
¤ Password length should be at least 10-15 characters if possible or allowed by the website or
software.
¤ Do not repeat password while changing them. Many bank web sites do not allow this.
¤ Pass words should be a complex combination of numbers, letters and symbols.
¤ Avoid using same password for multiple sites.
Example of a strong password is k3xP%,7Ym[}
Web sites such as www.strongpasswordgenerator.com help generate random strong pass
words. Go to www.strongpasswordgenerator.com and click Generate strong password. The pass
word will be displayed.
Regular Data Backup: Regularly backup your data on an offline storage like external drive, disc
or tape drive etc. You can restore it in case of data loss or computer hard drive crash. Keep the
back up in a secured place away from unauthorized users.
Encrypt Data by using a good encryption software. Some operating systems provide this feature
also.
Secure your user name and password: Never save your security credentials in a place or
location, which is shared among others such as cybercafé, shared drive etc. Do not set your
browser to automatically login to your bank sites for automatic logon. Every time you visit such
site, type the password always.
Do not share personal data; web sites require you to fill out forms containing fields such as name,
gender, age, email address, school, etc. Be cautious when filling out such forms; research and
verify if it's a trustable web site. Your email addressed could be used by unauthorized users to send
you fake or unwanted emails; think twice or thrice before providing information to any website
and decide if it is really necessary.
Secure transactions: If you are using online shopping or transactions, web sites even store your
credit card or online banking personal information such as your credit card number, account
217
Web Applications and Security 5
details, etc. This information can be tracked and used by un-authorized users often known as
hackers to misuse this information.
Again, ensure the web site is legitimate and uses secure practices for performing and maintaining
online transactions. Since information such as credit card details or personal information is sent
over the network, it is always recommended to use only secure web sites for such transactions.
Verify if the web site uses secure transaction; usually it is indicated through a digital certificate
represented as a golden lock in the web browser's address bar.
Use antivirus and antispyware software, computers are prone
to attacks from software known as Malware that could har my our
computer. Malware track browsing be havior or transmit personal
data from your computer; programs such as key loggers could be
in stalled on your computer track and transmit every key that is
pressed on akey board (keystrokes) to unauthorized users.
218
5 Web Applications and Security
Never install software from unknown sources as they might not be
trust worthy; download only from well-knownorreputed web sites.
Verify the source if it is legitimate by searching the internet or referring
to comments from other users before downloading them; understand
the nature and the purpose of the software before attempting to
download and install them.
Secured Socket Layer Certification is done for web sites by known
authorised Certification Authorities (CA). CAs do not issue SSL certificates to phishers, spammers
or any agency that is not properly identified and cleared. Check the website's certificate icon of a
padlock in the address bar. All secured web sites have SSL (Secured Socket Layer) certificates. If
padlock icon is of open lock then website is not secured and must be left immediately.
Remove unwanted or unknown software applications; these might have got installed without your
knowledge when you have visited some web sites. Unwanted software could get installed as they might
have been bundled along with necessary software. Some programs such as toolbars get installed usually
through bundled software and are programmed to send personal data without your consent.
Cyber Bullying
Any sort of threat or harassment over internet is the act of cyber bullying. Messages in bad taste
and intentions, online mockery in friend groups or circles, stalking someone's online profile and
trying to post unwanted updates, sending unsolicited private messages, videos, and pictures are
considered as Cyber bullying that affects young minds intensely even up to the threats of death.
Protection from Cyber Bullying
¤ Children must know that their parents and teachers are always available for them when they
face such problem.
¤ Children must know that no matters what, parents and teachers are their first support.
¤ Children should inform their elders about any incident that sounds nasty even remotely.
¤ Children must know the fact that cyber bullies are not capable to do any harm and they can
never carry out their claims of harming someone.
¤ Children are advised to block such intruders immediately and never entertain them.
¤ In case of cyber bully attack, save all his/ her messages offline as evidence for later use.
Malicious Smartphone Applications
Many smart phone applications seem attractive but in fact contain malicious code that
steals information stored in the smart phone, such as the address book data without
the owner's knowledge. The personal information stolen this way is forwarded to the
hackers who abuse it to commit cyber crimes such as spam operations, billing frauds
and cyber scams. Every trending app is not worth downloading.
Smartphone Safety Measures
¤ Set up emergency numbers for instant calling.
¤ Do not use cell phone everywhere – keep your senses free to perceive other stimuli like while
crossing road, driving, using escalators, crowded areas etc.
¤ Get rid of unwanted data as soon as possible – keep your phone data tidy.
¤ Protect your phone from physical theft. Make it a habit to check while leaving any place.
¤ Keep good password and pattern protection.
¤ Keep the antivirus and software updated.
219
Web Applications and Security 5
¤ Sign out of and close the apps that are used.
¤ Avoid automatic download settings.
¤ Keep your wireless access secured.
¤ Do not install just any app impulsively or in peer pressure.
¤ Keep a regular backup of your phone data.
Clearing Data Stored In Browsers
Web browsers have built-in password management designed
to store passwords used informs on web sites.
Browser soften prompt to save user name sand
passwords when users attempt to logon to web
sites. This facility is offered to users, so that they
can logon to their frequently used web sites
without having to type the user names or
passwords. However it is not advisable to leave
the web browser store this data particularly on
public or shared computers.
To clear personal data from a web browser such
as Google Chrome, launch the browser.
Click Tools Menu > More Tools > Clear Browsing data…
The next window will show various options to clear Browsing History, Cookies and Cache.
You can make changes in Privacy settings according to your preferences.
LAB EXERCISE
Visit security options of Internet Explorer and note down your observations in notebook
like how history settings are changed, how cookies settings are changes and how other
security levels are setup in Internet Explorer.
220
5 Web Applications and Security
Safety Issues and Workplace
As we learnt that workplaces are mostly dynamic in nature and depending on that, their
environment varies. Think of a small stationery shop manned by two people at one hand and on
the other a busy railway platform buzzing with the crowd of passengers arriving and leaving, along
with vendors, staff and security personnel around. Quite a contrast! Isn't it? So, you can now figure
out that certain workplaces could be quiet like, offices and libraries while some workplaces are
moderately noisy and crowded such as shops and restaurants, yet some workplaces like hospitals,
public transport stations, factories, mines, construction sites, packaging units, ware houses etc.
work under stringent safety controls.
What is of importance is the safety of each and every individual directly or indirectly related to the
place of work. For instance, hospitals have responsibility of safety not only for their staff but also
for the patients and the visitors. So does for airports, railways and bus stations for passengers,
shopping malls for shoppers, restaurants for customers, schools for students, recreation parks for
children and the likes.
Safety Hazards
Preventing and protecting against a threat or hazard needs the knowledge of kind and nature of
the threat. Knowledge helps in devising effective safety measures and rules. Nature of workplace is
the prime factor that decides the kind of threats to the safety of the people present there. In highly
sophisticated workplaces such as laboratories, construction sites, mines and manufacturing expert
guidance and vigil are needed to ensure safety and a strict code of conduct is followed in
complying with the safety rules and regulations. In certain specialised cases, breaching such rules
may be considered as criminal offence. Comparatively common workplace areas such as schools,
offices and shops need not to have such extensive safety measures but they do need to follow
certain basic and mandatory safety practices on regular basis. Some common workplace safety
hazards are related to the following items or factors:
Fire: Fire has the most devastating effect. In absence of appropriate safety measures, it is like
inviting the trouble knowingly. Fire safety must be the prime concern for every domestic and
commercial place. Protection against fire is the part of basic rules and guidelines of safety. A
sudden outbreak of fire catches the people off-guard and by the time they react, it spreads. In
certain areas like mines, paper and garment go-downs, confined places like elevators, theatres and
washrooms, oil-rigs, fuel stations, chemical laboratories are most prone to complete devastation by
fire. If fire breaks out in such places and adequate means of safety are absent then such places
succumb completely to the raging fire in no time.
Electricity: We tend to take this silent monster very lightly and in most of the cases, victims hardly
survived. Today, quality electrical equipment and fittings are installed which make us little inadvertent
in using them. This makes us overlook certain trivial danger signs such as broken sockets or wire-
casings, water leakage near the electrical fittings, wires exposed due to rodent-bites, wear and tear of
the old fitting and wirings etc. Other reasons behind a safety hazard due to electricity are misuse of
allocated power (using high voltage equipment over a low voltage line) leading to short-circuits,
equipment and fittings in the reach of children, deployment of untrained personnel for repairs and
poor fitting layout design. Careless handling of equipment. For instance, using a hair-drier casually in
the bathroom or handling electrical fittings barefoot standing on the naked ground. Electricity
accidents, like short-circuits, may cause fire, leading to more destruction and loss of life.
Unsafe places: An unsafe place could be as ordinary as a narrow passage cluttered with a stack
of heavy cartons or as dangerous as several feet below the ground in a coal mine. A construction
221
Web Applications and Security 5
site is a life-threatening place for untrained, unequipped and casual individuals. Like construction
sites, factories and warehouses have two major threats – heavy objects and moving objects. For
example, heavy containers and fork lifts. Confined places like narrow passages, operation theatres,
air-locked rooms, bank safes, freezers and cold storages, driver's cabin, cockpit, soundproof cabins
and basements – parking, go-downs, mines – all such places turn out to be hell holes when
disaster strikes. Certain places are unsafe due to hazardous nature of the work such as virus
medical research centre, nuclear plants and machinery, blast furnaces, refineries, work involving
dust, smoke and other particles in the air, work involving high decibel noise due to heavy
equipment like drilling machines and hammers, life threatening sites such as underwater, space
research, outer space missions, extreme heights and extreme weather conditions (desert, north
pole etc.), places which bring workers in contact with harmful diseases – people working for
patients during a pandemic such as recent Covid-19 virus etc.
Tools and Machinery: Various trades use different kinds of tools, machines, gadgets and
instruments. Using certain tools and operating specific machines needs right kind of training and
methods. Tools pose a threat if they are not used in the adequate manner, machines can create havoc
if they are not worked with adequate skills. Mishandling of these leads to the dangers for the people
on the workplace. Certain examples are heavy drills, cranes, trolleys, furnaces, medical equipment,
forklifts, indoor carriage cars, push carts, carpentry tools etc. Working with a tool or a machine is as
safe as the level of skill and knowhow of its operator. Proper placement and location of the
equipment is also necessary. Distractions while operating them may also lead to accidents sometimes.
Ergonomics: There are certain ways to operate equipment and right kind of postures to assume
while working. A person merely sitting in a chair, typing on a computer is exposed to the effects of not
using the equipment properly and not assuming the right posture. The correct posture of working on
a computer, correct posture to man a vehicle, correct pose to handle an equipment come under
ergonomics. The quality of a product is also determined by its ergonomic design. A chair meant for
sitting for longer hours by a data entry operator will be different than that meant for a person working
on a loom. Ergonomics involves both – the right product design and the right posture to work.
Slippery and unsafe passages: A simple slip may cause a broken hip or elbow. Businesses
involved in show and display such as hotels, malls, restaurants and other such places have more
reasons for accidents due to a sudden slip. Imagine a slip and topple from the third floor of a mall
down to the ground floor or a slip over the moving escalator. Passages partially blocked by
discarded stuff like broken furniture or wooden cartons. Untidy narrow pathways due to poor
housekeeping. This is the reason that in certain professions, personnel are trained into handling
equipment in narrow passages like the passage in aeroplanes, crowded places like restaurants,
moving trains. All such workplaces made of slippery floors need extra care and caution for the
people who work there and the visitors.
Crowd: Overcrowded workplaces may cause different kind of threats but they are more of a big
disaster in other kinds of threats such as fire breakout or stampede. Crowd makes an emergency
situation worse. Law enforcement professionals and workers many times deal with crowd.
Crowded hospitals are a common example. Such places need discipline and a code of conduct for
restricted movement as well as authorised access to specific areas. Crowds on railway platforms
and over bridges many time lead to accidents.
Hygiene and health: People in healthcare, medical profession and scientific research are
exposed to infections, radiations and other similar threats depending on where they work. A strict
regime of discipline and safety measures are needed to be followed in such places. People not
trained into working at such places pose greater threat.
222
5 Web Applications and Security
Training and capability of staff: Certain businesses sometimes compromise on the adequate
training, capacity and skills of the working staff due to budget constraints or short-sighted business
decisions. This leads to accidents. In certain businesses it is more of a mortal threat such as public
transport and commutation services (taxi, school van etc.). There had been a few news of school
van accidents. Capability refers to the physical and mental state of the worker or operator of the
machine. A drunk driver kills self and many others. Lack of adequate staff results in untrained
persons handling the equipment. We have heard cases where an untrained support staff was
caught administering an injection to a patient. All professions involving handing of equipment,
tools and machines need adequate expertise level and certified, trained and skilful personnel to
work. Anything less than this is an open invitation to an accident in waiting.
EXERCISE
1. Imagine a public place which you visited recently. Which safety hazards did you
notice there?
2. What are the common safety hazards likely at a school?
223
Web Applications and Security 5
safety. People at workplace should know what to do during a fire breakout. Evacuation drills,
demo and practice sessions for using fire extinguishers, instant access to fire fighting services and
medical help, self-management and helping others during the emergent situation etc., equip staff
to handle the emergency adequately instead of panicking and losing control.
General health and ergonomic safety: Nature of work and workplace environment affect the
health of the workers. A conducive work environment is conscious of workers' general health and
its ergonomic aspects. Due to work-specific environment workers may get exposed to different
kinds of health hazards. For instance, coalmine labourers are exposed to poisonous gases, harmful
radiations, inflammable materials etc., sewage cleaners lose their lives due to poisonous gases and
deep running smudge. Such workers need adequate equipment and gear to work.
Hospitals are a dangerous place for the staff who come in direct contact of the patients with infectious
diseases, people working in refineries, chemical plants and dye industry tend to get their respiratory
system infected with hazardous chemical, tiny dust particles and general air contamination, extreme
temperatures may cause discomfort or danger to physical health, Such workers should follow the safety
guidelines such as wearing right kind of PPE, gear and obey the prescribed health measures. People
working behind desks with least or zero physical movement are prone to ailments related to heart,
backbone and neck. Suitable breaks, fitness regime and discipline must be followed by them. Many big
corporates provide gym facility for the employees. Minimised physical activity takes a toll on the physical
fitness. Long durations of standing (shopping mall, food joint), too much physical movements such as by
salespersons, traffic policemen, hotel kitchens, waiters, security guards etc. Suitable breaks, arrangements
for little recreation and physical fitness must be in place for such professions.
First Aid Kit is a mandatory requirement at all workplaces irrespective of their nature and kind
however, it should be equipped with suitable tools and medicines. FAK helps in minimising the risk
of life until the help arrives. It enables the victim to hang on for a little longer time until the real
help is reached. A standard FAK contains the following:
plasters in different sizes and shapes sterile gauze dressings
bandages of different size/shape safety pins
tweezers and/or small scissors alcohol-free cleansing wipes
sticky tape digital thermometer
skin rash cream antiseptic cream/ liquid
painkillers cough medicine
antihistamine cream or tablets small torch
FAKs need to be checked regularly to replace any expired material or to add any new item
depending on the requirements.
Providing first aid: Every individual should know how to provide basic first aid to a victim.
Usually, first aid is a matter of trained persons but a basic training from the right source such as
redcross.org etc. equip a person to become useful during emergency. Depending on the cause of
harm, the patient or victim should be treated properly for the quick comfort and safety. Taking care
of proper air flow (ventilation), comfortable lying down of the patient, applying suitable medicine,
suppressing any bleeding, aiding in respiration, supporting a broken bone, least distressing
movement of the patient are certain basic know-hows that may save a life. The main purpose of
the first aid is to keep the victim or patient alive and comfortable until the adequate health arrives.
Visit www.redcross.org to learn more about providing first aid.
Ergonomic safety refers to the correct way of working with an equipment. It involves body posture,
224
5 Web Applications and Security
duration of working, safety of sensitive organs such as eyes and right skill. For example, to type for
longer duration on a keyboard, one must be trained in the typing skills of specific language
keyboard, the right posture of the body, kind of chair, position of knees and elbows, position of
wrists while typing and using mouse, distance from the monitor, intensity of the monitor glare etc.
need to be considered.
Keyboard
¥ Your neck and shoulders should be relaxed.
¥ Your upper arms & elbows should make a little
more than 900 angle.
¥ Your wrists should be straight.
Mouse
¥ Mouse should not cause pressure on the wrist.
¥ Avoid bulky mouse.
¥ Keep mouse closer to the keyboard.
¥ Elbows should be bent and closer to the body.
Monitor
¥ Monitor should be placed at a distance anywhere between 18 and 30 inches.
¥ You should be able to focus on the screen while still using the back of the
chair and keep your arms parallel to your upper body.
¥ Your eyes should be level with the top of the screen.
¥ Turn the screen brightness down to a comfortable level.
Safety equipment: It is the responsibility of the concerned business and authorised persons to
ensure that safety equipment required for the work is worn by the workers. Through guidelines,
trainings and checks must be there to ensure the compliance in using the safety equipment. In
225
Web Applications and Security 5
sensitive areas like hospitals, construction sites etc., government regulations need to by applied
and followed. There must be detailed guidelines and stringent discipline to ensure everyone's
safety. People must be educated in realising that safety equipment may slow them down but
prolongs their life span. To stay alive and physically safe are the prerequisites to be of any use to a
workplace. No business would like to have a crippled worker or a worker lost.
Lighting: Workplaces involving late working hours or places like mines, go-downs and basements
need suitable amount of lights for workers to see and carry out their tasks. Improper lighting leads
to visual health issues and low productivity. A well lit room, a mine fitted with moving flash lights,
operation theatre with bright overhead flash lights, a classroom with proper light arrangements are
examples of well-lit workplaces.
Cleanliness and hygiene: Clean and tidy workplaces is a prerequisite for better working
environment. Workplace should be free of rodents and other insects. Regular cleaning of the
floors, working areas, desks and other parts of the building should be carried out. Occasional but
regular sanitisation and disinfection is needed depending on the nature of the workplace.
Cleanliness of the washrooms and other areas is necessary. Adequate arrangements must be there
to ensure that employees could manage hygiene properly. Maintaining a clean and healthy
environment is the responsibility of both the employer and the workers. Suitable guidelines and
rules should be communicated regarding this and management should ensure that they are
obeyed strictly.
Controlled access: Certain organisations and enterprises need to ensure authorised access to
certain parts of the workplace. For example, everyone cannot go inside an operation theatre.
Places like electrical control rooms, centralised machine control rooms, server rooms and specific
floors are kept out of reach from the unauthorised personnel to ensure that entire system runs
smoothly. Large organisations even practice authorised security card-based access into the
working site besides having a detail of security personnel. These measures ensure that untrained,
hostile and unwanted persons should not get in.
Training the workforce: All the measures for ensuring workplace safety fall flat if workers are
not properly aware of them, understand them and acknowledge them. Workers should be
informed, educated and trained into following the safety measures laid out by the organisation.
Formal means of communication, quarterly safety measures quiz and mock drills, evacuation plans
are effective ways to ensure that workers understand and comply with the safety policy and safety
rules of the workplace.
EXERCISE
1. What is the use of First Aid Kit?
2. Discuss in brief the ergonomics related with working on computer.
226
5 Web Applications and Security
preventing major accidents at workplace. That is why mock drills and reminder quizzes are
important. Let us understand some common types of accidents.
Slipping: Wet floors, slippery surfaces, edges of the stairs etc. are common places where a person
may slip and hurt badly. Anti-slip strips and big warning displays prevent such accidents. The grips
on the stairs should be anti-slip. Cleaning staff should clean the floor by putting up warning boards
on every possible entrance of the area being cleaned.
Tripping over: One must be careful while moving in a cluttered place like maintenance rooms
strewn with wires or place with loose rugs. Tripping over sometimes may cause serious accidents
as it leads to falling objects and further damage and threat to life. For instance, tripping over the
wire of a stand-alone fan causing it to fall down may lead to short circuit. Tripping over can only
be prevented through informing all in advance, cordoned off areas, restricted access and suitable
warning signs and most importantly being careful ourselves.
Falling: Falling down from the ladder, edge, roofing and other such unprotected areas may lead
to serious injuries or even deaths in case of dangerous heights. Construction sites, factories,
warehouses, go-downs, mining and digging operations are the sites prone to accidents and deaths
due to fall. People working at heights should be trained and skilled in doing so, they should be
equipped with adequate gears such as safety ropes, helmets, anti-slip gloves and shoes, climbing gear,
anti-slip ladders, walkie-talkie, catching nets and arrangements of instant first aid of advanced level.
Hit by vehicle or falling objects: People should be careful in places like car parking, moving
trucks in a warehouse, loaded truck backing up, fork-lifts moving inside a large warehouse or
store, heavy objects kept at height, rail-carts, carriages and even people carrying some heavy
object. Warning signs placed at conspicuous points, restricted access, localised, in-house traffic
rules, signal controls, suitable announcements on loudspeakers, controlled movement, automatic
warning sirens such as backing up warning callout can prevent such accidents.
Other common workplace accidents are due to electrocution, tools and machine handling, lifting
accidents, common physical injuries and strains, overexertion, inhaling toxic material, crashes,
collision and harms due to high decibel noise, dust, smoke and dirt.
Major accidents include explosions, fire breakout, leakage of hazardous material, electrical surge
and high voltage accidents, mine collapse and underground avalanche, flooding of closed,
congested areas, building collapse and machine-related accidents etc.
Preventing Accidents
Some common preventive measures against accidents at workplaces are listed here.
Safety guidelines, rules and their communication: Workplace should be governed by
standard as well as specific safety rules. Staff should be communicated formally about them and
should also be educated and trained in certain cases through draft policy, email literature, quizzes
and mock drills.
Workplaces should be displayed with conspicuous warning signs, directions, safety tips and
indicators for any diversions during maintenance. For cases where danger can be anticipated,
timely warning should be conveyed to all concerned through most effective channel. One such
example is sending an email to all, informing that staff buses will leave early through alternate
route due to sudden heavy rainfall and water-clogged roads.
Efficient housekeeping should be ensured through trained and skilled staff. Carelessness during
cleaning and maintenance are causes of most common accidents. Housekeeping should have
clear guidelines for standard tasks and rules for safety. Storage of materials, movement and lifting
of heavy objects and use of cleaning equipment should be done in the safest possible manner.
227
Web Applications and Security 5
Preventing unauthorised access through restricted entry with the help of ID cards,
security checks, digital swipe cards, fingerprint scanners, CCTV cameras, alarm systems and
classified, secured areas greatly helps in most of the accidents because it keeps untrained and
unwanted hands at bay. Only required and skilled persons access the place who are aware of
importance of safety for everyone.
Safety guidelines during operations at production floors installed with machines should be
followed strictly. Movements around the machines (slow, vigilant and cautious), proper uniform
(no loose clothing), adequate gear (helmet, eye guards) and careful operation of the equipment
can prevent many accidents.
Risk assessment should be done regularly to understand who are at risk, potential dangers and
possible losses. Such assessments provide clear picture of the safety quality of the workplace and
help in devising effective preventive measures. Identifying safety exits and devising effective
evacuation plans are helped by thorough risk assessment.
Employing trained and skilful personnel ensures that major safety guidelines are taken care
of. Skilled and trained hands are educated in observing safety measures. Regular training of new
staff ensures that everyone at workplace knows how to keep self and others safe and what to do
when emergency occurs.
Discipline, alertness and care are the three basic qualities which help every individual in
maintaining common security. Attitude of the people is of importance here. If everyone is
motivated and encouraged to follow safety guidelines, observe carefulness in daily operations and
show care and concern for others then many mishaps can be avoided. A feeling of responsibility
and professionalism needs to be there in working personnel to cooperate in observing safety at
workplace. Such attitude strengthens the preventive measures otherwise all kinds of safety
measures are not enough to help.
EXERCISE
List any 4 different workplaces you might have seen and suggest how common accidents
can be prevented there.
228
5 Web Applications and Security
newcomer until s/he gets acclimatised with the work environment and risks involved. Later, the
newcomer can also play the role of safety-buddy with the same partner. This arrangement gives an
opportunity to the experienced employee to test his/her skills in doing the role of the buddy.
Buddy system is useful in:
l Reducing risk through safety assistance.
l Helps in monitoring for possible workplace risks and dangers.
l Advising to keep safe from potential exposure to hazards.
l Providing rescue assistance during emergency situations
l Providing instant help such as first aid, evacuation to safety if the partner is injured.
l Raising an alert or alarm to summon help in case of any accident.
Emergency Evacuation
In the event of any emergency such as fire, flood or any such disaster, an emergency evacuation
procedure is a must to ensure that everyone at the workplace is evacuated to safety with least harm
possible. Workplaces should set their own standard policies for handling
workplace emergencies. Employees should be made aware of the policy
and procedures of emergency evacuation. Suitable training, if needed, and
regular drills should be scheduled to assess how effective the emergency
plans are. Regular drills and training helps in preventing as well as handling
an emergency in time. It reduces panic among the people and helps them
use their heads instead of adding to chaos. Evacuation plan also helps in
eliminating or minimising the risks to injury and life.
General Emergency Evacuation Procedure
l Alert everyone by activating the nearest alarm and shout the alert clear and loud. Use any other
procedure set by the safety policy of the workplace.
l In response to the alarm or emergency call/shout out employees should immediately stop all
the work and collect personal valuables.
l Ensuring one's own safety, one should assist others who might be in immediate danger or need
any immediate aid.
l Ensuring one's own safety and if necessary, then check or curb any activity that may pose threat,
become hazardous or cause damage if left unattended during evacuation.
l Comply to the emergency instruction issued by designated control personnel until you reach to
the safety.
l Assist with the general evacuation if directed to do so by emergency control personnel.
l Follow emergency procedures and instruction to provide assistance to disabled, physically
challenged, elderly people.
l In case of fire, avoid taking elevator to evacuate a building. Use emergency staircase or any
stairs for that matter.
l Maintain strict discipline, keep calm and stay alert with your mind fully present on the current
situation until you reach the evacuation assembly area.
l Stay in the evacuation assembly area until the signal of all clear is conveyed by the authority.
229
Web Applications and Security 5
Emergency Evacuation Plan
Emergency evacuation plan includes:
l Floor plans of the building or workplace.
l Maps of emergency exit paths.
l Location of emergency equipment.
l System map of electricity connections, generator sites and exits (stairs, doorways etc.)
230
5 Web Applications and Security
l Lists the findings of the risk assessments and countermeasures of any risks.
l Includes the training and drill calendar for regular awareness on the workplace hazards,
emergencies and safety procedures.
l It states for whom the policy is meant for in what way. (E.g. children, elderly, disabled, patients,
management etc.)
l Includes work health safety measure observed by the workplace.
l Clearly defines specific procedures against each potential emergency.
l Describes the control hierarchy of individuals and designated chain of command for
emergency procedures to execute along with their duties and powers in such situations.
l Includes policy review plan to ensure that policy remains updated over the period of since it is
drafted or renewed last.
231
Web Applications and Security 5
Health related emergencies can occur at common workplaces like a desk and chair as well as
dangerous work environments like chemical plants, mines, oil-rigs and medical research labs etc.
Workers in factories may be exposed to smoke, poisonous gases, extreme heat, extreme cold,
radiations, intense lighting, high decibel noise and extreme physical exertion. Careful, efficient and
regular safety measures can only protect workers from the impending harm.
Workspaces during a pandemic: Due to the recent COVID-19 pandemic, the entire world had
almost come to a halt. Still, as of this writing, the threat still looms and we are forced to practice
strict safety measures since no definite cure has been devised. The workplaces need to be kept safe
during this pandemic as the lockdown has been relaxed and world business and economy are
resuming back to normal. During this time, safety measures mandated by the government
agencies need to be observed strictly such as social distancing, using masks, regular sanitising and
following other related safety measures to keep infection at bay. Workplaces need to ensure that
employees follow the safety rules strictly and if not there should be suitable penalties to set serious
examples. While commuting between our residence and workplace, we need to follow safety
guidelines as we move on crowded places and closed places such as buses and other means of
public transport.
232
5 Web Applications and Security
Countermeasures to Hazards
Risk assessment: Analysing and assessing risk factors to identify possible risks and potential
dangers help in devising effective safety measures.
Emergency plans: Emergency exits and general evacuation procedures should be in place to
ensure safety when sudden emergency strikes. Trained personnel and educated staff make the
emergency plan execution efficient.
Regular checks and tests: Regular monitoring of workplaces, mock drills, quizzes and awareness
sessions empower the workers in managing themselves and help others during emergency.
Healthy Living
Workplace safety is the combined responsibility of the organisation and workers. But, as an
individual one should take care of one's health and physical wellbeing. A working person should
follow some sort of health discipline and fitness regime. Depending on the nature of work, daily
routine and available time, one should devise a plan related to diet, physical health and mental
strength. Some common ways to healthy living are listed here:
Mild exercises: They help in keeping fit and get rid of physical stress.
Yoga, good reading and meditation: These are the ways to keep mental stress at bay and develop
a positive mind set. A strong and positive mind develops impressive physical appearance too.
Sports, jogging and gym: Some people play some sports, go for jogging or visit gym regularly as
a hobby to keep fit. Playing a sport that involves physical exercise, running and any game like
chess, sodoku etc. that tweaks one's mental faculties are best practices to stay healthy.
Healthy eating: Eating almost everything one likes but in right measure and frequency is the key
to healthy eating. Having some sort of discipline in eating brings out good physical results and add
to the impressive personality. Avoiding temptations like indulgence in drinking and smoking is
good. An occasional cheers is no harm but smoke and joints should be a big and strict no-no!
Basic human values: Observing basic human values such as humility, respectfulness, respecting
other's perspectives, avoiding fruitless conflicts, being considerate, developing civic sense, clean
and good habits make you strong from inside and develop an effective and positive outlook.
EXERCISE
1. How do you ensure a healthy living being a student?
2. What is the importance of safety at workplace?
3. Describe some safety issues at school and how to prevent them?
4. Describe some common safety hazards.
5. What is a first aid kit? What is its significance? What are the contents of a standard
FAK?
6. Describe computer related ergonomics?
7. How can we prevent common accidents at workplace?
8. What are various types of workplace emergencies? Describe any 2.
9. What are some health hazards at workplaces?
10. How do sports and basic human values help in healthy living?
233
Web Applications and Security 5
WRITER: Shortcut Keys for Moving and Resizing Frames,
Graphics and Objects
Keyboard
Function
Shortcut
F2 or Enter or any key that produces If a text frame is selected: positions the
a character on screen cursor to the end of the text in the text
frame. If you press any key that produces
a character on screen, and the
document is in edit mode, the character
is appended to the text.
Alt+Arrow Keys Move object.
Alt+Ctrl+Arrow Keys Resizes by moving lower right corner.
Alt+Ctrl+Shift+Arrow Keys Resizes by moving top left corner.
Ctrl+Tab Selects the anchor of an object (in Edit
Points mode).
Keyboard
Function
Shortcut
Ctrl+Alt+Up Arrow Move the active paragraph or selected
paragraphs up one paragraph.
Ctrl+Alt+Down Arrow Move the active paragraph or selected
paragraphs down one paragraph.
Tab The heading in format "Heading X" (X = 1-9)
is moved down one level in the outline.
Shift+Tab The heading in format "Heading X" (X = 2-10)
is moved up one level in the outline.
Ctrl+Tab
At the start of a heading: Inserts a tab stop. Depending on the Window Manager in use,
Alt+Tab may be used instead.
To change the heading level with the keyboard, first position the cursor in front of the
heading.
Ctrl + F1 Show/hide the Excel Ribbon. Hide the ribbon to view more than 4 rows of data.
Ctrl + Tab Switch to the next open Excel workbook.
Ctrl + PgDown Switch to the next worksheet. Press Ctrl+PgUp to switch to the previous sheet.
Ctrl + H Display “Find and Replace” dialog box.
Ctrl + F Display the "Find" dialog box.
Ctrl + Home Move to the beginning of a worksheet (A1 cell).
Ctrl + End Move to the last used cell of the current worksheet, i.e. the lowest row of the
rightmost column.
F2 Edit the current cell.
Ctrl + Enter In cell editing mode, enter a new line (carriage return) into a cell.
Ctrl + ; Enter the current date. Press Ctrl + Shift + ; to enter the current time.
Ctrl + Shift + V Open the "Paste Special" dialog when clipboard is not empty.
Ctrl + Y Repeat (Redo) the last action, if possible.
Ctrl + A Select the entire worksheet.
Ctrl + Space Select the entire column.
Shift + Space Select the entire row.