class 12th ip
class 12th ip
A computer network is a collection of interconnected computers and otherdevices which are able to
communicate with each other and share hardwareand software resources.
Why do we need networks?
Resource Sharing: data, hardware and software resources can be shared irrespective of physical
location.
Reliability: file can have two or more copies on different systems, in case if one is unavailable we can
use the other.
Reduced costs: sharing of resources, reduces cost.
Fast communication: exchange information fast.
Evolution of Network
US DOD started ARPANET , which was to connect computers at different departments In mid 80’s
NSFnet(National Science Foundation Network) was formed and in 90’s Internet evolved.
[[[[[[[
Internet Intranet
It cannot be owned by single company or It is privately owned.
individual
It is a world wide network of computer networks It is the generic term for a collection of private
around the globe computer networks within an organization
It uses a set of protocols called TCP/IP It also uses the same set of protocols as Internet.
Interspace: It is a client /server software program that allows multiple users to communicate online with real
time audio, video and text chat in dynamic 3D environment. It is a vision of what Internet will become.
ROUTER:-is a device that not only can be used to link or connect a smaller individual n/ws but it can handle
different protocols. It filters traffic on the basis of IPaddress(logical address) & route the network traffic
only to the segment where it is destined.
GATEWAY-is a device that connects dissimilar n/ws (e.g. to link Mac n/w and a PC n/w).It establishes an
intelligent connection between a LAN and external n/ws with completely different structure.
Bridge --- Similar Topology and similar protocol (uses MAC address (physical address))
Router ----Similar Topology and Different protocol (uses IP address (logical address))
Gateway -Different Topology and Different protocol
DIFFERENCES BETWEEN BRIDGE & ROUTER
1. Bridge links two n/ws of same protocol, where as Router can handle different protocols.
2. Router uses logical addresswhereas Bridge uses physical addresses.
BACKBONE NETWORKING:- is a n/w that is used to act as a backbone for connecting different types of LANs
together to form a WAN.I t is a collection of high-speed transmission media used to transfer information
between the major n/ws. An FDDI(Fiber Distributed Data Interface) ring is backbone n/w.
Guided Media-
Twisted-pair cable This is probably the most widely used cable for creating small
computer networks. It contains four twisted pairs covered in an outer shield.
An RJ-45 connecter is used to connect this cable to a computer. It is oftwo types:
Advantages-simple, easy to install and maintain, physically flexible, easily connected and inexpensive.
Disadvantages-Incapable of carrying signals over long distances, low bandwidth unsuitable for broad band
applications. It supports data rate 1MBPS to 10 MBPS.
Coaxial cable (coax)-
Used for network cabling and cable TV.
consists of a solid wire core surrounded by one or more
foil or wire shields, each separated by some kind of
plastic insulator.
2 types thicknet(segment length 500 mts) and
thinnet(segment length 185 meters)
Advantages-data transmission is better than twisted pair cables, can be used for broadband transmission
,and offers higher bandwidths upto 400 MBPS & can carry data for a larger distance.
Disadvantages-Expensive, less flexible, difficult to install as compared to twisted pair cables.
Wireless access points (APs or WAPs) are specially configured nodes on wireless local area networks
(WLANs). Access points act as a central transmitter and receiver of WLAN radio signals. Allows computers and
devices to communicate wirelessly. Allows data transfer to a wired network.
Wireless Communications: Data communication without the use of landlines
Radio-wave:- Radio waves have a frequency range of
3 KHz to 3GHz. Radio waves are used forcommunication over distances ranging
from a fewmeters (in walkie-talkies) upto covering an entirecity. These waves are
easy to generate, can travellong distances and can penetrate buildings
easily.That's why they are widely used for communication,both indoors and
outdoors. Cordless phones, AM andFM radio broadcast, Garage door openers
etc. areexamples of radio wave transmission.
Characteristics of Radio Wave Transmission:These waves are omni-directional,
so the transmitting and receiving antennasneed not be aligned.
Advantages : 1. Relatively inexpensive than wired media.
2. offers ease of communication over difficult terrain
Disadvantages 1. Insecure communication
2. It is susceptible to weather effects like rains, thunderstorms etc.
Micro waves have a frequency range of 300MHz (0.3 GHz) to 300 GHz.
Microwaves travel in straight lines and cannot penetrate any solid object. Therefore for long distance
microwave communication, high towers are built and microwave antennas are put on their tops.
Characteristics of Micro Wave Transmission:
Advantage :Offers ease of communication over difficult terrain as well as over oceans.
Free from land acquisition rights
Relatively inexpensive than wired media
Disadvantages-It is an insecure communication. The microwave propagation is susceptible to weather effects
like rains,storms etc.Bandwidth allocation is extremely limited.
The transmission is in straight lines so the transmitting and receiving
antennasneed to be properly aligned (line of sight transmission)
Satellite:-The frequency is higher than 3GHz.The earth station
consists of a satellite dish that functions as an antenna and
communication equipment to transmit and receive data from
satellites. Satellite links are used for very long distance wireless
communicationwhich may range from intercity to intercontinental.
Advantages-Area coverage is quite large.
Disadvantages-High investment cost. High atmospheric loses above 30 Ghz limit carrier frequencies.
Other Unguided Media
Infrared Signals -IR light waves with line-of-sight transmission. Retransmits over wide-area, to a number of
land-based stations. It cannot penetrate walls.
Laser- It requires direct line of sight. It is unidirectional and requires use of laser transmitter and a photo
sensitive receiver.
Bluetooth- Devices contain special chip. Short-range radio waves transmit between Bluetooth devices over
distance of 10 meters.
Crosstalk is a disturbance caused by the electric or magnetic fields of one telecommunication signal affecting
a signal in an adjacent circuit. In an telephone circuit, crosstalk can result in your hearing part of a voice
conversation from another circuit. Crosstalk is the "bleeding" of signals between one cable into another
TypesofNetworks:
LAN(LocalAreaNetwork):ALocalAreaNetwork(LAN)isa networkthatisconfinedto a relativelysmallarea.
Itisgenerallylimitedtoageographicareasuchaswritinglab,schoolor building. Itis generally
privatelyownednetworks overadistancenotmorethan5 Km.
MAN(MetropolitanAreaNetwork): MANisthenetworkscoveragroupofnearbycorporate officesoracity
andmightbeeitherprivateorpublic.
WAN(WideAreaNetwork): Thesearethenetworksspreadoverlarge distances,sayacross countriesoreven
continentsthroughcablingorsatelliteuplinks arecalledWAN.
PAN(PersonalAreaNetwork):APersonalArea Networkiscomputernetworkorganizedaround
anindividualperson.Itgenerallycoversarangeoflessthan10meters.PersonalAreaNetworks
canbeconstructedwithcables orwirelessly.
TOPOLOGY
Physical arrangement of devices connected to the network. It is the pattern of interconnection of nodes in a
n/w is called the topology There are no. of factors which should be considered before choosing the
topology(cost, flexibility and reliability.)
STAR TOPOLOGY:- It consists of central node to which all other nodes are
connected by a single path.
ADVTGS-
1. Failure of a single connection typically involves disconnecting one node from an otherwise fully
functionaln/w because of one device per conn connection.
2.Centralized control/problem
problem diagnosis
diagnosis. Ease in disconnecting the failing nodes.
3.Any given connection involves only the central node so access protocols are simple. simple
4. Ease of service.
DISADVGS:-
1.Long cable length as each node is directly connected to the center.
2.Difficult to expand as addition involves a connection all the way to central node.
3.Central node dependency, if central node fails entire n/w is down.
Bus Topology It consists of single length of transm
transmission medium onto which the various nodes are attached.
The transmission from any station travels the length of the bus, in both directions, and can be received by all
other stations. The bus has terminators at either ends which absorb the signal, removing
removin it from bus.
ADVTGS-
1.Short cable length & simple wiring layout.
2.Resilient architecture(has an inherent simplicity that make it very reliable)
3.Easy to extend.
4. If a device fails, network continues to function
5.Transmits in both directions
DISADVTGS-
1.Fault diagnosis is difficult
2.Fault isolation is difficult
3.Nodes must be intelligent. It ha to be decided who can use the n/w at any given time
4.Reconfiguration is necessary when backbone is extended using repeaters.
5. If the backbone cable le fails, the entire network effectively becomes unusable
Ring TopologyThisThis is also called loop. Each node is connected to two and only two neighbouring nodes
Cable forms a closed ring Transmits in only one (either "clockwise" or "counterclockwise").
If one device fails, all those after the device cannot function
Spans larger distance than bus network (LANs and WANs)
.ADVTGS-
1.Short cable length.
2.No wiring closet space required
3 Suitable for optical fibre.
DISADVTGS-
1.Node failure causes n/w failure. e.
2.Difficult to diagnose faults.
3.N/W reconfiguration is difficult.
Mesh Topology - Unlike each of the previous topologies, messages sent on a mesh network can take any of
several possible paths from source to destination.
COMMUNICATION PROTOCOLS
PROTOCOL-is
is a formal description of message formats and the rules that two or more machines must follow
to exchange those messages.
1. HTTP(Hyper Text Transfer Protocol)- A web page is created by using a specialised language called
HTML.(Hyper Text Markup Language).Web pages are requested by Internet users or clients from the
internet host or servers and are served or transported over the internet using a protocol called HTTP
2. FTP(File Transfer Protocol):-Files of any type can be transferred, although you may have to specify
whether the file is an ASCII or Binary file. It is a potent and popular way to share information over the
internet.
3. The communication protocol used by Internet is TCP/IP(Transmission Control Protocol/Internet
Protocol):-TCP is responsible for dividing the message into packets on source and reassembling packets at
destination . IP is responsible for handling the address of destination computer so that each packet is
routed to its proper destination. E.g. 135.62.128.91 .IP addresses are in the number
formatxxx.xxx.xxx.xxx,where each xxx is a number from 0 to 255.IP addresses identify the host computers
4.SLIP(Serial Line Internet Protocol):-that allows a computer to use the internet protocol with a standard
voice-grade telephone line and high speed modem. More recent versions of SLIP do some TCP and IP
header compression.
5. PPP(Point to Point Protocol):-allows a computer to use TCP/IP protocols and to be connected directly to the
net using a standard voice telephone line and high speed modem. In India VSNL uses the PPP protocol. It
handles error detection, supports multiple protocols, and allows IP addresses to be negotiated at connection
time.
6. SMTP(Simple Mail Transfer Protocol)-It is a simple ASCII protocol. This protocol (set of rules) enables
electronic mail to move smoothly through the internet. Because of SMTP, a UNIX machine can send mail to
a PC or Macintosh computer.
7. POP(Post Office Protocol):-is used to retrieve E-mail from a mail server .Using SMTP the outgoing mail is
transported or routed over the internet till it reaches its destination-the host computer on which the recipient
has a mail box.
8. IMAP(Internet Mail Access Protocol):- designed to help the user who uses multiple computers, perhaps a
workstation in the office ,a PC at home and a Laptop on the road.
What is the differences between POP3 and IMAP Mail Server?
Ans. IMAP is a standard protocol for accessing e-mail from a local server. A simpler e-mail protocol is Post
Office Protocol 3 (POP3), which download mail to the computer and does not maintain the mail on the
server.IMAP, e-mails are stored on the server, while in POP3, the messages are transferred to the client’s
computer when they are read.
VoIP- (Voice Over Internet Protocol) Delivery of voice communication & multimedia sessions over Internet
Protocol networks.
Telnet: It is an internet facility that facilitates remote login. Remote login is the process of accessing a
network from a remote place without actually being at the actual place of working.Software for remote login
is TeamViewer.
WWW:-(World Wide Web) It is a set of protocols that allows you to access any document on the net through
its URL . It also specifies the way – HTTP – to request and send a document over the Internet.
WEB BROWSER:-is a client application that requests,receives and display HTML pages. It is a software
program that your computer runs to communicate with web servers on the internet, which enables it to
download and display the web-pages that you request. The most popular browsers are –
1.INTERNET EXPLORER 2.Firefox 3. Google Chrome
Internet Service Provider (ISP) is a company that offers Internet connections for a fee. Examples are Tata,
Airtel, MTNL, BSNL, Reliance etc.
SEARCH ENGINES- You give a search engine a list of query and it returns to you a list of web pages that
contain those words. It provides an interface between the use and the underlying database e.g.Alta Vista is
one of the oldest search engines on the web. Eg. Bing , HOTBOT and Google
Domain names is a unique name assigned to a website. It is the address of the document’s web server. It
consists of multiple parts, separated by dots, which are read from right to left.
(i.e. www. internic. com)
Protocol top level domain second level domain
Domain Name Resolution refers to the process of obtaining corresponding IP address from a domain name.
Domain Name System (DNS) the naming system for IP addresses of companies.
The DNS servers maintain directory of IP addresses of all domain names registered on Internet and work out
to obtain corresponding IP address of given Domain name and returns it to operating system.
UNIFORM RESOURCE LOCATER(URL):-The technique usedto address documents on the Web is called URL. It
provides an addressing scheme which allow the browser to request about any document or web page. A URL
normally takes the form<protocol>://<web server name>/<directory name>/<filename>
For example :-http://www.microsoft.com/IE/index.htm
HOME PAGE(‘FRONT DOOR’):-The HomePage is the front door of the site and is set up to help viewers to find
whatever is of interest of them on that site. The URL of the homepage also serves as the URL of the web site
e.g. http://www.microsoft.com/ms.htm is a web site.
Web Scripting: - The process of creating and embedding scripts in a web page is known as Web
Scripting. Types of Scripts:-
(i) ClientSideScripts:-Clientsidescriptssupportsinteractionwithinawebpage.
E.g.VBScript,JavaScript, PHP(PHP‟SHypertextPreprocessor).
(ii) ServerSideScripts:-Serversidescriptingsupportsexecutionatserver–end.
E.g. ASP, JSP, PHP
Trojan Horses: It is a code hidden in a program such as a game or spreadsheet that looks safe to run but has
hidden side effects(destroying, damaging or altering information in background). It is a program on its own
&does not require a host program in which to embed itself. For e.g Christmas executable when executed
pops up with an animated figure of santa and in the background, extra code could be deleting files. They are
spread through e-mail or exchange of disks or information between computers.
Worms: Like a virus, a worm is also a self-replicating program. A worm differs from a virus in that it
propagates through computer networks without user intervention. Unlike a virus, it does not need to attach
itself to an existing program. It is a self-contained& does not require a host. Many people conflate the terms
"virus" and "worm", using them both to describe any self-propagating program.
Difference between Worm & Trojan Horse
Network Security- It refers to making efforts to make sure that only legal or unauthorized users and programs
gain access to network or network resources. Various methods to protect network are:
(a) Authorization: It determines whether the service provider has granted access to the web service to the
requestor. (Log-in ID)
(b) Authentication: It ensures that each entity involved in using a web service, is what it actually claims to be.
(Password)
(c) Firewall: to prevent unauthorized access to or from private network.
(d) Encrypted smart cards: A card that can generate a token that a computer system can recognise. Debit
card, Credit card,
How to prevent virus
Write protect your disksNever use disk without scanning
Use licensed software Password protect your PC
Make regular backupsInstall antivirus software and keep upto date
CRACKERS- They are the malicious programmers who break into secure systems.
HACKERS- They are more interested in gaining knowledge about computer systems and possibly using this
knowledge for playful pranks.
CYBER LAW- It is a generic term, which refers to all the legal and regulatory aspects of Internet and the
WWW. In India the cyber laws are contained in the IT Act 2000. The IT Act aims to provide the legal
infrastructure for e-commerce in India by governing the transactions through the Internet and other
electronic medium.
Cybercrime: An unlawful act where in the computer is either a tool or a target or both through Internet. These
could be the cybercrimes:
Tampering with computer source documents
Hacking
Publishing of information, which is obscene in electronic form
Child Pornography
Accessing protected system
Breach of confidentiality and privacy
India’s IT Act: It aims to provide the legal infrastructure for e-commerce in India by governing the transactions
through the Internet and other electronic medium.
IPR Issues(Intellectual Property): reflects the idea that its subject matter is the product of the mind or the
intellect and has commercial value. E.g. patents, trademarks, layout designs copyright etc.
OpenSourceConcepts:
OpenSourceSoftware:-Softwarewhosesourcecodeisavailableandwhichcanbemodified
copiedandredistributed.Itmaybefreeof costornot.
Freeware:-Thesoftwarethatisfreeofcostandcanbecopiedredistributedbut can’tbemodified
becausesourcecodeisnotavailable.Right to use software is limited to certain type of users. E.g. Microsoft
Internet Explorer
Shareware: -It is offered as trial version (for limited period of time) with certain features only available after
the license is purchased.EgWinZip. It can be redistributed but source code is not available.
Proprietary Software:-Softwarethat is neitherfreenoropen. Eg MS OFFICE
Its use is regulated and further distribution and modification is either forbidden or requires special
permission by the supplier. Source code is not available.
TipstosolveQuestionsbasedonNetworking
Network Design: - The aim ofthe network design is to minimize the load on the network backbone.The80-
20rule helpsto build agood networkdesign.ThisrulestatesthatinaLAN,80 percenttraffic
shouldbelocaland20percenttraffic shouldbeallowedacross the backbone.
Full Forms
FTP- File Transfer Protocol WLL – Wireless in Local Loop
CDMA- Code Division Multiple Access XML – Extensible or Extended Markup Language
TDM- Time Division Multiplexing. HTML- Hyper Text Markup Language
SMS- Short message Service MMS- Multimedia Messaging Service
SGML- Standard Generalized Mark-up Language WWW- World Wide Web
TCP/IP- transmission Control Protocol / Internet protocol HTTP- Hyper Text Transfer Protocol
LAN – Local Area Network URL – Universal or Uniform Resource Locator
WAN- Wide Area Network MAN- Metropolitan Area Network
GSM – Global system for Mobile Modem: Modulator/Demodulator
FM: Frequency Modulation AM: Amplitude Modulation
NFS: Network File Server SIM: Subscriber Identification Module
TAP: Terminal Access point SLIP- Serial Line Internet Protocol
PPP- Point to Point Protocol IDEA- International Data Encryption Algorithm
GNU- Not Unix FLOSS- Free/Libre/Open Source Software
EDGE-Enhanced Data rates for Global Evolution FSF- free software foundation
ARPANET- Advanced Research Project Agency Network W3C- World Wide Web Consortium
SIM card: Subscriber Identity module MAC: Media Access Control
NIC: Network Interface Card WSIWYG- What you see is what you get
ODBC- Open Database Connectivity PDF- Portable Document Format
VoIP- Voice Over Internet Protocol DHTML: Dynamic Hyper Text Markup Language
OSS- Open Source Software PHP: Hypertext Pre processor
GPRS- General Packet Radio Services PPP: Point to point protocol
TDMA- Time Division Multiplexing MMS- Multimedia Messaging Service
PAN-Personalised Area Network NFS: Network File Server
SMTP-Simple mail transfer Protocol Telnet- Remote Login
NSFNET- National Science Foundation Network OSI- Open Source Initiative
DNS- Domain Name Server POP- Post Office Protocol
IMAP- Internet Mail Access Protocol NNTP- Network News Transfer Protocol
PDA- Personal data Assistant ISP- Internet Service Provider
ISDN- Integrated Services Digital Network MIME- Multipurpose Internet Mail extensions
Wi-Fi – Wireless Fidelity
SQL
" whot is sQL 2
SQL (Structured Queny Language) is a programming
language desiged for managing dota in relati onal
database.SqL has a Variety oo 4anctions that
allow ds useng to read, manipulate, and chang e
data. Though sqL is commonly used by engineers
in seft ware devolopment, its also popula uilh
data analysts for afeaw reason :
"H% semantiolly eagy to understand md let.
Becauge it Can be used to access lange
amounts of data dineetly uhene tts slored,
aralysts don't have to copy data into olhen
aplicat'ons.
Compared to speread shet tools, ata
analysis done in SQL is easy to audit ond
Peplicate. or omaly etg,this means
meanS no more
looking for the aell euith he typo in the Brmula.
" SELECT* Example.
statement seleete all !he
Ihe lolouing sqLalestable:
Column.s from the
EXample - SELECT * FROM Sales;
"select columhs uise
Example - SELECI year,
month
west.
FROM Sales
Rename Qolumns
Example SELECT cuest AS "west Region"
FRoM Sales
" LIMIT Clause
Ihe LIMIT elause is used to spect'y the number
o records to petun
Example- SELECT*
FROM Sales
LIMIT 100
WHERE Clause
The wHERE clause is used to ken reconds.
If is uged to extraet only those reconds lhat
fulf:ll a specifted eonattion.
Example- SELECT *
FROM Sales
WHERE Country " Canoda;
" Comppison Operatong on numepical dota
The most basie any toftlter data te uting
Companison. operators. lhe easiect eway to
bndenstond
of them:
them is lo stant by loking at a ltst
Equal to
Not equal to
Ghreater than
Less than
Greaten thon or equal to =
Less than on equal tO
to
Exemple- . SELECT *
FROM Sales
WHERE City = kolkata";
SELECT *
FROM Sales
WHERE city != "kolkata" ;
SELECT *
FROM Saleg
WHERE Month >"Jonuany";
SELECT *
FROM Soles
WHERE Saleomount < 50000
Jou can. perlorm anithmetie in salusing the Some
operators you. cuould in Exeel: + -)*, ouever
in saL you Can ony perform anithmetie acogg
Columons on values in agiven row. To clanify you
Con only add values in multiple columns Arorn the
Same row together asing +-iyou want to od ad
Values acrogs multiple rocus, you'll need to use
9Pegate Panetins.
Exemple - SELECT yeor
months
west
South,
wegt +south As South.hsc
FROM Sales ;
Example.
SELECT Jear,
months
twest s
South,
west +south- 4year AS new.column
FROM Sales;
Example - SELECT year,
month
west
Southy
(west +sout)/2 AS Soulh uest-avg
FROM Sales j
CREATE TABLE
The cREATE TABLE statement is uged to cneate
anew toble in a.databage.
he IS NULL Cperator
lhe TS NULL operator is used to test fop empty
yalues CNULL values).
Example-,SELECT CustomerNome,corttactNome, Adtres
FROM Sales
WHERE Ad dress IS NULL 3
The IS NoT NULL Operator
The TS NOT NDÊL ope rator is used to test foo
non-empty yalues (NOT NULL Values).
Example -
SELECT cuskomenName, Catact Name , Addresg
FROM Saleg
WHERE Add ress IS NoT NULL;
" UPDATE Statement
The UPDATE stotement is used to madik he
existing peconds in atobel.
Example
UPDATE Sales
SET ContactNane =" Alan", city=" Goa"
WAERE Customer ID= 1;
UPDATE Maltiple Records
Hig the WHERE clausge that detepmines how many
pecopds enill be updated.
Example
UPDATE Sales
SET Postal Code =00000
WHERE Cotry =India" ;
Notesi
Be Carelall eken. upateing recopds. T you omit
the WHERE clause, ALL Peconds cuillbe updated!
DELETE State me nt
Te DELETE statemernt is used to delete exisling
pecords in a toble.
Example pEETE ROM Sales WHERE CustomerNarme =" Bob':
Delete Al Recopdg
I is possible to delete all roue in atable uthout
deleteing the table. This meang that the table
StnacBure ,attribates ,and inderes adl be itact:
Exmgle -
DELETE FROM toble_pame
"Altases
Aliases are used togve atabe, on a colun in
atable, atempoary name.
OR OPeratop
SELECT *
FROM Sorngs
WHERE yeaR_Pank =5oR artist ="Soru" ;
" QRDER By
SELECT
FROM Sales
ORDER By Country, CustomerName j
SELECT* FROM Sales
ORDERBy coun:try Ase, Customen Name DESC
Usigq Comments CHow to use Commente)
"SELECT -- This is select command
FROM Sales
WHERE year =2020;
Multile colamn
SELECT year,
month,
COUNT() As Count
FROM Saleg
GROUP 8y year, mondh ;
GROUP BY Column numbens
SELECT year,
morth,
COUNTO AS count
FROM Sales
GiROUP By 1,2
Using GhROUP BS wth ORDER BY
SELECT yeap,
month,
COUNT)AS Count
FROM &ales
GiROUP BN yean, month
ORDER BY month, Jear i
Using GROUP BY audth IMTT
SELECT Column hames
FROM table.name
WHERE Condetien
GhROUP By column hame
LIMIT umber ;
HAVING Clause
The HAVING clause was added to SQL becuse
the WHERE keyuord cannot be used aith aggregate
funetions.
Example :- SELECT Columnhame (3)
FROM able name
WHERE Condition
GROUP By column.name (s)
HAVING ondtion
ORDER By column-name () ;
" SELECT year
month,
FROM
MAX
Sales
(high) As month high
GROUP AY yean, momih
HAVING MAX (high) >4o0
ORDER BY year, month j
he SQl CASE statement
The aASE statement is sal's way o handling il/
then logic. The CASE state ment is Rolowed by at
least one pair o wAEN and THEN statements-sal's
equivalent oP IF/THEN in Excel. Because o his
pairing . you might be tempted to call this sQL
CASE WHEN but CAsE is the aceepBed term.
Every CAs£ sBatement mugt end with he END
statement. The ElSE satement ie optional, an
provides away to captune values not &pectfed intn
the wHEN /TH¾N Statement. cnsE is easiest to
understand in the conteyt of an example.
Syntax
CASE
WHEN Cohdition1 THEN pesult 1
WHEN Condition 2 THENpesult2
WHEN Condition N THEN pesultN
ELSE resul!
END ;
RIGHT CROSS
JOIN 51Etno.e J0IN
INNER J0IN
The INNER JOIN keyuond selects reconds lhat
have matchirg values in both tables.
INNER JOIN
(tabdlei tabe2)
Example
SELECT column_hame (6)
FROM table1
INNER JOIN table2
ON table 'i. eolumn_name =table2.columnname;
LEFT J0TN
The LEFTJoIN keyaword peturns all nenond3 rorom
the lefl toble lable 1), ond lhe malehing reconds (i!
(:f
ony) rom the ight table (lable 2).
LEFT JOIN
table2
(tablei
Example:
SELECT Column_name (s)
FROM Aable 1
RTGHT JOIN table 2
ON table1. Colunnname =toble 2.columnane ;
CROSS JOIN
The CROSs JOTN kejuord betarns all necovds rom
both tales Ctable 1ond table 2).
CROSS JOIN
Exanple:
SELECT column na me (8)
FBOM table-name
WHERE EXISTS
(SELECTeo um.name FROMtahe.mame WHERE Condetion);
ANY and ALL Operator
The ANY and ALl eperator allou you to perform a
Comparison betueen Single colamn value and
Pange of olhen vaucs.
ANY OpemtoR
"Ipetuns a boolean value as a regult.
"It relupns TRUE P ANy o the Subquery valucs met
the condition.
ANS means tat the condtion ul be te ?he
operotion is true lor any of the values nthe nonge.
Example:
SELECT Pro ductName FROM Sales
WHERE Product ID =ANY
(SELECT ProduetID FROM OrderDelails
WAERE Quantity > 99) 3
ALL Operator
"I reurns aboolean Vale as a pesult.
"I retuons TRUE ?ALL ?he sabguery values tmeet
the condition.
R is used with SElECT, WHERE ad HAVING statements.
ALL means that the condition will be true cly ?Jhe
Öperation is true fon all values in the ronge.
Example -
SELECT ALL Prodact Name
FROM Sales
WHERE TRUE ;
SELECT ArodctNayme FROM Sales
WHERE ProductID =ALL
(SELECT ProsucBID FROM OrderDetails
WHERE Quantity =10)
INSERT NTO SELECT
Ihe INSERT INTO SELECT sBatemert copies data ro
one table and inscrs tt into anadhentable.
The INSERT INTO SELEÇT staBement reguires thal the
dota types in source and Bargel tables matches.
lhe existing Pecords in the tayget tabe are unalfected.
Exampe:- " INSERT INTO table 2
SELECT FRDM toble 1
WHERE Condction ;
" INSERTINTO tble2 Ccolanl, column2, Qolam3, .)
SELECT Column 1,Colunn2, Colurn3,...
FROM toble1
WHERE cendition
INSERT INTO SBatement
The INSERT INIO statement is used o insert rew
recopd s ën a toble.
IH is posible to write the INSERT INTO staement
in two uoys.
"Specrty bl,
inserted.
tre colun rames and the valaes lobe
INSERT INTOtabe. nane (oskomnls Colunn2, aumng,..)
VALUES (VAluei, Value2, value3, ...)3
"II you ape odding values forall he cdlums oPhe table
you do not need to speriky the colurm vamgs in the saL
quey. However,make Sure the orden o the values js in
the Same orden as the columns inhe table. tlene, the
INSERT INTO Syntax would be as folous.
INSERT INTO tabe.name
VALUES (Valuei , value2, Value 3,...);
IFNULLO FuncBton.
IFNULLO.4nction lets you relurn on alternatire vaue !
an expression is NULL. NULL.
TIhe example below relurns 0 ?he value is
SELECT Cartactnane,
IFNULL (bizphone , homephone) As phone
FROM contacts
" SELECT mame
IFNULL CORtcephone , mbilephone) AS contact
FROM employee j
Class Notes
Class: XII Date: 13-08-2021
Introduction:
With increasing number of online activities to our day to-day life, there has been a paradigm shift, and has
also raised certain specific issues and problem related to the society, ethics, and laws. In the coming topics
we shall be discussing about intellectual property rights, plagiarism, cyber-crime, cyber-laws and e-waste
management.
Digital footprint:
Digital footprints are records or traces individuals’ activities as they use the internet. Digital footprints are
permanently stored. Interaction on social media, visited websites, online shopping, Facebook activities etc
all makeup your digital footprints.
Net and communication etiquettes: It refers to the online manner while using internet. Following lines list
the basic rules of netiquettes:
Email Etiquettes:
The following lines enlist the important email etiquettes that everyone need to be aware and follow:
1. Intellectual property right: It is the rights of the owner of the information who decide, how much
information to be exchanged, distributed, or shared. Also, it gives the owner a right to decide the
price for doing so.
3. Plagiarism: Plagiarism is presenting someone else's work or ideas as your own, with or without their
consent, by incorporating it into your work without full acknowledgement. All published and
unpublished material, whether in manuscript, printed or electronic form, is covered under this
definition.
Why is it so important not to plagiarize?
Plagiarism is unethical for three reasons: Firstly, it is unethical because it is a form of theft. By taking
the ideas and words of others and pretending they are your own, you are stealing someone else's
intellectual property. Secondly, it is unethical because the plagiariser subsequently benefits from this
theft.
Open-Source Philosophy
Open source is a term that originally referred to open-source software (OSS). Open-source software
is code that is designed to be publicly accessible—anyone can see, modify, and distribute the code as
they see fit.
Examples of open source programs
• Linux operating system.
• Android by Google.
• Open office.
• Firefox browser.
• VCL media player.
• Moodle.
Free software:
Free software means software that respects users' freedom and community. Roughly, it means that the
users have the freedom to run, copy, distribute, study, change and improve the software. Open-source
license criteria focus on the availability of the source code and the ability to modify and share it,
while free software and public domain focus on the user's freedom to use the program, to modify it,
and to share it.
FOSS:
The Free and Open Source Software (FOSS) model provides interesting tools and processes with which
women and men can create, exchange, share and exploit software and knowledge efficiently and effectively.
Copyright attaches automatically to original artistic works. Therefore, you don’t need to register the
right. When an author or creator expresses the idea in material form, the work gains copyright
protection.
Copyleft, as the name suggests, heads in the opposite direction to copyright. Playing on the word
‘copyright’, copyleft overrides copyright and promotes the concept that materials should be:
a. freely used;
b. copied and
c. modified by others.
Copyleft also requires that all versions of the material that users modify are freely accessible so that
others can use and modify it.
Copyright is the right that enable you to prevent unauthorized copying or selling of your work.
Whereas Copyleft is a method using which you can modify the software or documentation and
distribute it back to the open-source community.
Cyber Crimes
Any criminal offense that is facilitated by, or involves the use of, electronic communication or information
systems including any electronic device, computer or the internet is referred to as Cyber Crimes.
Hacking: It refers to gaining unauthorized access to a network or computer or digital Files, with an intention
to steal or manipulate data.
Spoofing: It is a fraudulent or malicious practice in which communication is sent from an unknown source
disguised as a trusted source known to receiver.
Phishing: Attempt to acquire sensitive information, like bank account information or an account password,
By posing as a legitimate entity in an electronic communication.
Example: an email that pretends to be from the IT help desk saying there’s a problem with email so reply
with your username and password to keep your email account active.
1. Grant legal recognition to all transactions done via electronic exchange of data or other electronic means
of communication or e-commerce, in place of the earlier paper-based method of communication.
2. Give legal recognition to digital signatures for the authentication of any information or matters requiring
legal authentication
3. Facilitate the electronic filing of documents with Government agencies and also departments
5. Give legal sanction and facilitate the electronic transfer of funds between banks and financial institutions
6. Grant legal recognition to bankers under the Evidence Act, 1891 and the Reserve Bank of India Act,
1934, for keeping the books of accounts in electronic form.
1. All electronic contracts made through secure electronic channels are legally valid.
3. Security measures for electronic records and also digital signatures are in place
4. A procedure for the appointment of adjudicating officers for holding inquiries under the Act is finalized
5. Provision for establishing a Cyber Regulatory Appellant Tribunal under the Act. Further, this tribunal will
handle all appeals made against the order of the Controller or Adjudicating Officer.
6. An appeal against the order of the Cyber Appellant Tribunal is possible only in the High Court
7. Digital Signatures will use an asymmetric cryptosystem and also a hash function
8. Provision for the appointment of the Controller of Certifying Authorities (CCA) to license and regulate the
working of Certifying Authorities. The Controller to act as a repository of all digital signatures.
10. Senior police officers and other officers can enter any public place and search and arrest without
warrant
11. Provisions for the constitution of a Cyber Regulations Advisory Committee to advise the Central
Government and Controller.
• Section 6- Use of electronic records and digital signatures in Government and its agencies.