0% found this document useful (0 votes)
251 views84 pages

Information Practices Class 12th

The document is a comprehensive study material for Class XII Informatics Practices, prepared by educators from Kashmir, covering topics such as computer networking, Visual Basic programming, DBMS fundamentals, and web application development. It includes detailed sections on networking concepts, transmission media, and various programming techniques, aligned with the latest JKBOSE syllabus. The material aims to provide students with essential knowledge and skills in informatics practices.

Uploaded by

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

Information Practices Class 12th

The document is a comprehensive study material for Class XII Informatics Practices, prepared by educators from Kashmir, covering topics such as computer networking, Visual Basic programming, DBMS fundamentals, and web application development. It includes detailed sections on networking concepts, transmission media, and various programming techniques, aligned with the latest JKBOSE syllabus. The material aims to provide students with essential knowledge and skills in informatics practices.

Uploaded by

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

Energized Study Material of

Informatics Practices XII

BY

Mr. Sajad Akbar Rather (MCA/MEd)


I/C ICT DIET Sopore

Mr. Javeed Hassan Sofi (MCA/BEd)


Teacher GMS Brar Bandipora

Mr. Javaid Ahmad Wani (MCA/BEd)


Teacher MS Takiya Batapora Zone Kunzar

A complete energized Study material of Informatics


Practices for Class XII
Prepared by DSEK and SIE Kashmir

Copyright © 2020 by DSEK, SIE Kashmir

As per Latest Syllabus of JKBOSE


A complete energized Study material of Informatics Practices for Class XII

Contents
Structure Page No’s

Unit 1: Computer Networking & OSS 2


Networking 2
Need 3
Identifying Computers & Users Over a Network: 3
Internet 6
Switching Techniques 6
Transmission Media 7
Networking Devices 13
Network Topologies & Types 17
Network Technology 19
Network Security Concepts 20
Open Source Concepts 23

Unit 2: Visual Basic Programing 24


Basics 24
Visual Basic Loops 33
Visual Basic Functions 35
Forms 43

Unit 3: Fundamentals of DBMS 45


Basics 45
Data Types 48
Data Integrity 49
Constraints 50
Keys in Database 51
SQL 54

Unit 4: Internet and Web Application Development 66


Basics 66
HTML 70
Web Browser 81

************************

1
A complete energized Study material of Informatics Practices for Class XII

Unit 1
Computer Networking & OSS

Objectives:
In this Chapter you will learn about:
o Networking and Its Need
o Internet
o Switching Techniques
o Transmission Media
o Networking Devices
o Network Topologies & Types
o Network Technology
o Network Security Concepts
o Open Source Concepts

Networking:
We often need peripheral devices and data to be shared among various computers.
In fact, in your school's computer lab, you must have seen one printer which is
connected to only one computer, serving to the needs of all the computers in the
lab. How does this happen? This happens because all your lab's computers and
peripherals are forming a network. They are interconnected with each other
enabling you to send and receive data from one computer to another. Hence it can
be said that two computers are interconnected if they are able to exchange
information.

A network is any collection of independent computers that communicate with one


another over a shared network medium. In simple terms, a computer network is a
collection of two or more computers linked together for the purpose of sharing
information and resources. When these computers are joined in a network, people
can share files and peripherals such as modems, printers, backup drives, or CD-
ROM drives. Each computer on the network is called a node and hence, a network
is a series of points or nodes interconnected by communication paths (transmission
media). A network can be as small and simple as two computers that share a printer
or as complex as the world's largest network, the Internet. When networks at
multiple locations are connected using services available from phone companies,
people can send e-mail, share links to the global Internet, or conduct video
conferences in real time with other remote users. As companies rely on

2
A complete energized Study material of Informatics Practices for Class XII

applications like electronic mail and database management for core business
operations, computer networking becomes increasingly more important.

Needs:
1. Resource Sharing
2. Reliability
3. Cost Factor
4. Communication Medium

Resource Sharing means to make all programs, data and peripherals available to
anyone on the network irrespective of the physical location of the resources and the
user.

Reliability means to keep the copy of a file on two or more different machines, so
if one of them is unavailable (due to some hardware crash or any other) them its
other copy can be used.

Cost factor means it greatly reduces the cost since the resources can be shared.

Communication Medium means one can send messages and whatever the
changes at one end are done can be immediately noticed at another.

Identifying Computers & Users Over a Network:


As there are millions of computers in a computer network. Each computer is
identified by a unique address called I.P address (Internet Protocol Address) in a
computer network. The I.P Address is unique and universal. That is each computer
in a computer network (internet) is associated with this unique address and this
cannot be address of any other computer.
3
A complete energized Study material of Informatics Practices for Class XII

There are two versions of I.P address:

 IPv4 (IP version 4):- it is 32 bits or 4 bytes in length.


Example
248.128.88.12

 IPv6 (IP version 6):- it is 128 bits in length.


Example
AE20:0DB8:AC10:FE01:0000:0000:0000:0000

Another popular form of address is:

MAC(Median Access Control) Address:

 The MAC Address is also called Ethernet or Physical address and is


six bytes (48) bits in length.
 MAC Address is most often assigned by the manufacturer of network
interface card (NIC)
 The MAC address uniquely identifies an adapter on LAN and is 12
digits (48 bits) in length.
Example 00:0A:C9:12:C8:29
 Logically MAC addresses are used in the medium access control sub
layers of data link layer of the OSI (open system interconnection)
reference model as shown below.

Application layer
Presentation layer
Session layer
Transport layer
Network layer
DataLink LLC
layer MAC

Physical layer
(OSI model)

4
A complete energized Study material of Informatics Practices for Class XII

Domain Name System:


The domain name system (DNS) translates the internet domain names into I.P
addresses. As we know there are different servers with different domain names:

DNS Server(Root)

.com .edu .gov .pk .in


Commercial Educational Government Pakistan Indian

So DNS converts user understandable Domain Name into respective I.P address.

Domain name Resolution:


The way in which the host names are converted to their respective I.P addresses is
called domain name Resolution and is done by DNS (Domain Name System).
When we enter a domain name in an application that uses internet, the application
will issue a command to the operating system which in turn will convert domain
name into its I.P address.

www.facebook.com 255.216.198.32
(Domain name resolution)

5
A complete energized Study material of Informatics Practices for Class XII

Internet:
The Internet is a system of linked networks that are worldwide in scope and
facilitate data communication services such as remote login, file transfer, electronic
mail, the World Wide Web and newsgroups. The internet is made up of many
networks each run by a different companies and are interconnected at peering
points. It is really a network of networks spread across the globe, all of which are
connected to each other. This super network is a glorified WAN in many respects.
It connects many smaller networks together and allows all the computers to
exchange information with each other through a common set of rules for
communication. These rules are called protocols and the internet uses
Transmission Control Protocol/Internet Protocol (TCP/IP). Programs such as web
browsers, File Transfer Protocol (FTP) clients, and email clients are some of the
most common ways through which the users work on the Internet. With the
meteoric rise in demand for connectivity, the Internet has become a
communications highway for millions of users. The Internet was initially restricted
to military and academic institutions, but now it is a full-fledged conduit for any
and all forms of information and commerce. Internet websites now provide
personal, educational, political and economic resources to every corner of the
planet.

SWITCHING TECHNIQUES:
Switching techniques are used for transmitting data across networks.
Different types are :
1. Circuit Switching
2. Message Switching
3. Packet Switching

Circuit Switching
o Circuit switching is the transmission technology that has been used
since the first communication networks in the nineteenth century.
o First the complete physical connection between two computers is
established and then the data are transmitted from the source computer
to the destination.
o When a call is placed the switching equipment within the system seeks
out a physical copper path all the way from the sender to the receiver.
o It is must to setup an end-to-end connection between computers before
any data can be sent.
o The circuit is terminated when the connection is closed.
o In circuit switching, resources remain allocated during the full length
of a communication, after a circuit is established and until the circuit is
terminated and the allocated resources are freed.

6
A complete energized Study material of Informatics Practices for Class XII

Message Switching
o In this the source computer sends data or the message to the switching
circuit which stores the data in its buffer.
o Then using any free link to the switching circuit the data is send to the
switching circuit.
o Entire message is sent to the destination. It reaches through different
intermediate nodes following the “store and forward” approach.
o No dedicated connection is required.

Packet Switching
o Conceived in the 1960's, packet switching is a more recent technology
than circuit switching.
o Packet switching introduces the idea of cutting data i.e. at the source
entire message is broken in smaller pieces called packets which are
transmitted over a network without any resource being allocated.
o Then each packet is transmitted and each packet may follow any rout
available and at destination packets may reach in random order.
o If no data is available at the sender at some point during a
communication, then no packet is transmitted over the network and no
resources are wasted.
o At the destination when all packets are received they are merged to
form the original message.
o In packet switching all the packets of fixed size are stored in main
memory.

TRANSMISSION MEDIA:
A transmission medium (plural media) is one which carries a signal from one
computer to another. It is also known as communication channel. Transmission
medium can be wired or wireless. We also name them as Guided and Unguided
Media respectively. Wired transmission media includes twisted pair cable, Ethernet
cable, coaxial cable and optical fibre whereas wireless transmission media includes
microwave, radio wave, satellite, infrared, Bluetooth, WIFI etc.

Wired transmission media:


The wired or guided transmission media physically connects the two computers.
The data signal physically gets transferred from the transmitting computer to the
receiving computer through the wired transmission medium. Some of the wired
transmission media are discussed below:

7
A complete energized Study material of Informatics Practices for Class XII

1. Twisted Pair Cable


o These cables consist of two insulated copper wires twisted around each
other in a double helix.
o Twisting of wires reduces crosstalk which is bleeding of a signal from
one wire to another.

Types:
o Unshielded Twisted Pair (UTP)
o Shielded Twisted Pair (STP
STP offers greater protection from interference and crosstalk due to shielding.
But it is heavier and costlier than UTP.

USE:
o In local telephone communication
o For digital data transmission over short distances upto 1 km

Advantages:
o Easy to install and maintain
o Simple
o Inexpensive
o Low weight
o Suitable for small (Local) Networks

Disadvantages:
o Not suitable for long distance due to high attenuation.
o Low bandwidth support.
o Low Speed

2. Coaxial cable:
o Coaxial cable consists of a solid copper wire core surrounded by
plastic cladding shielded in a wire mesh.
o Shield prevents the noise by redirecting it to ground.
Types:
Coaxial cable comes in two sizes which are called thinnet and thicknet.

8
A complete energized Study material of Informatics Practices for Class XII

o Thicknet : segment length upto 500 m


o Thinnet : segment length upto 185 m

USE: In TV channel communication

Advantages:
o Better than twisted wire cable.
o Popular for TV networks.
o Offers higher bandwidth & Speed

Disadvantages:
o Expensive than twisted wires.
o Not compatible with twisted wire cable.

3. Optical Fibres:
o Thin strands of glass or glass like material designed to carry light from
one source to another.
o Source converts (Modulates) the data signal into light using LED
(Light Emitting Diodes) or LASER diodes and send it over the Optical
fiber.

It consists of three parts:


1. The core: glass or plastic through which the light travels.
2. The cladding : covers the core and reflects light back to the core
3. Protective coating : protects the fiber

Advantages
o Not affected by any kind of noise.
o High transmission capacity
o Speed of Light
o Suitable for broadband communication
Disadvantages

9
A complete energized Study material of Informatics Practices for Class XII

o Installation requires care.


o Connecting two Optical fibers is difficult.
o Optical fibers are more difficult to solder
o Most expensive

Wireless Transmission Media:


Wireless or unbounded or unguided media transport electromagnetic waves
without using a physical conductor. The signals are broadcasted through air or
water and thus are available to anyone that has a device capable of receiving them.
Some of the wireless media are:

Bluetooth:
Bluetooth technology is named after herald Bluetooth and has a range of 10 meters
this type of wireless technology is ideal for mobile battery operated devices. This
type of technology depends on two basic things.
1) radio frequency.
2) Bluetooth software

So the Bluetooth is a short range wireless technology used for personal area
network (pan). Bluetooth implementation normally occurs with 4 pin digit.
Infrared.
Infrared technology allows the computing devices to communicate via short range
wireless signals. Infrared communication occurs within short range distance and
10
A complete energized Study material of Informatics Practices for Class XII

has a range of less than 5 meters. Unlike Bluetooth the infrared signals cannot
penetrate walls and has less data rate as compared to Bluetooth technology, the
various disadvantages of infrared technology are as:

Blocked by materials: people ,walls etc


Short range: less than 5 meters.
Light, weather, rain, fog sensitive.
Low data rate.

Radio based communication:


This type of communication uses radio signals and travel over the frequency range
of 100 kHz to 20 GHz. There are three types of radio frequency propagation.

Grounded wave propagation:


Here the propagation fallows the curvature of earth.

Ionosphere propagation:
In this type of propagation the signals are send to ionosphere where they are
reflected back to the earth.

Line of sight propagation:


In this propagation transmission occurs in the line of sight that is the receiving
station must be in the view of the transmitting station.

11
A complete energized Study material of Informatics Practices for Class XII

Microwaves:
Microwaves are transmitted from the transmitters placed at very high towers to the
receivers at a long distance.

Microwaves are transmitted in line of sight fashion, and also propagated through
the surfaces.

Advantages:
o Maintenance easy than cables.
o Suitable when cable cannot be used.

Disadvantages:
o Repeaters are required for long distance communication.
o Less Bandwidth available.

Satellite:
Geostationary satellites are placed around 36000 KM away from the earth‟s
surface. In satellite communication transmitting station transmits the signals to the
satellite. (It is called up-linking). After receiving the signals (microwaves) it
amplifies them and transmit back to earth in whole visibility area. Receiving
stations at different places can receive these signals. (It is called down-linking).

12
A complete energized Study material of Informatics Practices for Class XII

Advantage
o Area coverage is too large
Disadvantage
o High investment

NETWORK DEVICES:
For efficient working of any network, many devices are required. Some of the
common network devices are discussed below:

Modem
o A modem is a computer peripheral that allows you to connect and
communicate with other computers via telephone lines.
o Modem means Modulation/ Demodulation.
o Modulation: A modem changes the digital data from your computer into
analog data, a format that can be carried by telephone lines.
o Demodulation: The modem receiving the call then changes the analog signal
back into digital data that the computer can digest.
o The shift of digital data into analog data and back again, allows two
computers to speak with one another.

External Modem Internal Modem

RJ- 45 Connector:
RJ-45 is short for Registered Jack-45. It is an eight wire connector which is
commonly used to connect computers on the local area networks i.e., LAN.

13
A complete energized Study material of Informatics Practices for Class XII

Network Interface Cards (Ethernet Card):


A network card, network adapter or NIC (network interface card) is a piece of
computer hardware designed to allow computers to communicate over a computer
network. It provides physical access to a networking medium and often provides a
low-level addressing system through the use of MAC addresses. It allows users to
connect to each other either by using cables or wirelessly.

Repeaters:
A repeater is an electronic device that receives a signal and retransmits it at a
higher level or higher power, or onto the other side of an obstruction, so that the
signal can cover longer distances without degradation. In most twisted pair
Ethernet configurations, repeaters are required for cable runs longer than 100
meters.

Hubs:
A hub contains multiple ports. When a packet arrives at one port, it is copied to all
the ports of the hub. When the packets are copied, the destination address in the
frame does not change to a broadcast address. It does this in a rudimentary way, it
simply copies the data to all of the Nodes connected to the hub.

14
A complete energized Study material of Informatics Practices for Class XII

Bridges:
A network bridge connects multiple network segments at the data link layer (layer
2) of the OSI model. Bridges do not promiscuously copy traffic to all ports, as hubs
do, but learn which MAC addresses are reachable through specific ports. Once the
bridge associates a port and an address, it will send traffic for that address only to
that port. Bridges do send broadcasts to all ports except the one on which the
broadcast was received.

o Bridges learn the association of ports and addresses by examining the source
address of frames that it sees on various ports. Once a frame arrives through
a port, its source address is stored and the bridge assumes that MAC address
is associated with that port. The first time that a previously unknown
destination address is seen, the bridge will forward the frame to all ports
other than the one on which the frame arrived.
o Bridges come in three basic types:
o Local bridges: Directly connect local area networks (LANs)
o Wireless bridges: Can be used to join LANs or connect remote stations to
LANs.

Switches:
Switch is a device that performs switching. Specifically, it forwards and filters OSI
layer 2 datagrams (chunk of data communication) between ports (connected
cables) based on the Mac- Addresses in the packets. This is distinct from a hub in
that it only forwards the datagrams to the ports involved in the communications
rather than all ports connected. Strictly speaking, a switch is not capable of routing
traffic based on IP address (layer 3) which is necessary for communicating
between network segments or within a large or complex LAN. Some switches are
capable of routing based on IP addresses but are still called switches as a marketing
term. A switch normally has numerous ports with the intention that most or all of
the network be connected directly to a switch, or another switch that is in turn
connected to a switch.
15
A complete energized Study material of Informatics Practices for Class XII

Routers:
o Routers are networking devices that forward data packets between networks
using headers and forwarding tables to determine the best path to forward the
packets. Routers work at the network layer of the TCP/IP model or layer 3 of
the OSI model. Routers also provide interconnectivity between like and
unlike media (RFC 1812).
o A router is connected to at least two networks, commonly two LANs or
WANs or a LAN and its ISP's network.

Gateway:
A Gateway is a network device that connects dissimilar networks. It established an
intelligent connection between a local area network and external networks with
completely different structures.
The computers that control traffic within your company's network or at your local
Internet Service Provider (ISP) are gateway nodes. A network gateway can be
implemented completely in software, completely in hardware, or as a combination
of both. In the network for an enterprise, a computer server acting as a gateway
node is often also acting as a proxy server and a firewall server. Here a proxy
server is a node that is not actually a server but just appears to be so and a firewall
is a system designed to prevent unauthorized access to or from a private network.
A gateway is often associated with both a router, which knows where to direct a
given packet of data that arrives at the gateway, and a switch, which furnishes the
actual path in and out of the gateway for a given packet. It expands the
functionality of the router by performing data translation and protocol conversion.

You will sometimes see the term default gateway on network configuration screens
in Microsoft Windows.

In computer networking, a default gateway is the device that passes traffic from the
local subnet to devices on other subnets. The default gateway often connects a
local network to the Internet, although internal
gateways for local networks also exist.

16
A complete energized Study material of Informatics Practices for Class XII

NETWORK TOPOLOGIES AND TYPES:


Topology is the pattern of interconnection of nodes in a local area network(LAN).
The topology used helps to select the communication medium and the other
network devices. While choosing a topology, care has to be taken that the
installation cost is minimum, the network so designed should be reliable and
flexible. In simple terms the addition or reduction of nodes should be easy and also
fault detection and removal should be simple. Before we talk about topologies in
detail, let us learn about point to point link which has two ends transmitter and
receiver. The main characteristic of Point to Point link is that each transmitter
transmits to exactly one receiver and each receiver receives exactly form one
transmitter. The transmission might occur on a single medium i.e. single wire or
over separate wires.

Star Topology:
The type of network topology in which each of the nodes of the network is
connected to a central node with a point-to-point link in a 'hub' and 'spoke' fashion,
the central node being the 'hub' and the nodes that are attached to the central node
being the 'spokes' (e.g., a collection of point-to-point links from the peripheral
nodes that converge at a central node) – all data that is transmitted between nodes
in the network is transmitted to this central node, which is usually some type of
device that then retransmits the data to some or all of the other nodes in the
network, although the central node may also be a simple common connection point
(such as a 'punch- down' block) without any active device to repeat the signals.

17
A complete energized Study material of Informatics Practices for Class XII

Bus Topology:
The type of network topology in which all of the nodes of the network are
connected to a common transmission medium which has exactly two endpoints
(this is the 'bus', which is also commonly referred to as the backbone, or trunk) –
all data that is transmitted between nodes in the network is transmitted over this
common transmission medium and is able to be received by all nodes in the
network virtually simultaneously (disregarding propagation delays).

Ring Topology:
The type of network topology in which each of the nodes of the network is
connected to two other nodes in the network and with the first and last nodes
being connected to each other, forming a ring – all data that is transmitted between
nodes in the network travels from one node to the next node in a circular manner
and the data generally flows in a single direction only.

Computer Networks:

18
A complete energized Study material of Informatics Practices for Class XII

A communications network is two or more computers connected to share data and


resources are “networked.” The simple idea behind computer networking is to
allow users to access more information and give them access to devices not
directly attached to their “local” system, such as printers or storage devices.

Local Area Network (LAN):


A network covering a small geographic area, like a home, office, or building.
Current LANs are most likely to be based on Ethernet technology. For example, a
library will have a wired or a communications network is two or more computers
connected to share data and resources are “networked.” The simple idea behind
computer networking is to allow users to access more information and give them
access to devices not directly attached to their “local” system, such as printers or
storage devices.

Metropolitan Area Network (MAN):


A Metropolitan Area Network is a network that connects two or more Local Area
Networks or Campus Area Networks together but does not extend beyond the
boundaries of the immediate town, city, or metropolitan area. Multiple routers,
switches & hubs are connected to create a MAN.

Wide Area Network (WAN):


WAN is a data communications network that covers a relatively broad geographic
area(i.e. one city to another and one country to another country) and that often uses
transmission facilities provided by common carriers, such as telephone companies.
WAN technologies generally function at the lower three layers of the OSI
reference model: the physical layer, the data link layer, and the network layer.

NETWORK TECHNOLOGY:

1. Ethernet
Ethernet is a type of network developed by Xerox in the late 1970.While Internet
is a global network, Ethernet is a local area network (LAN). Ethernet uses a
communication concept called datagrams to get messages across the network. The
Ethernet datagrams take the form of self-contained packets of information. These
packages have fields containing information about the data, their origin, their
destination and the type of data. The data field in each package can contain up to
1500 bytes.

19
A complete energized Study material of Informatics Practices for Class XII

2. Bluetooth:
Bluetooth technology is named after herald Bluetooth and has a range of 10 meters
this type of wireless technology is ideal for mobile battery operated devices. This
type of technology depends on two basic things.
1) radio frequency.
2) Bluetooth software

So the Bluetooth is a short range wireless technology used for personal area
network (pan). Bluetooth implementation normally occurs with 4 pin digit.

3. Wi-Fi---Wi-Fi is short for Wireless Fidelity . Wi-Fi is a wireless technology


that uses radiofrequency to transmit data through the air. An Access Point is
a separate wireless unit, which has the ability to extend from the router to
maximize wireless reception. Up to 16 users can connect to one access point
.It allows several wireless clients to connect to a single device.Wi-fi hot spot
is defined as any location in which wireless technology both exists and is
available for use to consumers. Wi-fi was intended to be used for wireless
devices and LANS, but is now often used for internet access.

NETWORK SECURITY CONCEPTS:

Network Security

Network security consists of the policies adopted to prevent and monitor


unauthorized access, misuse, modification, or denial of a computer network and
network- resources. Network security involves the authorization of access to data
in a network, which is controlled by the network administrator. Users choose or are
assigned an ID and password or other authenticating information that allows them
access to information and programs within their authority. Network security covers
a variety of computer networks, both public and private, that are used in everyday
jobs; conducting transactions and communications among businesses, government
agencies and individuals. Networks can be private, such as within a company, and
others which might be open to public access. Network security is involved in
organizations, enterprises, and other types of institutions. It does as its title
explains: It secures the network, as well as protecting and overseeing operations
being done. The most common and simple way of protecting a network resource is
by assigning it a unique name and a corresponding password.

20
A complete energized Study material of Informatics Practices for Class XII

Network Threats
There are four primary classes of threats to network security as given below.

Unstructured threats:
Unstructured threats consist of mostly inexperienced individuals using easily
available hacking tools such as shell scripts and password crackers.

Structured threats
Structured threats come from hackers who are more highly motivated and
technically competent. These people know system vulnerabilities and can
understand and develop exploit code and scripts.

External threats
External threats can arise from individuals or organizations working outside of a
company. They do not have authorized access to the computer systems or network.
They work their way into a network mainly from the Internet or dialup access
servers.

Internal threats
Internal threats occur when someone has authorized access to the network with
either an account on a server or physical access to the network. According to the
FBI, internal threat accounts for 60 percent to 80 percent of reported incidents.

Virus
They are programs which can destroy or cause damage to data stored on a
computer system and to the computer itself! Virus program must be executed in
order to infect a computer system. Viruses can attach themselves to other programs
in order to ensure that this happens.

Worms
Worms operate differently to viruses. Worms can spread themselves to other
computers without needing to be transferred as part of a host program i.e. they do
not need carriers for infecting other computers. The first time a user may notice the
presence of a worm is when the computer‟s memory UNEXPECTEDLY fills up.

Trojan horse
Trojan horse, also known as Trojan, describes a list of computer threats that appear
to perform good functions, but actually performs malicious functions that allow
unauthorized access to the hosting machine. FOR EXAMPLE – If a program is
designed in such a way, it could open a gateway for hackers to control and attack
the computer of the user, then this said to be a Trojan horse.

21
A complete energized Study material of Informatics Practices for Class XII

Denial Of Service
It is a type of cybercrime in which a server is flooded by thousands of requests
from illegal users thus denying the access of service to authorized users. The main
aim of this crime is to make server busy which in turn is unable to provide the
service to authorized users.

Snooping
It is an unauthorized access to another person‟s data. Snooping can include casual
observance of an email that appears on another‟s computer screen or watching
what someone else is typing. The hackers can also use special software for
snooping the target computer.

Network Security Measures


Anti-virus
Antivirus (or anti-virus) software is used to safeguard a computer from malware,
including viruses, computer worms, and Trojan horses. Antivirus can detect,
prevent and clean up computer viruses which may attempt to infect your computer
system.

Firewalls
Firewalls play a vital role in providing network security and integrity. A fire wall is
a set of programs located on a network server that protects the network from the
users of other network.

OTHER FIREWALL PRIVATE NETWORK


NETWORK

Intrusion Detection
An Intrusion Detection System(IDS) is a device or software that monitors network
or system activities for malicious activities policy violations and produces
electronic reports to the management station. IDS can be either network based, host
based or application based, depending on where they are deployed .Irrespective of
their deployment, IDS function in a generic way. Input data from a system is
collected and processed into a manageable format. The data items are classified as
a threat or harmless. If a threat is detected, then a response is produced, usually in
the form of an alert to the system administrator.

22
A complete energized Study material of Informatics Practices for Class XII

OPEN SOURCE CONCEPTS


Open source software
Open source software refers to a program or software in which source code is
available to the general public for use and for modification from its original design.
Because the source code of open source software is continuously modified by new
programmers, a more bug (error) free software is produced.

The various examples of open source software are:


GNU, WWW ,Mozilla ,MySQL ,Open office etc.

OSI (Open Source initiative)


OSI is a nonprofit organization that promotes the integrity of the open source
software‟s. The main aim of OSI is to educate about the benefits of Open Source
Software‟s. The description of various Open Source Software are as below.

GNU
It is a UNIX like operating system developed by free software movement in
1984.The main objective behind GNU is to produce UNIX like operating system
that is free of cost. Anyone can download, modify and redistribute.

Firefox
Mozilla Firefox is a fast, full featured web browser, that allows us to access the
websites more fastly. It has also additional features that make us to use it
efficiently and can freely downloaded from the internet.

Open Office
Is leading open-source software which helps us in word processing, spread sheets,
presentation, database and more. It is available in all languages and works on all
computers. It can be downloaded and used completely free of charge for any office
purpose.

LINUX
Linux is the best known and most used open source operating system. In many
ways Linux is similar to other operating systems like Windows, OS having
graphical interface. But it is different from in many important ways. First, and
perhaps most importantly, Linux is open source software. The code used to create
Linux is free and available to the public to view, edit and for users to contribute to.

*****************************

23
A complete energized Study material of Informatics Practices for Class XII

Unit 2
Visual Basic Programming
Objectives:
In this Chapter you will learn about:
o VB Basics
o Visual Basic Loops
o Visual Basic Functions
o Forms

What is Visual Basic?


 Visual Basic is a tool that allows you to develop Windows (Graphic
User Interface - GUI) applications. The applications have a familiar
appearance to the user.

 Visual Basic is event-driven, meaning code remains idle until called


upon to respond to some event (button pressing, menu selection, ...).
Visual Basic is governed by an event processor. Nothing happens until
an event is detected. Once an event is detected, the code corresponding
to that event (event procedure) is executed. Program control is then
returned to the event processor.

Some Features of Visual Basic:

 Full set of objects - you 'draw' the application


 Lots of icons and pictures for your use
 Response to mouse and keyboard actions
 Clipboard and printer access
 Full array of mathematical, string handling, and graphics functions
 Can handle fixed and dynamic variable and control arrays
 Sequential and random access file support
 Useful debugger and error-handling facilities
 Powerful database access tools
 ActiveX support

24
A complete energized Study material of Informatics Practices for Class XII

 Package & Deployment Wizard makes distributing your


applications simple

Structure of a Visual Basic Application:


Application (Project) is made up of:
 Forms - Windows that you create for user interface
 Controls - Graphical features drawn on forms to allow user interaction (text
boxes, labels, scroll bars, command buttons, etc.) (Forms and Controls are
objects.)
 Properties - Every characteristic of a form or control is specified by a
property. Example properties include names, captions, size, color, position,
and contents. Visual Basic applies default properties. You can change
properties at design time or run time.
 Methods - Built-in procedure that can be invoked to impart some action to a
particular object.
 Event Procedures - Code related to some object. This is the code that is
executed when a certain event occurs.
 General Procedures - Code not related to objects. This code must be
invoked by the application.
 Modules - Collection of general procedures, variable declarations, and
constant definitions used by application. Steps in Developing Application

There are three primary steps involved in building a Visual Basic application:
1. Draw the user interface
2. Assign properties to controls
3. Attach code to controls

We‟ll look at each step.


1. Drawing the User Interface and Setting Properties
 Visual Basic operates in three modes.
 Design mode - used to build application
 Run mode - used to run the application
 Break mode - application halted and debugger is available
We focus here on the design mode.

2. Six windows appear when you start Visual Basic.


 The Main Window consists of the title bar, menu bar, and toolbar. The
title bar indicates the project name, the current Visual Basic operating
mode, and the current form. The menu bar has drop-down menus from
which you control the operation of the Visual Basic environment. The

25
A complete energized Study material of Informatics Practices for Class XII

toolbar has buttons that provide shortcuts to some of the menu options.
The main window also shows the location of the current form relative to
the upper left corner of the screen (measured in tips) and the width and
length of the current form.

 The Form Window is central to developing Visual Basic applications.


It is where you draw your application.

 The Toolbox is the selection menu for controls used in your


application.

26
A complete energized Study material of Informatics Practices for Class XII

 The Properties Window is used to establish initial property values for


objects. The drop-down box at the top of the window lists all objects in
the current form. Two views are available: Alphabetic and Categorized.
Under this box are the available properties for the currently selected
object.

 The Form Layout Window shows where (upon program execution)


your form will be displayed relative to your monitor‟s screen:

 The Project Window displays a list of all forms and modules making up
your application. You can also obtain a view of the Form or Code
windows (window containing the actual Basic coding) from the Project
window.

27
A complete energized Study material of Informatics Practices for Class XII

As mentioned, the user interface is „drawn‟ in the form window. There are two
ways to place controls on a form:

1. Double-click the tool in the toolbox and it is created with a default size on
the form. You can then move it or resize it.
2. Click the tool in the toolbox, then move the mouse pointer to the form
window. The cursor changes to a crosshair. Place the crosshair at the upper
left corner of where you want the control to be, press the left mouse button
and hold it down while dragging the cursor toward the lower right corner.
When you release the mouse button, the control is drawn.

 To move a control you have drawn, click the object in the form window
and drag it to the new location. Release the mouse button.
 To a control, click the object so that it is select and sizing handles
appear. Use these handles to resize the object.

Variables in VB:
Variables are used by Visual Basic to hold information needed by your
application. Rules used in naming variables:
 No more than 40 characters
 They may include letters, numbers, and underscore (_)
 The first character must be a letter
 You cannot use a reserved word (word needed by Visual Basic)
28
A complete energized Study material of Informatics Practices for Class XII

Visual Basic Data Types


Data Type Suffix
Boolean None
Integer %
Long (Integer) &
Single (Floating) !
Double (Floating) #
Currency @
Date None
Object None
String $
Variant None

Variable Declaration
There are three ways for a variable to be typed (declared):
1. Default
2. Implicit
3. Explicit

If variables are not implicitly or explicitly typed, they are assigned the variant type
by default. The variant data type is a special type used by Visual Basic that can
contain numeric, string, or date data.

Visual Basic Statements and Expressions:


The simplest statement is the assignment statement. It consists of a variable
name, followed by the assignment operator (=), followed by some sort of
expression.

Examples:
StartTime = Now
Explorer.Caption = "Captain Spaulding"
BitCount = ByteCount * 8
Energy = Mass * LIGHTSPEED ^ 2
NetWorth = Assets - Liabilities
The assignment statement stores information.

 Statements normally take up a single line with no terminator. Statements can


be stacked by using a colon (:) to separate them. Example:

StartTime = Now : EndTime = StartTime + 10

29
A complete energized Study material of Informatics Practices for Class XII

(Be careful stacking statements, especially with If/End If structures. You may not
get the response you desire.)

 If a statement is very long, it may be continued to the next line using the
continuation character, an underscore (_). Example:

Months = Log(Final * IntRate / Deposit + 1) / Log(1 + IntRate)

 Comment statements begin with the keyword Rem or a single quote ('). For
example:
Rem This is a remark
' This is also a remark
x = 2 * y ' another way to write a remark or comment

You, as a programmer, should decide how much to comment your code. Consider
such factors as reuse, your audience, and the legacy of your code.

Visual Basic Operators:


 The simplest operators carry out arithmetic operations. These operators in
their
order of precedence are:

Operator Operation
^ Exponentiation
*/ Multiplication and division
\ Integer division (truncates)
Mod Modulus
+- Addition and subutraction

 Parentheses around expressions can change precedence.

 To concatentate two strings, use the & symbol or the + symbol:

lblTime.Caption = "The current time is" & Format(Now, “hh:mm”)


txtSample.Text = "Hook this “ + “to this”

 There are six comparison operators in Visual Basic:

30
A complete energized Study material of Informatics Practices for Class XII

Operator Comparison
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
= Equal to
<> Not equal to
 The result of a comparison operation is a Boolean value (True or False).

 We will use three logical operators:

Operator Operation
Not Logical not
And Logical and
Or Logical or

 The Not operator simply negates an operand.


 The And operator returns a True if both operands are True. Else, it returns a
False.
 The Or operator returns a True if either of its operands is True, else it returns
a False.
 Logical operators follow arithmetic operators in precedence.

Visual Basic Branching - If Statements:


Branching statements are used to cause certain actions within a program if a
certain condition is met.

The simplest is the If/Then statement:


 If Balance - Check < 0 Then Print "You are overdrawn"
Here, if and only if Balance - Check is less than zero, the statement “You are
overdrawn” is printed.

 You can also have If/Then/End If blocks to allow multiple statements:


If Balance - Check < 0 Then
Print "You are overdrawn"
Print "Authorities have been notified"
End If
In this case, if Balance - Check is less than zero, two lines of information are
printed.

31
A complete energized Study material of Informatics Practices for Class XII

 Or, If/Then/Else/End If blocks:


If Balance - Check < 0 Then
Print "You are overdrawn"
Print "Authorities have been notified"
Else
Balance = Balance - Check
End If
Here, the same two lines are printed if you are overdrawn (Balance - Check < 0),
but, if you are not overdrawn (Else), your new Balance is computed.

 Or, we can add the ElseIf statement:


If Balance - Check < 0 Then
Print "You are overdrawn"
Print "Authorities have been notified"
ElseIf Balance - Check = 0 Then
Print "Whew! You barely made it"
Balance = 0
Else
Balance = Balance - Check
End If
Now, one more condition is added. If your Balance equals the Check amount
(ElseIf Balance - Check = 0), a different message appears.
 In using branching statements, make sure you consider all viable possibilities
in the If/Else/EndIf structure. Also, be aware that each If and ElseIf in a
block is tested sequentially. The first time an If test is met, the code
associated with that condition is executed and the If block is exited. If a later
condition is also True, it will never be considered.

Select Case - Another Way to Branch:


 In addition to If/Then/Else type statements, the Select Case format can be
used when there are multiple selection possibilities.
 Say we've written this code using the If statement:
If Age = 5 Then
Category = "Five Year Old"
ElseIf Age >= 13 and Age <= 19 Then
Category = "Teenager"
ElseIf (Age >= 20 and Age <= 35) Or Age = 50 Or (Age >= 60 and Age <= 65) Then
Category = "Special Adult"
ElseIf Age > 65 Then
Category = "Senior Citizen"
Else
32
A complete energized Study material of Informatics Practices for Class XII

Category = "Everyone Else"


End If

The corresponding code with Select Case would be:


Select Case Age
Case 5
Category = "Five Year Old"
Case 13 To 19
Category = "Teenager"
Case 20 To 35, 50, 60 To 65
Category = "Special Adult"
Case Is > 65
Category = "Senior Citizen"
Case Else
Category = "Everyone Else"
End Select
Notice there are several formats for the Case statement. Consult on-line help for
discussions of these formats.

Visual Basic Looping:


 Looping is done with the Do/Loop format. Loops are used for operations are
to be repeated some number of times. The loop repeats until some specified
condition at the beginning or end of the loop is met.
 Do While/Loop Example:
Counter = 1
Do While Counter <= 1000
Debug.Print Counter
Counter = Counter + 1
Loop
This loop repeats as long as (While) the variable Counter is less than or equal to
1000. Note a Do While/Loop structure will not execute even once if the While
condition is violated (False) the first time through. Also note the Debug.Print
statement. What this does is print the value Counter in the Visual Basic Debug
window. We'll learn more about this window later in the course.

 Do Until/Loop Example:
Counter = 1
Do Until Counter > 1000
Debug.Print Counter
Counter = Counter + 1
Loop
33
A complete energized Study material of Informatics Practices for Class XII

This loop repeats Until the Counter variable exceeds 1000. Note a Do Until/Loop
structure will not be entered if the Until condition is already True on the first
encounter.

 Do/Loop While Example:


Sum = 1
Do
Debug.Print Sum
Sum = Sum + 3
Loop While Sum <= 50
This loop repeats While the Variable Sum is less than or equal to 50. Note, since
the While check is at the end of the loop, a Do/Loop While structure is always
executed at least once.

 Do/Loop Until Example:


Sum = 1
Do
Debug.Print Sum
Sum = Sum + 3
Loop Until Sum > 50

This loop repeats Until Sum is greater than 50. And, like the previous example , a
Do/Loop Until structure always executes at least once.

 Make sure you can always get out of a loop! Infinite loops are never nice. If
you get into one, try Ctrl+Break. That sometimes works - other times the
only way out is rebooting your machine!

 The statement Exit Do will get you out of a loop and transfer program
control to the statement following the Loop statement.

Visual Basic Counting:


 Counting is accomplished using the For/Next loop.

Example
For I = 1 to 50 Step 2
A=I*2
Debug.Print A
Next I

34
A complete energized Study material of Informatics Practices for Class XII

In this example, the variable I initializes at 1 and, with each iteration of the
For/Next loop, is incremented by 2 (Step). This looping continues until I becomes
greater than or equal to its final value (50). If Step is not included, the default value
is 1. Negative values of Step are allowed.

 You may exit a For/Next loop using an Exit For statement. This will transfer
program control to the statement following the Next statement.

VISUAL BASIC FUNCTIONS:


 Visual Basic offers a rich assortment of built-in functions. The on-line help
utility will give you information on any or all of these functions and their
use. Some examples are:

Function Value Returned


Abs Absolute value of a number
Asc ASCII or ANSI code of a character
Chr Character corresponding to a given ASCII or ANSI code
Cos Cosine of an angle
Date Current date as a text string
Format Date or number converted to a text string
Left Selected left side of a text string
Len Number of characters in a text string
Mid Selected portion of a text string
Now Current time and date
Right Selected right end of a text string
Rnd Random number
Sin Sine of an angle
Sqr Square root of a number
Str Number converted to a text string
Time Current time as a text string
Timer Number of seconds elapsed since midnight
Val Numeric value of a given text string

Some of the built-in functions are implemented below:

String Function:
String function are used for manipulation of string

Space ():
The function returns the number of spaces you want to have in the string

35
A complete energized Study material of Informatics Practices for Class XII

Example:
Dim S1
S1= Space (20)

This will return a string with 20 spaces

Dim S2
S2 = “Hello”& space (15) & “sameer”

Output:- S2 ->Hello (15 spaces) sameer

Str Function:
The Str( ) Function converts numbers into strings

Syntax: Str ( Number )

Example:
Str (123)  Returns “123”

Right Function:
The Right( ) function selects the right most position of a string

Syntax: Right ( String, Length )

Example:
Dim S1, S2
S1 = “Applications”
S2 = Right (S1, 6) Returns “ations”
S2 = Right (S1, 8) Returns “ications”
S2 = Right (S1,20) Returns “Application”

Left Function ( ):
The Left() Function selects the leftmost portion of a string

Syntax: Left (String, Length)

Example:
Left (“Computer”,3)  Returns :- Com

Instr function:

36
A complete energized Study material of Informatics Practices for Class XII

The Instr function is used for searching strings within one string (i.e. search string)
to determine whether it contains another strings (i.e search string ).If the second
string is found the starting character location of that string is returned. If the second
string contains no character, the starting position is returned.

Syntax: Instr([start],string1,string2,[compare])

Example:
Dim string1,s1,op;
S1= “a”
String = “Computer And Internet”
P= Instr (1,String1,s1,1)
Print p
Output :- >> 10

Mid() Function:
The Mid Function returns a string containing a specified number of characters from
a string

Syntax: Mid (String, star,[Length])

Example:
Mid (“Computer Application “,1,4)
Returns >>“Comp”
Mid(“Computer Application”,10,4)
Returns >> “Appl”

Len ( ) Function:
The Len Function is Used To Determine the Length of a string

Syntax: Len (String)

Example:
Len (“Hello”)  Returns :- 5
Len (“Computer Application”)  Returns :- 21

Trim(), Ltrim(), Rtrim() Function:


These Functions remove spaces from string

Syntax:

37
A complete energized Study material of Informatics Practices for Class XII

Ltrim (String)
Ltrim (String)
Trim (String)

Example:
Dim a,b
A= “__ Computer”
B= Trim (a)
Print b
Output: >> Computer

Ucase and Lcase Function:


The Ucase converts a particular string to uppercase and Lcase converts the string to
lower case format

Syntax: Ucase (String)

Example:
Ucase (“CoMpUtEr AppLiCatIoN”)
Output>> COMPUTER APPLICATION
And
Lcase(“CoMpUtEr AppLiCatIoN”)
Output>> computer application

The Asc ( ) Function:


The Function Give us the ascii value of a particular character

Syntax: Asc (String)

Example:
asc(“C”) >> Returns = 67
asc (“City”) >> Returns = 67
Here we get the same output as this asc function considers the only ist letter of a
string

The strReverse Function:


This function returns a string in which the character order of a given string is
deserved

Syntax: strReverse (String)

38
A complete energized Study material of Informatics Practices for Class XII

Example:
StrReverse (“Hello”)
Output = olleh
StrReverse (“Hello Kashmir”)
Output = olleH rimhsak

Numeric Function:
The Numeric functions are also called mathematical functions which help us in
various mathematical calculations.

Sgn ( ) Function:
This Function Returns the sing of an integer or number

Syntax: sgn (Number)


If Number >0 Returns > 1
Number < 0 Returns > -1
Number = 0 Returns > 0

Example:
Sign (-12) Returns -1
Sign (0) Returns 0
Sign (14) Returns 1

Int ( ) Function :
This Function is used to find the integer value of a given number. If the number is
negative, it returns the first Negative number Equal to or less than the number.

Syntax:
int (number)

Example:
Int (9.8) Returns = 9
Int (-9.8) Returns = -10
Int (9.1) Returns = 9

Val ( ) Function:
The Val function returns the numbers contained in a string as a numeric value of
appropriate type

39
A complete energized Study material of Informatics Practices for Class XII

Syntax: val (String)


The val function stops reading the string at the first character it can‟t recognize as a
part of a number.

Example:
Val (“1125 Computers”) Returns = 1125
Val (“Computers 1125”) Returns = 0
Val (“34 and 25”) Returns = 34

Date Time Related Functions:

Date ( ) Function:
The date ( ) Function returns the date in mm/dd/yyyy format

Syntax: Date ( )

Example:
Dim a
a= date ( )
print a
Output: 02/08/2015

Day ( ) Function:
The day( ) Function returns the day by passing the date as argument

Syntax: Day ( Date )

Example:
Dim a,b
a= “02/11/2014”
b= day(a)
print b
Output: 02

Time( ) Function:
The time function returns a current system time.

Syntax: Time ( )

Example:
Dim a

40
A complete energized Study material of Informatics Practices for Class XII

a= Time ( )
print a
Output: 02:11:14 AM

Now( ) Function:

The Now( ) function returns the current system date and time

Syntax: Now ( )

Example:
Dim a
a= Now ( )
print a
Output: 02/11/2014 02:11:14

Month ( ) Function:
The Month ( ) Function returns the month by passing date as argument

Syntax: Month (Date)

Example:
Dim a,b
a= 02/11/2014
b= Month(a)
print b
Output: 11

Minute( ) Function:
The Minute function returns the minute by passing the time as argument

Syntax: Minute (Time)

Example:
Dim a
a= Minute (Time )
print a
Output: 33 (i.e. Current Minute of The Current System time)

41
A complete energized Study material of Informatics Practices for Class XII

MESSAGE BOX() AND INPUT BOX() FUNCTIONS:

Message Box()
As a name implies, it is a mechanism to show a small dialog, which pops up over
the existing application for displaying custom message

Example:
Dim a as integer
a=20
If a > 10 then
MsgBox(“Number is greater than 10”)
Else
MsgBox(“Number Is less than 10”)
end if

Output:

Input () Box Function:


The input box is used for displaying a message but besides that one extra
functionality it performs collecting user inputs. The input box gathers user data in
string form

Example:
Dim a
a=val (input box (“Enter the no”))
if a >=0 then
print “Positive Number”
else
print “Negative Number”
end if
Output:

42
A complete energized Study material of Informatics Practices for Class XII

FORMS:
Forms are the basic building blocks of a visual basic application. They are the
actual windows where the user interact while running an application. Forms have
their own Properties, Events and methods for controlling their appearances.
Visual basic supports two types of forms:

1. SDI (Single Document Interface )


2. MDI (Multiple Document interface)

1. SDI (Single Document Interface ):


When an SDI application such as notepad or WordPad executes, It can display only
one document at a time. If we have to open an another WordPad we have to open
new instance of WordPad

2. MDI (Multiple Document interface):


MDI application has one parent form and all other forms are child forms, these
child forms are contained within the parent form. With MDI Application, All the
child forms can be easily organized, For example, The entire group of forms can be
minimized just by minimizing the parent form.

In MDI application the parent form is known as MDI form. This MDI form is the
container for all the child forms of the application.

Creating an MDI Parent Form:


To make an application an MDI application the MDI form needs to be added to the
project for that, we start the new project > Select Project > Add MDI form or
choose MDI form from the add button.

After creating an MDI form, two key properties are set these are auto show
children property and scroll bar property and set these properties to true.

Setting up MDI Child Form


A standard form is set to made MDI child form. TO make a standard form an MDI
child form, set the forms of MDI child property to true. When the MDI child
property is said true, the form can be displayed within the MDI parent form area.

Characteristics of MDI child Form:


 When an MDI child is maximized, The entire area of the parent form is filled
with the child form

43
A complete energized Study material of Informatics Practices for Class XII

 The caption of the child form is also merged with the caption of the parent
form.
 When an MDI child form is minimized, the icon of the minimized child form
is displayed in the area of the parent form.
 One MDI form cannot block other MDI child winds

Once an MDI application is created. With one MDI parent and no of MDI child
forms. The MDI form is usually made the startup form.

To make the MDI parent form to be the startup form, Go to the project menu and
select project properties and choose the name of MDI form as the startup project.

Now when we open the application, the MDI form will appear first.

MDI Form is dark grey in color as shown below.

*********************************

44
A complete energized Study material of Informatics Practices for Class XII

Unit 3
Fundamentals of DBMS
Objectives:
In this Chapter you will learn about:
o Basics
o Data Types
o Data Integrity
o Constraints
o Keys in Database
o SQL

Introduction:
Database is a collection of related information that is organized in such a way that
supports for easy access, modify and maintain data. The contents of a database are
obtained by combining data from all the different sources in an organization.
Generally, the database is managed by some special software packages known
as Database Management Systems (DBMSs). DBMSs are specially designed
applications to create connection between user and program, and to store data in an
organized manner. The purpose of DBMSs software is to allow the user to create,
modify and administration of database. Examples of database management systems
are:
Ms-Access, MySQL, PostgreSQL, SQLite, Microsoft SQL Server, Oracle, SAP,
dBASE, FoxPro, etc.

Relational data model:


The relational data model is a database model based on first-order predicate
logic(First Order Predicate Logic is one where the quantification is over simple
variables), formulated and proposed by Edgar F. Codd. in 1969. The first-order
predicate logic is a symbolized reasoning, in which statement is broken down into
a subject and a predicate. The predicate modifies the properties of the subject,
while in the first order logic, a predicate can only refer to a single subject. In the
relational data model, database is represented as collection of related tables. Each
table is termed as relation and has its unique name in the relational data model.
Tables are formed by using rows and columns. A row (horizontal subset) of a table
represents a tuple or record, while column (vertical subset) of a table represents an
attribute.

45
A complete energized Study material of Informatics Practices for Class XII

Relation:
In database, a relation means a 'table', in which data are organized in the form of
rows and columns. Therefore in database, relations are equivalent to tables.
For example
Relation: Student

Domain:
A domain is the original sets of atomic values used to model data. In data base
management and database, a domain refers to all the possible unique values of a
particular column.
For example:

1. The domain of gender column has a set of two possible values i.e, Male or
Female.
2. The domain of marital status has a set of four possible values i.e, Married,
Unmarried, Widows and Divorced.

Therefore, a domain is a set of acceptable values of a particular column, which is


based on various properties and data types. We will discuss data types later in this
chapter.

Basic Database concepts


Data :- Raw facts and figures which are useful to an organization. We cannot take
decisions on the basis of data.

Information:- Well processed data is called information. We can take decisions on


the basis of information

Field: Set of characters that represents specific data element.

Record: Collection of fields is called a record. A record can have fields of


different data types.

File: Collection of similar types of records is called a file.

46
A complete energized Study material of Informatics Practices for Class XII

Table: Collection of rows and columns that contains useful data/information is


called a table. A table generally refers to the passive entity which is kept in
secondary storage device.

Relation: Relation (collection of rows and columns) generally refers to an active


entity on which we can perform various operations.

Database: Collection of logically related data along with its description is termed
as database.

Tuple: A row in a relation is called a tuple.

Attribute: A column in a relation is called an attribute. It is also termed as field or


data item.

Degree: Number of attributes in a relation is called degree of a relation.

Cardinality: Number of tuples in a relation is called cardinality of a relation.

Example:
Relation: Student

Fields (Attributes/Columns):- AdNo, Name, Class, Section and Average.


Tuples (Rows/Records):

Domain: Possible values of section are ('A','B','C','D')


Degree: 5 (Number of columns).
Cardinality: 6 (Number of rows).

47
A complete energized Study material of Informatics Practices for Class XII

KEYS:
Keys are an important part of a relational database and a vital part of the structure
of a table. They help enforce integrity and help identify the relationship between
tables. There are three main types of keys - candidate keys, primary keys, foreign
keys and alternate keys.

Primary Key: Primary key is a key that can uniquely identifies the records/tuples
in a relation. This key can never be duplicated and NULL.

Foreign Key: Foreign Key is a key that is defined as a primary key in some other
relation. This key is used to enforce referential integrity in RDBMS.

Candidate Key: Set of all attributes which can serve as a primary key in a relation.

Alternate Key: All the candidate keys other than the primary keys of a relation are
alternate keys for a relation.

DBA: Data Base Administrator is a person (manager) that is responsible for


defining the data base schema, setting security features in database, ensuring
proper functioning of the data bases etc.

Data Types:
Data type is an attribute that specifies type of data of any object. Each column,
variable and expression has related data type in SQL. We would use these data
types while creating our tables. We would choose a particular data type for a table
column based on our requirement.

S.No Data Type Description


1 STRING Character string, has a fixed size up to 64
Kbytes.
2 DATE This field is used to store the date. It takes
3 bytes and actually contains the number of
days from January 1, Year 0000.
3 TIME This field contains time. It takes 3 or 4
bytes and contains number of seconds from
the start of the day (midnight) or number
seconds from 1 Jan 1970.
4,5 INTEGER, These types of fields are designed to store
UNSIGNED integer. Size may vary from 1 to 8 bytes. 8
bytes holds a very large number.

48
A complete energized Study material of Informatics Practices for Class XII

6,7 FLOAT, DOUBLE Four and eight bit numbers with floating
point. Size is fixed, but you can pick how
precise you want them to be.
8,9 TEXT, BINARY These are regular fields with a varying
size. You can store unlimited size (limited
by disk space) text or binary information .
10 IMAGE This is a BINARY field clone. Contains
GIF or JPEG image.
11 FILE This field is similar to TEXT, but contains
the name of the file in a file system.
Essentially this is a pointer to a file.

Data integrity:
Data integrity refers to maintaining and assuring the accuracy and consistency of
data over its entire life-cycle. Data integrity is the opposite of data corruption,
which is a form of data loss.

Types of integrity:

Entity integrity:
It concerns the concept of a primary key. Entity integrity is an integrity rule which
states that every table must have a primary key and that the column or columns
chosen to be the primary key should be unique and not null.

Referential integrity:
It concerns the concept of a foreign key. A foreign key is generally a primary key
from one table that appears as a field in another where the first table has a
relationship to the second. In other words, if we had a table A with a primary key
X that is linked to a table B where X was a field in B, then X would be a foreign
key in B.

Domain integrity:
It specifies that all columns in a relational database must be declared upon a
defined domain. A domain is a set of values of the same type. Domains are
therefore pools of values from which actual values appearing in the columns of a
table are drawn.

User-defined integrity:

It refers to a set of rules specified by a user, which do not belong to the entity,
domain and referential integrity categories.

49
A complete energized Study material of Informatics Practices for Class XII

FRONT END AND BACK END

Front End: User interface by using which the user enters data.

Back end: The layer where actually your tables are created and the data inserted is
stored.

The front-end is also referred to as the client-side and is sometimes considered


“web design”. The back-end of the web industry is often called the server-side, as
shown below.

The front-end is everything involved with what the user sees, including design
and some languages like HTML and CSS. The back-end, or the “server-side”, is
basically how the site works, updates and changes. This refers to everything the
user can‟t see in the browser, like databases and servers. Usually people who work
on the back-end are called programmers or developers. Back-end developers are
mostly worried about things like security, structure and content management.

Constraints:
Constraints keep user data constrained, thereby helping to prevent invalid data
from being entered into the database.

NOT NULL:
The constraint NOT NULL prevents NULL values from appearing in a column.

Example:
CREATE TABLE student (col1 INTEGER NOT NULL );
Here in the table student the null values will not be accepted by the table.

50
A complete energized Study material of Informatics Practices for Class XII

UNIQUE:
The UNIQUE constraint prevents duplicate values from appearing in the column.
It is implemented by creating a unique index on a column, as shown below.
CREATE TABLE student (col1 INTEGER UNIQUE);

Multiple NULL values can be inserted into a UNIQUE column. UNIQUE


constraint may consists of more than one column as shown below.

CREATE TABLE student2 (col1 INTEGER, col2 INTEGER, UNIQUE (col1, col2) );

While col1 or col2 themselves may not be unique, the constraint requires the
combination of col1 and col2 to be unique.

Null:
Null is a special marker used in Structured Query Language (SQL) to indicate that
a data value does not exist in the database. A good way to remember what null
means is to remember that in terms of information, "lack of a value" is not the
same thing as "a value of zero" For example, consider the question "How many
books does Sajad own?" The answer may be "zero" (we know that he owns none)
or "null" (we do not know how many he owns, or doesn't own). In a database table,
the column reporting this answer would start out with a value of null, and it would
not be updated with "zero" until we have ascertained that Sajad owns no books.

Example:

INSERT INTO Student VALUES (135, ‟Maggie‟, NULL, NULL);


or
INSERT INTO Student (SID, name) VALUES(135, ‟Maggie‟);

The Database Terms of Reference (keys in Database):


Keys are, as their name suggests, a key part of a relational database and a vital part
of the structure of a table. They ensure each record within a table can be uniquely
identified by one or a combination of fields within the table. They help enforce
integrity and help identify the relationship between tables. There are three main
types of keys, candidate keys, primary keys and foreign keys. There is also an
alternative key or secondary key that can be used, as the name suggests, as a
secondary or alternative key to the primary key.

Super Key:
A Super key is any combination of fields within a table that uniquely identifies
each record within that table.
51
A complete energized Study material of Informatics Practices for Class XII

Candidate Key:

A candidate is a subset of a super key. A candidate key is a single field or the least
combination of fields that uniquely identifies each record in the table. The least
combination of fields distinguishes a candidate key from a super key. Every table
must have at least one candidate key but at the same time can have several.
As an example we might have a student_id that uniquely identifies the students in a
student table. This would be a candidate key. But in the same table we might have
the student‟s first name and last name that also, when combined, uniquely identify
the student in a student table. These would both be candidate keys.

In order to be eligible for a candidate key it must pass certain criteria.


 It must contain unique values
 It must not contain null values
 It contains the minimum number of fields to ensure uniqueness
 It must uniquely identify each record in the table

Once your candidate keys have been identified you can now select one to be your
primary key.

Primary Key:
A primary key is a candidate key that is most appropriate to be the main reference
key for the table. As with any candidate key the primary key must contain unique
values, must never be null and uniquely identify each record in the table.

As an example, a student id might be a primary key in a student table, a department


code in a table of all departments in an organization. In the table below we have
selected the candidate key student_id to be our most appropriate primary key

Primary keys are mandatory for every table each record must have a value for its
primary key. When choosing a primary key from the pool of candidate keys always
choose a single simple key over a composite key.

52
A complete energized Study material of Informatics Practices for Class XII

Foreign Key:
A foreign key is generally a primary key from one table that appears as a field in
another where the first table has a relationship to the second. In other words, if we
had a table A with a primary key X that is linked to a table B where X was a field
in B, then X would be a foreign key in B.
An example might be a student table that contains the course_id the student is
attending. Another table lists the courses on offer with course_id being the primary
key. The 2 tables are linked through course_id and as such course_id would be a
foreign key in the student table.

Secondary Key or Alternative Key:


A table may have one or more choices for the primary key. Collectively these are
known as candidate keys as discuss earlier. One is selected as the primary key.
Those not selected are known as secondary keys or alternative keys.

53
A complete energized Study material of Informatics Practices for Class XII

For example in the table showing candidate keys above we identified two
candidate keys, student Id and first Name + last Name. The student Id would be
the most appropriate for a primary key leaving the other candidate key as
secondary or alternative key.

Structured Query Language (SQL):


SQL is a standard query language which is used to perform tasks such as update
data on a database, or retrieve data from a database.
Characteristics of SQL
1. It is very easy to learn and use.
2. Large volume of databases can be handled quite easily.
3. It is nonprocedural language. It means that we do not need to specify the
procedures to accomplish a task but just to give a command to perform the
activity.
4. SQL can be linked to most of other high level languages that makes it first
choice for the database programmers.

Operators in SQL:
The following are the commonly used operators in SQL

1. Arithmetic Operators +, -, *, /
2. Relational Operators =, <, >, <=, >=, <>
3. Logical Operators OR, AND, NOT

Data types of SQL


Just like any other programming language, the facility of defining data of various
types is available in SQL also. Following are the most common data types of SQL.

1. NUMBER e.g. Number(n,d) Number (5,2)


2. CHAR CAHR(SIZE)
3. VARCHAR / VARCHAR2 VARCHAR2(SIZE)
4. DATE DD-MON-YYYY
5. LONG
6. RAW/LONG RAW

Processing Capabilities of SQL


The following are the processing capabilities of SQL

1. Data Definition Language (DDL)


DDL contains commands that are used to create the tables, databases, indexes,
views, sequences and synonyms etc.

54
A complete energized Study material of Informatics Practices for Class XII

e.g: Create table, create view, create index, alter table etc.

Example:
CREATE
Creates new databases, tables and views from RDBMS
Syntax:
Create database tutorialspoint;
Create table article;
Create view for_students;

ALTER
Modifies database schema.
Syntax:
Alter table article add subject varchar;

This command adds new column in the Table article with the name subject of
varchar type.

DROP
Drops commands, views, tables, and databases from RDBMS.
Syntax:
Drop object_type object_name;
Drop database shahi;
Drop table article;
Drop view student;

2. Data Manipulation Language (DML)


DML contains command that can be used to manipulate the data base objects and
to query the databases for information retrieval.
e.g Select, Insert, Delete, Update etc.

SELECT/FROM/WHERE:
For example
Select authorname
From book_author
Where age > 50;

This command will yield the names of authors from the relation book_author
whose age is greater than 50.

55
A complete energized Study material of Informatics Practices for Class XII

INSERT INTO/VALUES:
This command is used for inserting values into the rows of a table relation.
Syntax:
INSERT INTO table (colum n1 [, colum n2, colum n3 ... ]) VALUES
(value1 [, value2, value3... ])
Or
INSERT INTO table VALUES (value1, [value2, ... ])

For example:

INSERT INTO book (Author, Subject) VALUES ("Sajad", "information practice");

This command will add new row in a table book with Sajad and information
practice as data items.

UPDATE/SET/WHERE:
This command is used for updating or modifying the values of columns in a table
relation.
Syntax:

UPDATE table_name SET column_name = value [column_name = value ...]


[WHERE condition]
For example:

UPDATE book SET Author="Sajad" WHERE Author="anonymous";

This command will replace author anonymous with Sajad in table book

DELETE/FROM/WHERE:
This command is used for removing one or more rows from a table relation.
Syntax:
DELETE FROM table_name [WHERE condition];

For example:
DELETE FROM book WHERE Author="unknown”

This command will delete all those rows where author field contains unknown as
data item.

56
A complete energized Study material of Informatics Practices for Class XII

3. View Definition:
DDL contains set of command to create a view of a relation.
e.g : create view

4. Data Control Language:


This language is used for controlling the access to the data. Various commands like
GRANT, REVOKE etc are available in DCL.

5. Transaction Control Language (TCL)


TCL include commands to control the transactions in a data base system. The
commonly used commands in TCL are COMMIT, ROLLBACK etc.

COMMIT command:
Commit command is used to permanently save any transaction into database.

Syntax:
commit;

Rollback command:
This command restores the database to last committed state. It is also use with
savepoint command to jump to a savepoint in a transaction.

Syntax:
rollback to savepoint-name;

Savepoint command:
Savepoint command is used to temporarily save a transaction so that you can
rollback to that point whenever necessary.

Syntax:
savepoint savepoint-name;

SQL Functions:
SQL provides large number of functions which can be categorized into two types
of functions.
o Single Row Function
o Multiple Row Function (Group Functions)

Single Row Function:


It operates on the single row and return one result per row.

57
A complete energized Study material of Informatics Practices for Class XII

o Character & String Function


The Various Characters Functions which work on characters are:

LOWER:
It takes any string or Column and converts it to lower case

LOWER(String/Column name)

UPPER:
It Works Opposite to Lower function

UPPER (String/Column name)

INIT CAP:
It Converts the First letter of each word to upper case and remaining letter to
lower case.

INIT CAP (String/Column name)

CON CAT:
It concatenates the two given strings
Example:

SQL> set serveroutput on;


declare
a varchar(12):= „Junaid Nazir‟;
b varchar(12):= „JayEnn‟;
c varchar(12):= Upper(a); Output
d varchar(40):= INTICAP(a);
e varchar(40):= Concat(a,b); JUNAID NAZIR
begin Junaid Nazir
dbms-output.put-line(c);
Junaid Nazir JayEnn
dbms-output.put-line(d);
dbms-output.put-line(e);
end;

Output:
JUNAID NAZIR
Junaid Nazir
Junaid Nazir JayEnn

58
A complete energized Study material of Informatics Practices for Class XII

Length:
It Returns the length of a string

LENGTH (String);
Example:
Length('text');

Output: 4
TRIM
This Function returns the trim heading and trailing characters or both from a
character string.There are two types of TRIM

RTRIM:
Example:
RTRIM(„ABCXY‟,„XY‟);

Output: ABC

LTRIM:
Example:
LTRIM(„xyzABC‟,„xy‟);

Output: zABC

Instr:
Returns the position of the first occurrence of substring substr in string str.
Syntax:
INSTR(str,substr)
Example:
INSTR('foobarbar', 'bar');

Output: 4

LPad
Syntax:
LPAD(str, len, padstr)
Returns the string str, left-padded with the string padstr to a length of len
characters. If str is longer than len, the return value is shortened to len characters.
Example:
LPAD('hi',4,'??');
Output: '??hi'

59
A complete energized Study material of Informatics Practices for Class XII

LPAD('hi',6,'??');
Output: '????hi'

LPAD('hi',1,'??');
Output: 'h'

Substr:
SUBSTR () is a synonym for SUBSTRING ().
Syntax:
SUBSTRING (str,pos)

Returns a substring from string str starting at position pos.


Example:
SUBSTRING('Quadratically',5);
Output: 'ratically'

o Number Function:

ABS (Absolute Function)


The ABS (value) Returns an Absolute and Positive Integer.
ABS (123) Returns 123
ABS (-456) Returns 456
ABS (234.567) Returns 234.567

CEIL Function:
This Function Returns the smallest integer (or Whole Number) That is
greater than or equal to a specific value.
Syntax:
CEIL(value, Precession)
Example:
Select CEIL (123),CEIL(-456);
CEIL (234.567) From Dual;
When we execute the above statement
CEIL(164.2) -> 164
CEIL(-456 ) -> -456
CEIL(234.567) -> 234

MOD:

60
A complete energized Study material of Informatics Practices for Class XII

This Function divides one numeric expression by another numeric expression


and returns the remainder
Syntax:
MOD(Value, divisor)
Example:
MOD (50,10)  0
MOD(-50,10)  0

Power:
This Function has the ability to raise a value to a given positive exponent
Syntax:
Power (value, exponent)
Example:
Power (10,3)returns  1000
Power (5,5)  returns  625

Round:
This function rounds off a number to a given number of digits of precision if
the value is –ve, Round() Returns a whole number containing precession
point
Example:
Round (value, precision)
Round (12345.678)  123456.7
Round (-3456.65, -2)  -3500

SQRT:
Finds the square root of a number
Syntax:
SQRT (Value)
Example:
SQRT (100)  10
SQRT (121)  11

o Date Functions:
These Functions allow us to generate and manipulate date data. We can use
data functions to determine the number of months between two dates etc.

MONTH_BETWEEN:
This Function returns the number of months between two dates date1 and
date2. This can be +v or negative if the date1 is larger then date2. The result
is +ve Otherwise result is negative

61
A complete energized Study material of Informatics Practices for Class XII

Syntax:
MONTH_BETWEEN(date1,date2)

ADD_MONTHS:
It returns the date by adding n number of calendar months to a given date.
Syntax:
ADD_MONTHS(date1,n)

NEXT_DAY:
This function finds the date of the next specified day of the weak(„char‟) i.e-
Sunday,Monday…….Saturday after the given date.
Syntax:
NEXT_DAY(date1,„char‟)
This function finds the date of the next special day of the weak.
NEXT_DAY(„26April-2012‟, „Monday‟)

LAST_DAY:
This Function returns the date of the last date of the month. i.e. It contains
the date of the last day of the month
Syntax:
LAST_DAY(MONTH)

o Conversion Function:
These Functions are used to convert data from one type to another
The data type conversion can be implicit or explicit

Implicit datatype Conversion:


When the oracle server automatically converts the data to the expected data
type, it is called Implicit Datatype Conversion

Oracle Server can automatically convert the following:


VARCHAR or CHAR  NUMBER
VARCHAR or CHAR  DATE
NUMBER  VARCHAR
DATE  VARCHAR

Explicit data type conversion:


Is done by using the conversion functions. Conversion functions convert one
data type to another
The various Functions are:-

62
A complete energized Study material of Informatics Practices for Class XII

TO_CHAR function is used to typecast a numeric or date input to character


type with a format model (optional).
Syntax
TO_CHAR(number1, [format], [nls_parameter])
For number to character conversion, nls _parameters can be used to specify
decimal characters, group separator, local currency model, or international
currency model.

For Example X will return the hexadecimal value of the specified number of
digits.

TO_NUMBER( )
The TO_NUMBER function converts a character value to a numeric
datatype. If the string being converted contains nonnumeric characters, the
function returns an error.
Syntax:
TO_NUMBER (string1, [format], [nls_parameter])
For Example YYYY will represent Year with 4 numbers

TO_DATE( )
The function takes character values as input and returns formatted date
equivalent of the same. The TO_DATE function allows users to enter a date
in any format, and then it converts the entry into the default format used by
Oracle 11g.
Syntax:
TO_DATE( string1, [ format_mask ], [ nls_language ] )

A format_mask argument consists of a series of elements representing


exactly what the data should look like and must be entered in single
quotation marks.

For Example YYY,YY,Y represents Last 3, 2, or 1 digit(s) of year.

Multiple Row Functions or Group Functions or Set Functions:


Many times the information we require from table doesn‟t relate to individual rows
but to set of rows. In such case we can use Set functions provided by the SQL
Server.

COUNT

63
A complete energized Study material of Informatics Practices for Class XII

The COUNT function returns the rows count in the table. When used with
WHERE clause, only number of rows which satisfy the condition will be returned.
Returns the number of non-null column values or whole
Rows.
SELECT COUNT(*) "Number of Countries"
FROM wf_countries

MAX
The MAX function returns the maximum value in the specified column. The MAX
function can also be used as the part of sub-query. It is Used with columns that
store any data type to return the maximum value, ignoring null values.
SELECT MAX(highest_elevation) "All time high"
FROM wf_countries;

MIN
The MIN function returns the minimum value in the specified column. The MIN
function can also be used as the part of sub-query. It is Used with columns that
store any data type to return the minimum value, ignoring null values.
SELECT MIN(lowest_elevation) "All time low"
FROM wf_countries;

SUM
The SUM function adds up the values in a specified column. The column must be
of one of numeric data types. The DISTINCT can be used to get the sum of only
unique values. It is used with columns that store numeric data to find the total or
sum of values, ignoring null values

SELECT SUM(area) "Total area" FROM wf_countries;

AVG

64
A complete energized Study material of Informatics Practices for Class XII

The AVG function returns the average of all the values in the specified column. As
with SUM function, the column must be of one of numeric data types. The
DISTINCT function can be used to get the average of only unique values. It is used
with columns that store numeric data to compute the average, ignoring null values
SELECT AVG (population) AVERAGE
FROM wf_countries;

***********************************

65
A complete energized Study material of Informatics Practices for Class XII

Unit 4
Internet and Web Application Development
Objectives:
In this Chapter you will learn about:
o Internet Basics
o HTML
o Web Browser

Communication:
Communication means to convey. In today's fast changing world, data needs to be
transferred efficiently, frequently and speedily. To move data at a fast speed and
that too with minimum data loss, networking plays an important role. Computer
networks have made a major impact on the society as a whole. As we are moving
ahead in the 21st century, the world seems to be converging. The merging of
computers and communication technology has changed the very perspective of
communication today. It has had a profound influence on the way the computer
systems are organized and used today. The old model of a single computer serving
all of the organization's computational needs has been replaced by one in which
large number of separate but interconnected computers do the same job. These
systems together form a computer network.

Internet:
The Internet is a system of linked networks that are worldwide in scope and
facilitate data communication services such as remote login, file transfer, electronic
mail, the World Wide Web and newsgroups. The internet is made up of many
networks each run by a different companies and are interconnected at peering
points. It is really a network of networks spread across the globe, all of which are
connected to each other. This super network is a glorified WAN in many respects.
It connects many smaller networks together and allows all the computers to
exchange information with each other through a common set of rules for
communication. These rules are called protocols and the internet uses
Transmission Control Protocol/Internet Protocol (TCP/IP). Programs such as web
browsers, File Transfer Protocol (FTP) clients, and email clients are some of the
most common ways through which the users work on the Internet. With the
meteoric rise in demand for connectivity, the Internet has become a
communications highway for millions of users. The Internet was initially restricted
to military and academic institutions, but now it is a full-fledged conduit for any
and all forms of information and commerce. Internet websites now provide

66
A complete energized Study material of Informatics Practices for Class XII

personal, educational, political and economic resources to every corner of the


planet.

Uses and Facilities of Internet:


 Exchange messages using e-mail (Electronic mail).
 Transfer files as well as software.
 Browse through information on any topic on web.

 Communicate in real time (chat) with others connected to the Internet.


 Search databases of government, individuals and organizations.
 Read news available from leading news groups.
 Send or receive animation and picture files from distant places.
 Set up a site with information about your company‟s products and services.

Hardware and Software requirement for Internet:


Any terminal to activate internet services on it requires a internet connection from
a Internet Service Provider (ISP). There are several Internet Service Providers
(ISP) in each locality.

There are many ways to get connected to the Internet.


 Through dial-up connection:
User is supposed to get connected to the internet after dialing up the number
used for connection.

 Through leased lines:


In this a dedicated line is laid specifically for connection.

 Though broadband :

67
A complete energized Study material of Informatics Practices for Class XII

In this you can get a broadband connection which provides a high


bandwidth for the internet connection.

 These days even wireless connections are available. For this you need to
have a Wi Fi card attached to your computer which can be useful if you do
not have proper place to lay down the wires.

World Wide Web (WWW):


The World Wide Web (“WWW” or simply the “web”) is a collection of electronic
documents (called web pages) that are linked together like a spider web. These
documents are stored on computers called servers located around the world.

Web Browser:
A web browser is software that allows us to view Web Pages. The most common
web browser is Microsoft Internet Explorer fallowed by Google chrome, Firefox,
opera etc. The Web browser communicates with the web servers via http protocol.

Web Address or URL Address:


Each website in the internet possesses at least one internet protocol (IP) address
also known as web address or URL (Uniform Resource Locator).
The IP address is 32 bit (Ipv4) or 128 bit(ipv6) and is given in user-friendly format
this we call URL (Uniform Resource Locator)

Example:
www.computeworld.com is a URL of computer world server
and
255.128.196.28 represent its (I.P address)

Protocols:
The protocols represent the set of rules and regulations which help in successful
communication between any two computers in a computer network. A protocol is
the “Language” of the network.

68
A complete energized Study material of Informatics Practices for Class XII

There are large numbers of protocols working in the network each with definite
function.
Example:
 http (hyper text transfer protocol) This helps in sending requests from client
to server

 FTP (file transfer protocol) This helps us in sending files across computer
network

 SMTP (Simple mail transfer protocol) This provides the email service to the
user etc

ISP(Internet Service Provider):


It refers to a company that provides Internet services, including personal and
business access to the Internet. Internet service providers may be organized in
various forms, such as commercial, community-owned, non-profit, or otherwise
privately owned. ISPs provide Internet access, employing a range of technologies
to connect users to their network. Available technologies have ranged from
computer modems to telephone lines, to television cable (CATV), wireless
Ethernet (Wi-Fi), and fiber optics.

Web Page & Types:


A web page is a web document that is suitable for the World Wide Web and the
web browser.

Types of Web pages:


There are two types of web pages
 Static web pages:
Static means unchanged or constant i.e. the content of static web page
does not change. Static pages are easy to maintain and does not need
higher technology.
 Dynamic web pages:
Dynamic web pages change their content after every second, minute or
hour. Making the web page live. It offers the highly customized visitor
options and is usually written in ASP,PHP,JSP etc
Search Engines:

69
A complete energized Study material of Informatics Practices for Class XII

A web search engine is a software system that is designed to search for information
on the World Wide Web. A search engine maintains the following processes in
searching information on WWW.
 Web crawling
 Indexing
 Searching
The various types of search engines are Google, yahoo, bing etc
Web Application:
A Web application (Web app) is an application program that is stored on a remote
server and delivered over the Internet through a browser interface. Web
applications are popular due to the easy availability of web browsers, and the
convenience of using a web browser. Common web applications include webmail,
online retail sales, online auctions, wikis, instant messaging services and many
other functions.

HTML:
HTML Stands for Hypertext markup language Used to design web pages. As its
name suggests, HTML is a Markup Language which means you use HTML to
simply "mark-up" a text document with tags that tell a Web browser how to
structure it to display.
The basic elements necessary to design web pages HTML are as:
 Window based computer system with any text editor like Notepad, WordPad
etc.
 Browser (internet explorer, opera etc)
There are two types of web pages designed with the help of HTML

Static web pages:


Static means unchanged or constant i.e. the content of static web page does not
change. Static pages are easy to maintain and does not need higher technology.

70
A complete energized Study material of Informatics Practices for Class XII

Dynamic web pages:


Dynamic web pages change their content after every second, minute or hour.
Making the web page live. It offers the highly customized visitor options and is
usually written in ASP,PHP,JSP etc

Page Structure of HTML document:


The HTML document is designed with the help of various HTML tags.
The complete document is written between <HTML> and </HTML>. The
<HTML> is the starting and the </HTML> is the Termination or finish/exit/end
tag.

<HTML>
<HEAD>
<TITLE>................................................</TITLE>
</HEAD>
<BODY>
~~~~~~~
~~~~~~~
~~~~~~~
</BODY>
</HTML>

Tags can be written in any case (Lower or Upper case) i.e. HTML is not case
sensitive.

Designing web pages:

Step1: Open notepad


Step2: Type the HTML tags as shown below.
<HTML>
<HEAD>
<TITLE> First Web page </TITLE>
<BODY>
Hello i am learning
</Body>
</HTML>
71
A complete energized Study material of Informatics Practices for Class XII

Step3: Click file >> Save >> Give file name with “.HTML” or “.htm” extension
(e.g sadaan.html)
Step4: Once the file is saved the file will be executed by the respective Default
internet Browser.

HTML Tags:
There are two types of HTML tags: Container tags and Empty tags

Container Tags:
Container tags are those tags which are used in pairs E.g.:-
<HTML> </HTML>
<Font> </FONT>
<BODY> </BODY>

Empty Tags:
Empty tag is a solo or single tag. It does not have any closing tag e.g:-
<br> => break tag
<Hr> => Header Tag etc

Heading Tags:
To display the text is some special size, heading tags are used. HTML provides six
different heading tags i.e.:- H1 to H6
<H1> Computer </H1>

<H2> </h2>
↓↓ ↓↓
<H6> </H6>
H1 is the highest size and H6 is the lowest size

Body Tags:
All other tags and text we want to show on web page are present within the
<BODY> tags
<BODY>
------
------
</BODY>
72
A complete energized Study material of Informatics Practices for Class XII

Attributes of <BODY> tag:


Some attributes of <BODY> tags are as below:

 Background color :
<body bgcolor=”pink”>
This will change the color of webpage to pink.

 Background:
<bodybackgroung =”maria.jpg”>
This will put image (*Maria) as background of the webpage

 Paragraph tag:
Paragraph tag is a container tag and is denoted by <P>----</p> this tag inserts a
line break in the web page with extra spacing paragraph alignment by default is left
but we align to the center or right as well.
Example:
<p align=”center”> computers </p>

 Horizontal rulers:
Horizontal rulers can be shown in web pages to identify some portion of text in a
particular way. It is denoted by <Hr> it is an empty tag.
Example:
<HTML><BODY><HR></BODY></HTML>
The various attributes of <Hr> tag are: Size, Width and No Shade

Text Formation Attributes:


The various text formatting attributes are as:-

 Font Tag:
Text can be shown in different styles and attractive looks with the help of <Font>
tag. It is a container tag with both opening and closing tags
Ie: <Font> _ _ _ _ _ _ _ _ _ _ _ _ _ </Font>
Attributes of Font tag:
Size:- It defines the size of the text.
73
A complete energized Study material of Informatics Practices for Class XII

Color:- It Defines the Colour of the text.


Face:- It defines the face value of font.
Example:
<HTML>
<HEAD>
</HEAD>
<BODY>
<Font Size = “4” Color = “Red” FACE= “4”>
I am learning HTML
</FONT>
</BODY>
</HTML>

 Bold Tag:
To represent the text in bold format we use bold tag i.e.<B>
Example:
<b> computer </b>
This will display Computer in bold format in The web Page.

 Italic tag:
we use the <i> tag to represent the text in italic format
Example:
<i> computer </i>

 Underline Tag:
<u> tag is used to define the text in underline format.
Example:
<u> Computers </u>

 Line break Tag:


To Create a line break we use <br/> tag
i.e. (br, space, forward, slash)
Example:
<HTML>
<HEAD>
</HEAD>
74
A complete energized Study material of Informatics Practices for Class XII

<BODY>
HELLO,I am learning HTML.<br/>
Computer is an electronic device <br/>
</BODY>
</HTML>

 Paragraph Tag:
To represent start a new paragraph we use <p> tag. It is a container tag
i.e.<p>.......</p> both opening and closing tags are to be used.

HTML <marquee> Tag:


The HTML <marquee> tag is used for scrolling piece of text or image displayed
either horizontally across or vertically down your web site page depending on the
settings.
Example:
<html>
<head>
<title>HTML marquee Tag</title>
</head>
<body>
<marquee>I am learning html</marquee>
<marquee direction="up"></marquee>
</body>
</html>
The direction of text “I am learning html will be from bottom to top”.

TEXT LINKS:
A webpage can contain various links that take you directly to other pages and even
specific parts of a given page. These links are known as hyperlinks.
Hyperlinks allow visitors to navigate between Web sites by clicking on words,
phrases, and images. Thus you can create hyperlinks using text or images available
on a webpage.

Linking Documents:
A link is specified using HTML tag <a>. This tag is called anchor tag and anything
between the opening <a> tag and the closing </a> tag becomes part of the link and
75
A complete energized Study material of Informatics Practices for Class XII

a user can click that part to reach to the linked document. Following is the simple
syntax to use <a> tag.
<a href="Document URL" ... attributes-list>Link Text </a>
Example:
<html>
<head>
<title>Hyperlink Example</title>
</head>
<body>
<p>Click following link</p>
<a href="http://www.greaterkashmir.com" >Greater Kashmir </a>
</body>
</html>
This will produce the following result, where you can click on the link generated to
reach to the home page of Greater Kashmir (in this example).

Download Links:
We can create text link to make your PDF, or DOC or ZIP files downloadable.
This is very simple; we just need to give complete URL of the downloadable file as
follows:
<html>
<head>
<title>Hyperlink Example</title>
</head>
<a href="http://www.jkbose.nic.in/syllabus.pdf">Download PDF File</a>
</body>
</html>
This will produce a link (Download PDF File) and will be used to download a file.

Designing Table In The HTML:


Tables play an important role in displaying data. Table arranges the data in well-
defined way.
A table is made up of rows and columns. The Horizontal area is row and the
vertical area is a column.

76
A complete energized Study material of Informatics Practices for Class XII

TR <td> <td> <td>

TR <td> <td> <td>

Table Tag:
We use table tag to define the structure of a table. We use <tr> and <td> tags to
represent the table row and table data respectively as shown above. Besides this we
use <TH> tag to define a header cell in table.

Attributes of the table tag:


Border :- Defines the size of border
Bgcolor :- Defines the background color
Width :- Defines the width of the table
Height :- Defines The height of the table

Examples:
<html><BODY>
<TABLE border =1 bgcolor= “green” width =40% Height = 40%>
<tr>
<td>
Computer
</td>
<td>
Hardware
</td> OUTPUT:
</tr>
<tr>
<td>
Software
</td>
<td>
Memory
</td>
</tr>
</table>
</BODY></html>
77
A complete energized Study material of Informatics Practices for Class XII

Lists:
Lists play an important role in defining the various types of lists in the web page
There are various types of lists
1. Ordered Lists(Numbered lists)
2. Unordered Lists(Bulleted lists)

We use <OL> tag for defining ordered lists


We use <UL> tag for defining unordered Lists.
Example:
Ordered List
Output(On Web Page)
Input
<BODY> INPUT DEVICES
INPUT DEVICES 1 Keyboard
<OL> 2 Mouse
<LI> Keyboard 3 Microphone
<LI> Mouse
<LI> Microphone
</OL>
</BODY>

Unordered List
Output(On Web Page)
<BODY>
OUTPUT DEVICES OUTPUT DEVICES
<UL> . Monitor
<LI>Monitor . Printer
<LI>Printer . Speaker
<LI>Speaker
</UL>
</BODY>

Image Tag:
Images are very important to beautify as well as to depict many complex concepts
in simple way on your web page. We can insert any image in your web page by
using <img> tag as shown below.

<img src="Image URL" ... attributes-list/>

78
A complete energized Study material of Informatics Practices for Class XII

The <img> tag is an empty tag, which means that, it can contain only list of
attributes and it has no closing tag.
Example:
<html>
<head>
<title>Using Image in Webpage</title>
</head>
<body>
<img src="sajad.jpg" alt ="Test Image" />
</body>
</html>
Note:
We can use PNG, JPEG or GIF image file based on our comfort but make sure we
specify correct image file name in src attribute. Image name is always case
sensitive.

 Alternate Text:
The alt attribute is a mandatory attribute which specifies an alternate text for an
image, if the image cannot be displayed as shown below.

<img src="Javeed.jpg" alt ="Test Image" />

 Set Image Width/Height (Resizing)


We can set image width and height based on our requirement using width and
height attributes. We can specify width and height of the image in terms of either
pixels or percentage of its actual size.
Example:
<html>
<head>
<title> Set Image Width and Height </title>
</head>
<body>
<img src="Sajad.jpg" alt="Test Image" width="150" height="100"/>
</body>
</html>

79
A complete energized Study material of Informatics Practices for Class XII

This will set the width and height of image to 150 and 100 respectively.

 Set Image Border:


By default, image will have a border around it, you can specify border thickness in
terms of pixels using border attribute. A thickness of 0 means, no border around
the picture.
Example:
<html>
<head>
<title>Set Image Border</title>
</head>
<body>
<p>Setting image Border</p>
<img src="Javeed.jpg" alt="Test Image" border="3"/>
</body>
</html>

 Set Image Alignment:


By default, image will align at the left side of the page, but you can use align
attribute to set it in the center or right.
Example
<html>
<head>
<title>Set Image Alignment</title>
</head>
<body>
<p>Setting image Alignment</p>
<img src="Sajad.jpg" alt="Test Image" border="3" align="right"/>
</body>
</html>

HTML Backgrounds:
The <body> tag has two attributes where you can specify backgrounds. The
background can be a color or an image.

80
A complete energized Study material of Informatics Practices for Class XII

 Background Color (Bgcolor)


The bgcolor attribute specifies a background-color for an HTML page. The value
of this attribute can be a hexadecimal number, an RGB value, or a color name:
Example:
<body bgcolor="#000000">
<body bgcolor= "rgb(0,0,0)">
<body bgcolor="black">
The lines above all set the background-color to black.

 Background Image (Background)


The background attribute can also specify a background-image for an HTML page.
The value of this attribute is the URL of the image you want to use. If the image is
smaller than the browser window, the image will repeat itself until it fills the entire
browser window.
Example
<body background="sajad.gif">
<body background="http://kashmir.edu/html/graphics/clouds.gif">
The URL can be relative (as in the first line above) or absolute (as in the second
line above). If you want to use a background image, you should keep in mind:

Will the background image increase the loading time too much?
Will the background image look good with other images on the page?
Will the background image look good with the text colors on the page?
Will the background image look good when it is repeated on the page?
Will the background image take away the focus from the text?

Web Browser:
A web browser is software that allows us to view Web Pages. The most common
web browser is Microsoft Internet Explorer fallowed by Google chrome, Firefox,
opera etc. The Web browser communicates with the web servers via http protocol.

Web Browser http request Web Server


http response

81
A complete energized Study material of Informatics Practices for Class XII

Web Address:
Each website in the internet possesses at least one internet protocol (IP) address
also known as web address.
The IP address is 32 bit (Ipv4) or 128 bit and is given in user-friendly format this
we call URL (Uniformly Resource Locator)
Example:
www.computeworld.com is a URL of computer world server and
255.128.196.28 (I.P address)

Web Server:
A web server is a special software capable of servicing http requests from the
client, so when we open a web site in our browser(called the client software) a
request is sent to the web server on the remote machine. The web server listens to
requests, process them and send responses back to client

Client Server architecture:


The Internet revolves around the client server architecture. The Computer which
sends the request is called the client and the computer which sends the responses is
called the server.

The client is usually a browser such as Internet Explorer interact with the server
using a set of instructions called protocols these protocols help in successful
communication between client and server

***************************

82
A complete energized Study material of Informatics Practices for Class XII

Book References
1. E Balagurusamy

2. IGNOU Study Material

3. McGRAW Abraham Silberschatz, Henry F. Korth, S. Sudarshan

4. Ronald J. Tocci Neal S. Widmer

QR Code References
1. E- Content developed by Sajad Akbar Rather (I/C ICT DIET SOPORE)

2. E- Content developed by Javeed Hassan Sofi (Tr. GMS Brar Bandipora)

3. www. easytuts4you.com

4. SuccessCDs (http://youtu.be/Kelm63Q-LO8)

5. Knowledge Gate (http://youtu.be/C-CzmtqMVfo/)

6. http://youtu.be/SJXTjSqjcLg

***************************************

83

You might also like