0% found this document useful (0 votes)
38 views

XII-IP-QuickRevision 2 in 1

Uploaded by

100fardeen001
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

XII-IP-QuickRevision 2 in 1

Uploaded by

100fardeen001
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

CLASS - XII: INFORMATICS PRACTICES (2024-25) Creating Series with list: import pandas as pd p 5

A series can be created by passing a list as data lst=[5,6,7,8] q 6


QUICK REVISION (QR) SUPPORT MATERIAL in Series() method. idx=[‘p’,’q’,’r’,’s’] r 7
If no index is given then by default index will s=pd.Series(lst,index=idx) s 8
Compiled By: Rajesh Kumar Mishra, PGT (CS), PM SHRI KV AFS, Manauri, Prayagraj (UP) be generated as [0,1,2,3…len(list)-1]. print(s)
Creating Series with Dictionary: import pandas as pd A 45
UNIT-I [25 Marks] 1M 2M 3M 4M 5M Total A series can be created using dictionary as data d={‘A’:45,’B’:67,’C’:34,’D’:78} B 67
Data Handling using Pandas and Data Visualization 9 4 3 4 5 25 M in Series() method. s= pd.Series(d) C 34
The keys of dictionary become index and values print(s) D 78
Introduction to Python Libraries- are assumed as data. import pandas as pd A 45.0
A Python library or package is a collection of Python modules containing ready-to-use functions to perform Note: If index is provided then Series created d={‘A’:45,’B’:67,’C’:34,’D’:78} S NaN
specific task related to an application. The advantage of using libraries is that we can import libraries and can use with matching index and Keys only. NaN (Not a idx=[‘A’,’S’,’D’,’C’] D 78.0
its different functions in Python program. Some commonly used Python Libraries are- number) value is used for not matching index. s= pd.Series(d,index=idx) C 34.0
1. Python Standard Library: It is a collection of modules which is available after installing Python. Examples of print(s)
such libraries are – (a) math module- provides mathematical functions (b) random module- provides functions Creating Series with Scalar value: import pandas as pd 0 8
for generating random numbers. (c) statistics module- provides statistical functions A series can be created using a constant (Scalar) s1=pd.Series(8) ----------
2. Numpy (Numerical Python) library: Offers functions for working with matrices and multi-dimensional arrays. value. The value is repeated as per given index. print(s1) a 5
3. Pandas (PANel + DAta) library: Pandas is a fast, powerful, flexible and easy to use open-source library for data s2=pd.Series(5,index=[‘a’,’b’,’c’]) b 5
manipulation and analysis of data. Commonly used to handle Series and Data Frame. print(s2) c 5
4. Matplotlib library: It provides functions for Visualization of Data i.e. plotting and drawing graphs. Accessing Elements of Series: import pandas as pd
A Python library can be imported in a program by using import command as – Ex: import pandas as pd Data values of a series can be accessed in three ways- val=[10,20,30,40,50,60] 20
import <library Name> [as <object>] import numpy as np  Positional Index: Single value at given index. idx=['a','b','c','d','e',’f’] ---------
What is PANDAS? Features of Pandas: s=pd.Series(val,index=idx) 20
 Labelled Index: Single value at given index.
Pandas (PANel DAta System) is fast and  Pandas Data structures are Fast and efficient in functionality.  Slicing: To assess multiple values (subset) for given
# using positional index ---------
powerful open source data analysis library of  Supports functions to handle missing data. range of indexes. print (s[1]) b 20
Python developed by Wes McKinney. Pandas  Supports Label-based slicing and indexing. # using labelled index c 30
The range can be defined as [start : end : step]. Default
has functions for analysing, cleaning,  Offers conditional selection, merging and joining of data sets. print(s[‘b’]) d 40
step value is 1. Negative step value will cause access of
exploring, and manipulating massive data.  Offers import/export to handle variety of data source. e 50
series in reverse order. # slicing using Positional index
Data Structure in PANDAS: ---------
Note: print (s[1:5])
A data structure is a collection of data values and operations that can be applied to that data. It enables efficient b 20
Labeled index : values are retrieved from START to END # Slicing using labelled index
storage, retrieval and modification of data. c 30
Positional index: values are retrieved from START to END-1 print(s[‘b’:’d’])
Pandas offer the Series and Data Frame data structures for handling and analysis of big data. d 40
Series: DataFame: Conditional Access of Series elements: import pandas as pd a False
 Series is one dimensional (1D) homogeneous data  Data Frame is two-dimensional (2D) heterogenous You can filter/access data values of a series based on b False
val=[5,20,10,80,25]
structure with labelled index. data structure with rows and columns like Excel sheet. defined condition. c False
Applying condition on whole Series: idx=['a','b','c','d','e']
 Series is size immutable and Value Mutable i.e.  Data Frame is both Size and Value mutable i.e. you can d True
It will return True or False based on given condition. s=pd.Series(val,index=idx) e True
new values cannot be added but existing values add new rows /columns or delete.
Applying condition on elements: # applying condition on whole series -------------
can be deleted and modified.  Rows and Column of Data Frame are indexed or
It will returns selected values based on condition. print(s>20) d 80
 The default positional index starts from zero, if labelled with row index and column index. Default
index/label are not given. positional index starts with 0, if indexes are not given. # applying condition on elements e 25
Any single conditional expression with Relational
Creating Series: operators (>,<,=,!=,>=,<=) can be applied on series. print ( s[s>20] )
A series can be created using Series() function with Modifying Series Elements : import pandas as pd a 100
optional parameters for data and index. You can modify data value of b 20
lst=[10,20,30,40,50]
<Series Object>= pandas.Series([data=<data set>], corresponding index by providing index/ c 5
[index=<index set>], [dtype=<datatype>]) position. To modify values in a range of idx=[‘a’,’b’,’c’,’d’,‘e’])
d 5
Where dataset can be a list/Dictionary or any scalar indexes, slicing can be used. s=pd.Series(lst,index =idx) e 5
value. # modifyng single value p 100
Series DataFrame Series[index] = <new value> s[‘a’]=100 q 20
Creating Empty Series: import pandas as pd Output: Series[start : end] = <new value> # modifying multiple values r 5
An empty series can be created using Series () s= pd.Series() Series([], dtype: s 5
Modifying Index of Series: s[‘c’:’e’]=5
without any parameters. print(s) float64) t 5
Creating Series with ndarray: import pandas as pd 0 10 Index of Series can be modified using index print(s)
A series can be created using numPy array (ndArray), import numpy as np 1 20 attribute of series. #modifying index
as data in Series() method. Default index [0,1,2..] will arr=np.array([10,20,30,40]) 2 30 Series.index = <new index values> s.index=[‘p’,’q’,’r’,’s’,’t’]
be generated, if labeled index is not given. s= pd.Series(arr) 3 40 print(s)
print(s)
Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 1 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 2 of 25
Series Attributes: import pandas as pd a 4.0 Data Frame:
Certain properties of a Series can be accessed using import numpy as np b 5.0 A Data Frame is 2-dimensional heterogeneous data structure arranged in
its attributes as Series.attribute. lst=[4, 5, np.NaN, 7, 8, 9] c NaN tabular form containing rows and columns. Each row and column may
Attribute Purpose idx=['a', 'b', 'c', 'd', 'e', 'f']
d 7.0 have labeled (Text) index as well as Positional (Numeric) Index.
name Used to assign name to Series. s= pd.Series(lst, index=idx) e 8.0 The default numeric index labels starts from zero, if no index is given.
Size Returns size (number of elements) of s.name="MySeries" f 9.0 Dimensions of DataFrame are also called Axis. DataFrame is Size and
series print(s) Name: MySeries, dtype: Data mutable.
print(s.size) float64
Shape Returns shape of series as tuple
print(s.shape)
Creating Data Frame: A Data Frame in Pandas can be created
values Returns data values as ndarray 6 Data Frame can be created in the following two main approaches. using DataFrame() function with optional
print(s.hasnans) (6,)
index Returns index labels (Row wise) List-List [ [R1],[R2],[R3],..] parameters for data , row index and
print(s.dtype) True
Dtype Returns data type of seiries print(s.empty) List with nested List-Dictionary [ {..},{..},{..},..] column index.
Empty Returns true is series is empty float64 structure. <DF Object>= pandas.DataFrame(<2D-
print(s.values) List-Series [S1,S2,S3,..]
otherwise false False data set>, index=[<Row indexes>],
print(s.index) (Column wise) Dictionary-List { [C1],[C2],[C3],..}
Hasnans Returns true if series has NaN values. [ 4. 5. nan 7. 8. 9.] columns=[<column indexes>])
Dictionary with Dictionary -Dictionary { {..},{..},{..},..}
Index(['a‘,'b‘,'c‘,'d‘,'e‘,'f'], Where 2D-dataset may be ndarray or
nested structure. Dictionary -Series { S1,S2,S3,..}
dtype='object')
Data Frame can also be created using ndarray or another Data Frame. nested structure of list of dictionary.
Series Methods: import pandas as pd 6
lst=[4,5,6,7,8,9] a 4 Creating Empty DataFrame: Creating Data Frame using List of Lists (Nested List):
Series methods specific operations on Series (s).
head( ) Returns top 5 values of series, if no value is given. idx=['a','b','c','d','e','f'] b 5 import pandas as pd import pandas as pd
s= pd.Series(lst, index=idx) c 6 df= pd.DataFrame() lst=[['Amar',60,68,45], ['Akbar',65,65,56], ['Anthony',70,77,65]]
tail( ) Returns bottom 5 values of series, if no value is given.
print(s.count()) -------------
print(df) df= pd.DataFrame(lst,index=[1,2,3], columns=['Name','Phy','Chem','Maths'])
count( ) Returns counting of not-NaN values in series. print(df)
The following Mathematical methods are applicable on numeric print(s.head(3)) e 8
print(s.tail(2)) f 9 Creating Data Frame with list of Dictionary:
series only.
print(s.min()) ------------- import pandas as pd
min( ) Returns minimum value of the series. print(s.max()) lst= [ {'Name':'Amar','Phy':60,'Chem':68,'Maths':45}, {'Name':'Akbar','Phy':65,'Chem':65,'Maths':56},
4
max( ) Returns maximum value of the series. print(s.sum()) {'Name':'Anthony','Phy':70,'Chem':77,'Maths':65} ]
9
sum( ) Returns total of value of the series. print(s.add(5)) df= pd.DataFrame(lst, index=[1,2,3])
39
add( ) Adds a scalar (constant) value or another series. print(df)
a 9
sub( ) Subtracts a scalar (constant) value or another series. b 10 Creating Data Frame with Dictionary of Series
mul( ) Multiplies series with scalar (constant) values or c 11 s1=pd.Series(['Amar','Akbar','Anthony'],index=[1,2,3])
another series. d 12 s2=pd.Series([60,65,70], index=[1,2,3] )
div( ) Devides series with scalar (constant) values or another e 13 s3=pd.Series([68,65,77], index=[1,2,3] )
series. f 14 s4=pd.Series([45,56,65], index=[1,2,3] )
Mathematical operations on Series: import pandas as pd a 9 dct={'Name':s1,'Phy':s2,'Chem':s3,'Maths':s4} Note: Keys of dictionary become column index
Mathematical operations on series can be applied in lst=[4,5,6,7,8] b 10 df= pd.DataFrame(dct) and values arranged as per matching keys)
two ways. idx=['a','b','c','d','e'] c 11 print(df)
Using operators : +, - ,*, / , //, % etc. s= pd.Series(lst, index=idx) d 12
#applying arithmetic operation Accessing Data Frame:
Using Methods: add(), sub(), mul(), div() etc. e 13
print(s.add(5)) # OR print(s+5) The values of data frame can be accessed in different ways like
Mathematical operations can be two types-
Series. The possible ways are-
Manipulating Series with scalar (constant) import pandas as pd a 14.0  Accessing column(s)
value: s1= pd.Series([4,5,6,7], b 20.0
index=['a','b','c','d'])
 Accessing Row(s)
When a series is manipulated with a constant c 26.0
number then mathematical operation is applied with s2= pd.Series([10,12,15,18,20], d NaN  Accessing Row(s) and column(s)
each element of the series (Vector arithmetic). index=['a','p','b','q','c']) p NaN Accessing Columns of DataFrame: print(df[‘Phy’]) OR
Manipulating two Series: #applying arithmetic operation q NaN Single column: print(df.Phy)
print(s1.add(s2)) #OR (s1+s2) <DataFrame>[<Col Label>] OR <DataFrame>.<Col Label> print(df[[‘Phy’, ‘Maths’]])
When mathematical operation is applied on two
#applying arithmetic operation a 14.0 Multiple Columns: <DataFrame>[ [Col 1, Col2, Col3..] ] Print(df[[‘Maths’, ‘Phy’]])
series then operation is performed on matching
index. The NaN value will be produced for non- # 0 will be assumed for non-matching b 20.0 Accessing Rows of Data Frame: # from row one onward
matching/missing value. values # before adding series. c 26.0 Rows can be accessed by giving Index range. print(df[‘one’: ])
d 7.0 <DataFrame>[<Start row label>:<End row label>] print(df[ :‘three’]) # till three row
Note: We can use fill_value parameter to avoid NaN s1.add(s2, fill_value=0) When start or end label is not provided, default value fist # from row one to three
p 12.0
result for non-matching values. row and last row will be used. print(df[‘one’: ‘three’])
q 18.0
When labeled index used the START to END will be # Single Row ‘Two’ only
displayed. In case of Positional index (number) then Print(df[‘two’:‘two’])
START to END-1 will be displayed. Print(df[1:3]) # using positional index
Pandas head() and tail() function can also be used. Print(df.head(2))

Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 3 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 4 of 25
Accessing Rows and Columns using Label index: Accessing Rows and columns using Positional Modifying values of Rows: df.loc[‘one’]=50
Pandas loc[] is provides subset of selected rows, columns Indexes. <DF Object>.loc[<Row 1> : <Row 2> ]=<new value(s)> #modifying value of ‘two’ to ‘three’ row
or both using row/column labels. It returns selected iloc[] method to get subset of selected combinations Rows of Data Frame can be modified by selecting and assigning df.loc[‘two’:’three’,:]=60
subset from given Row/Col label from Start to End. of rows, columns or both using positional indexes. new values. If given row already exists then existing values will #Adding new row ‘four’ with 65 marks
<DF object>.loc[<start row>:<end row>, <start <DF object>.iloc[<start row>:<end row>, <start be changed otherwise a new row will be added. df.loc[‘four’,:]=65
column>:<end column>] column>:<end column>] Modifying single value at specified position: df.Chem['two']=10
When start/end row/column is not provided, default Note: iloc() used positional indexes and row/col will <DFobject>.<Column>[<row label or position>]=<new value> df.Chem[0]=20
value first row/column and last row/column will be used. be selected from START to END-1. <DFobject>.at[<row label>, <column label>]=<new value> df.at['two',‘Phy’]=30
# all rows and all columns # all rows and all columns df.iat[2,1]=40
print(df.loc[ : , : ]) print(df.iloc[ : , : ]) Deleting Rows and Columns of Data Frame: # Deleting a column ‘Maths’
# from row ‘one’ to end row and all columns # from row ‘one’ to end row and all columns Rows or column of DataFrame can be deleted by two methods- del df['Maths']
print(df.loc['one': , : ]) print(df.iloc[0: , : ]) del <DF object>[<column label>] # to delete a single column # Deleting a row ‘two’
# till row ‘three’ and all columns # till row ‘two’ and all columns <DF Object>.drop([<Row labels/Column labels>], axis=0/1)
df=df.drop(['two'])
print(df.loc[ :'three', : ]) print(df.iloc[ :2 , : ]) #deleting multiple column
Where axis=1 for column deletion and axis=0 for row deletion. df=df.drop(['Phy','Chem'], axis=1)
# all rows and from ‘Phy’ column to end # all rows and from ‘Phy’ column to end
Using drop() method, you have to assign modified Data Frame on # deleting multiple rows
print(df.loc[ : ,'Phy': ]) print(df.iloc[ : ,1: ])
# all rows and from ‘phy’ to ‘Maths’ column # all rows and from ‘phy’ to ‘Chem’ column same or different object, since drop() deletes on copied object. df=df.drop(['one','four'], axis=0)
print(df.loc[ : ,'Phy':'Maths']) print(df.iloc[ : ,1:3]) Renaming row and column labels: # Renaming Row labels
# from Row ‘Two’ to ‘three’ and ‘Phy’ to ‘Chem’ col #from Row ‘two’ to ‘two’ and ‘Phy’ to ‘Chem’ Row and column indexes can be rename as- df=df.rename(index={'P':'one','Q':'two','R':'three','S':'four'})
print(df.loc['two':'three','Phy':'Chem']) print(df.iloc[1:2,1:3]) <DF Object>.rename( index={name-dict}, # Renaming column labels
Accessing Individual Value: # accessing value of individual cell columns={column-dict} ) df=df.rename(columns={'A':'Name','B':'Phy','C':'Chem',
There are three methods to access individual value. print(df.Maths['three']) 'D':'Maths'} )
<DFobject>.<Column>[<row label or row position>] print(df.Maths['three']) Data Frame Attributes:
<DFobject>.at[<row label>, <column label>] print(df.Maths[2]) Once Data Frame has been created, you can access certain properties of Data Frame through predefined
<DFobject>.iat[<row position>, <column position>] print(df.at['two','Chem']) attributes.
print(df.iat[1,1]) You can access series attributes as <DF>.<attribute>
Accessing Items using condition # applying condition on ‘Phy’ Column
You can also filter and analyze data by displaying print(df['Phy']>60)
Attributes Purpose
True/False based on given condition. # filtering data on condition
index Returns list of row indexes /labels of Data Frame.
The condition may have relational operators like print(df[ df['Phy']>60 ])
columns Returns list of column indexes/labels of Data Frame.
>,>=,<,<=,!=,= etc. # applying condition on range
print(df.loc['one':'two','Phy': ]>60) values Returns data values of Data Frame as ndarray.
print(df.loc[df[‘Chem’]>60,[‘CS’]) size Returns the size (number of data items) of DataFrame.
print(df.loc[df[‘Chem’]>60,[‘CS’,’Maths’]) shape Returns shape (dimensionality) of Data Frame as tuple
Accessing Items based on Boolean Indexing: dct={'Name':['Amar','Akbar','Anthony','Manpreet'], axes Returns list of both axes (row and columns labels)
Boolean indexing as name suggests, having 'Phy':[60,65,70,67], 'Chem':[34,55,32,46], dtype Returns column wise data type of Data Frame.
Boolean values (True/False or 1/0) as row 'Maths':[45,56,65,75]} empty Returns true if Data Frame is empty otherwise false.
index/label to access the rows based on True or df=pd.DataFrame(dct, index=[True,False,True,False]) T Transpose index and columns.
False criteria. For this we have to create/change print(df)
import pandas as pd
row labels as True or False. # accessing rows based on Boolean value of rows.
dct={'Phy':[60,65,70], 'Chem':[34,55,32], 'Maths':[45,56,65]}
print(df.loc[True])
df=pd.DataFrame(dct, index=['Amar','Akbar','Anthony'])
print(df.loc[False])
print(df)
Modifying Data Frame: #modifying value of existing column ‘Maths’ print(df.index)
Modifying values of Existing Column: df[‘Maths’]=50 print(df.columns)
Single Column: #modifying value of ‘Phy’ to ‘Chem’ column print(df.values)
<DF object>[<Column Label>]=<new value(s)> df.loc[:,’Phy’: ‘Chem’]= 45 print(df.size)
Multiple Column #Adding new column ‘Eng’ with 65 marks print(df.shape)
<DF Object>.loc[: , Column 1: column 2]=<new value(s)> df[‘Eng’]=65 print(df.dtypes)
If given column already exists in the Data Frame then existing # Adding new column ‘IP’ with new marks print(df.empty)
values will be changed otherwise a new column will be added in df[‘IP’]=[45,54,67] print(df.T)
the Data Frame.
Data Frame Methods:
Adding New Column: df[‘IP’]=[45,54,67]
Apart from mathematical methods add(), sub(), mul() , div() etc., Pandas offers other methods too, which can be
<DF object>[<Column Label>]=<new value(s)> df[‘Total’]=
used for different operations on the Data Frame.
We can also use expressions while creating new columns. df[‘Phy’]+df[‘Chem’]+df[‘Maths’]
Adding new Row: # Adding new row ‘five’ with different marks
<DF Object>.loc[<Row index> ]=<new value(s)> df.loc[‘five’]=[‘Manpreet’,45,54,67]

Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 5 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 6 of 25
Methods Purpose print(df.count()) #OR Data Visualization: The Matplotlib library of Python, is used for
head( ) Returns top 5 rows of Data Frame, if no value is given. print(df.count(axis=0)) Data visualization means graphical or pictorial representation creating various types of 2D- plots in Python.
tail( ) Returns bottom 5 rows, if no value is given. print(df.count(axis=1)) of the data using some pictorial tools like graph, chart, etc. The pyplot module of Matplotlib library can be
len(DF) Return numbers of rows in the Data Frame. print(df['Phy'].count()) imported in the Python program to plot graphs.
Visualization helps to effectively communicate information to
The following functions can be applied in Row-wise/Column wise by print(df.sum()) #OR import matplotlib.pyplot as plt
users. For example Traffic symbols, Atlas or map book etc. are
print(df.sum(axis=0)) Where plt is name given to pyplot object. You
specifying axis or whole data frame.(axis=1 for Row-wise and axis=0 for pictorial representation of facts which are more easy to
print(df.sum(axis=1)) can give any valid identifier/name.
column wise). If axis is not given then 0 will be assumed. understand than text.
print(df['Phy'].sum())
count() Returns counting of not-NaN values in Data Frame.
print(df.max()) #OR Pyplot methods for plotting graphs: PyPlots also offers some additional functions to
min( ) Returns minimum value of the DataFrame/Row/column. print(df.max(axis=0)) The following methods are used to plot a chart. customize plots.
max( ) Returns max value of the Data Frame/ Rows/ columns. print(df.max(axis=1)) Chart Method Description Method Purpose
sum( ) Returns total of value of the Data Frame/Rows/Columns. print(df['Phy'].max()) Line chart plot() Visualize data as a series of grid() Configures Gridlines in the graph/plot.
Mathematical Operations on DataFrame: data point (markers) legend() Displays legend of the axis.
Pandas offers add(), sub(), mul(), div() functions to manipulate a data frame with scalar values or another data connected by line. savefig() Saves the plot as image/pdf file types.
frame. Arithmetic operators (+,-,*,/,//,% etc) can also be used. Bar chart bar()/ Visualize data with bars show() Displays the plot/graph.
Manipulating DataFrame with scalar (Vector Operation): All elements will be manipulated with values. barh() with height/ length title() Defines the title for the plot/graph.
proportional to value. xlabel() Sets the label for x-axis.
import pandas as pd
dct={'Name':['Amar','Akbar','Anthony','Manpreet'], Histogram hist() Visualize the number of ylabel() Sets the label for y-axis.
'Phy':[60,65,70,67], 'Chem':[34,55,32,46], data (frequency) that lie xticks() Sets the tick location and label on x-axis
'Maths':[45,56,65,75]} within range of values. yticks() Sets the tick location and label on y-axis
df=pd.DataFrame(dct,index=['One','Two','Three','Four'])
print(df) Creating Line Chart:
#Mathematical Operation on a column Pyplot’s plot() function is used to generate line chart for given values for x-axis and y-axis. Data for X and Y axis
df['Chem']=df['Chem']-5 may be list, series, column of DataFrame.
df['Maths']=df['Maths'].add(5) <pyplot obj>.plot([X-Value,]<Y-Value> [,Line/Marker-color code] [,linewidth=<n>]
print(df) [,linestyle=<style code>] [,marker=<marker style>][,markersize=<n>]
[,markeredgecolor=<colorcode>] [,label=<text>])
Importing & Exporting Data Frame:
X-Value : Dataset for X-Axis. Default value is [0..N-1], if not given values for X-Axis.
The data of Data Frame can be saved as a file on storage media, so that it can be utilized by other applications.
(Dataset may be 1-D Array, List, Series or Column of DataFrame.)
The Data Frame can be saved in different formats but CSV type is simple and commonly used.
Y-Value : Dataset for Y-Axis. Number of values for X-Axis and Y-Axis should be equal.
The Comma Separated Value (CSV) is a simple plain text format which can be created in any Text Editor (Note
Line/Marker-Color: Defines color code for line and Marker symbol.
Pad), Spreadsheet (MS Excel) etc., where all values are separated by comma (,). Color Code: r (Red), g (Green), b (blue), k
Linewidth=<n>: A number indicating thickness of line.
Pandas offers the following two methods to import and export data from/to CSV file. (Black) etc.
Linestyle=<style> : Line style may be solid, dashed, dashdot or
read_csv(): reads/imports data from CSV file to Data Frame. Line Style: Solid (-), Dashed line (--),
dotted etc.
to_csv(): Creates/exports data of Data Frame to CSV file. dotted (:) etc.
Marker=<style> : Defines Marker style code.
Importing (Reading) data from CSV file: Example: Marker style: Point(.), Circle (o), Plus (+),
Markersize=<n> : Defines size of marker in number.
<DF>=pandas.read_csv(<“path-filename”>, sep=<“Separator ”>, import pandas as pd
Markeredgecolor=<color code> : Defines color for marker edge. Cross (x), diamond (d) etc.
skiprows=<n>, nrows=<n> ) df=pd.read_csv("e:\\data.csv")
Label=<text>: Defines label text for legend.
<“path-filename”>: specifies the filename with path. Path name must be print(df)
# creating simplest line chart using List of values # Multi line graph Week and average temp graph
separated by \\. Ex: “c:\\Data\\address.csv”
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
sep=<“Separator ”>: specifies the delimiter character. Default is comma. w=[1,2,3,4,5,6,7,8]
xdata=[1,2,3,4,5]
skiprows=<n>: specifies the number of lines to be skipped while reading. ydata=[2,6,4,8,3] t=[28,34,36,30,32,38,34,32]
nrows=<n>: specifies the number of lines to be read from CSV file. plt.plot(xdata,ydata) h=[30,32,34,28,30,35,33,30]
# Displaying Graph plt.plot(w,t,'r')
plt.show() plt.plot(w,h,'b')
# Displaying Graph
plt.show()

Exporting (Writing) Data to CSV file: import pandas as pd


<DF>.to_csv(<“path-filename”>, sep=<“Sep char”> ) dct={'Name':['Amar','Akbar','Anthony','Manpreet'],
<“path-filename”>: specifies the filename with path Phy':[60,65,70,67],'Chem':[34,55,32,46],
(location) to be created. Ex: “c:\\Data\\address.csv” 'Maths':[45,56,65,75]}
sep=<“Separator char”>: specifies the delimiter character df=pd.DataFrame(dct, index=[1,2,3,4])
to separate data values. Default is comma(,). print(df)
Row labels & column labels are also written in CSV file. df.to_csv("e:\\address.csv")

Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 7 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 8 of 25
# line plot with customization Creating Histogram:
import matplotlib.pyplot as plt A histogram is graphical visualization of the distribution of numerical Data in terms of frequency count. It
w=[1,2,3,4,5,6,7,8] represents frequencies as bars based on non-overlapping ranges called bins.
t=[28,34,36,30,32,38,34,32] Bins can be considered as consecutive, non-overlapping intervals of ranges. If can be a number or range with
h=[30,32,34,28,30,35,33,30] lower and upper limit.
plt.plot(w,t,'r', linewidth=4, marker='o', For example, if bin is 5 then it shows that all data to classified and counted in 5 equal bins or groups.
markersize=10, label="Temp") But if it is given as list of numbers, then it shows ranges. bins=[0,4,8,12,16] shows 0-3,4-7,8-11,12-16 ranges. By
plt.plot(w,h,'b',linestyle=‘:’,marker='x', default, it uses 10 bins with auto calculated ranges. However, number of bins or ranges can be given as per need.
label="Humidity") Using hist() function we can plot and customize histogram like bins or ranges, histogram types and orientation etc.
# setting graph
plt.xlabel("Week") <pyplot obj>.hist(<Data-Values> [, bins =<Number/list of numbers>] [histtype=<type>]
plt.ylabel("Temp & Humidity") [cumulative=<True/False>] [orientation=<‘horizontal’|’vertical’>]
plt.title("Temp & Humidity over Time") Data-Value : Dataset for the chart. Dataset may be 1-D Array, List, Series or Column of DataFrame.
plt.legend(loc="upper left") bins=<number(s)> : Defines the number or bins (in number) and range if given as list of numbers.
plt.show() histtype=<type>: Defines the type of plot. Type may be bar, barstacked, step and stepfilled. Default is bar type.
Creating Bar Chart: The barstacked is used for multiple data sets in which one is stacked on top of other.
Bar chart is a graphical display of data through colored bars of different height/length. It can be drawn cumulative=<T/F>: Creates cumulative graph if True. Default is false.
horizontally or vertically. Pyplot’s barh() function can be used to plot horizontal bar graph. orientation=<‘horizontal’|’vertical’>: Defines orientation of plot as horizontal bars or vertical bars.
# Hitogram with 5 bins for age of students # Hitogram with 4 ranges and defined x-ticks
<pyplot obj>.bar(<X-Val>,<Y-Val> [,width =<size(s)>][color=<colorcode(s)>] [label=<text>]
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
X-Value : Dataset for X-Axis. Dataset may be 1-D Array, List, Series or Column of DataFrame. data=[2,4,5,6,2,6,8,10,12,12,11, data=[2,4,5,6,2,6,8,10,12,12,11,
Y-Value : Dataset for Y-Axis. Number of values for X-Axis and Y-Axis should be equal. 10,4,3,2,5,7,9,11,12,13,14, 10,4,3,2,5,7, 9,11,12,13,14,
width=<size(s)> : Defines width of bars in number. You can also define a list of sizes for each bar, if required. 15,14,10,9,7,9] 15,14,10,9,7,9]
color=<color code(s)>: Defines color for bars. You can also define a list of separate color code for each bar plt.hist(data,bins=5) plt.hist(data,bins=[0,4,8,12,16])
Label=<text>: Defines label text for legend. plt.show() plt.xticks([0,4,8,12,16])
# creating simple bar graph using Lists # bar chart with varying colors plt.show()
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
x=[2016,2017,2018,2019,2020] year=[2018,2019,2020,2021]
y=[55,46,30,50,40] pas=[28,34,36,30]
plt.bar(x,y) plt.bar(year,pas, color=['r','k','b','g’])
plt.show() plt.show()

# Horizontal Hitogram # Cumulative Hitogram for age of students


import matplotlib.pyplot as plt import matplotlib.pyplot as plt
data=[2,4,5,6,2,6,8,10,12,12,11, data=[2,4,5,6,2,6,8,10,12,12,11,
10,4,3,2,5,7, 9,11,12,13,14, 10,4,3,2,5,7,9,11,12,13,14,
15,14,10,9,7,9] 15,14,10,9,7,9]
# Horizontal bar chart # bar chart with multiple bar plt.hist(data,bins=[0,4,8,12,16], plt.hist(data, cumulative='True')
import matplotlib.pyplot as plt import matplotlib.pyplot as plt orientation=‘horizontal’) plt.show()
year=[2018,2019,2020,2021] import numpy as np plt.show()
pas=[28,34,36,30] x=np.array([1,2,3,4])
plt.barh(year,pas, color=‘b') male=[28,34,36,30]
plt.show() female=[20,30,30,25]
plt.bar(x, male, width=0.3, color='b')
plt.bar(x+0.3, female, width=0.3,color='r')
plt.show()

Saving Plot: plt.savefig ('myline.pdf')


To save any plot use savefig(<file name>) plt.savefig ('myline.svg')
File type may be .png, ,jpg, .svg or .pdf. plt.savefig ('myline.png')

Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 9 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 10 of 25
UNIT-2 [25 Marks] 1M 2M 3M 4M 5M Total  Open Source & Free: It is Open Source and available free of cost.
Database Query using SQL 6 4 6 4 5 25 M  Portability: It can be installed and run on any types of Hardware and OS like Linux, MS Windows or Mac etc.
 Security: It offers security and authorization feature to keep database secure.
What is Database?  Connectivity: The MySQL database can be connected with Programming Languages like Python, Java etc.
A database is an organized collection of interrelated data stored together to serve applications. It work like a  Query Language: It uses SQL (Structured Query Language), which is standardized by ANSI.
container which may contains various database objects. Types of SQL (MySQL) Commands:
Most of the databases store data in the form of Relations (also called Tables). Such Databases are known as SQL commands may categorised into two category as their usage:
Relational Database: A Software used to store and manage Relational database is called RDBMS (Relational DDL (Data Definition Language): Commands to define structure of data i.e. Database and Table.
Database Management System). DML (Data Manipulation Language): Commands to process records stored in the table.
Example of RDBMS software: Oracle, MySQL, MS SQL Server, SyBase and Ingress etc.
Advantages of using Database: DDL Commands (Works with Table/Database) DML Commands (Works with Records)
 Database reduces Redundancy: Removes duplicity of data because data are kept at one place. CREATE Creates Database and Tables SELECT Displays records from the table.
 Database controls Inconsistency: Data updation maintains consistency and unambiguity. ALTER Modifies structure of Table INSERT Insert records in the table
 Database facilitates Sharing of Data: The data stored in the database can be shared among several users. DROP Deletes Database and Table DELETE Deletes records from the table
 Database ensures Security: Data are protected against disclosure to unauthorized users. UPDATE Modifies values of existing records.
 Database maintains Integrity: DBMS enforces integrity rules to insure the validity or correctness of data. Apart from these commands, MySql the following miscellaneous commands –
SHOW DATABASES: Displays list of Databases available.
Relational Data Model:
SHOW TABLES: Displays list of tables stored in currently opened database.
Data model describes ‘How data is organized or stored’ in the database. A Database can be categorized in various
USE <Database Name>: Opens a database for working. Example : USE EMPLOYEE
models as per organization of records like Relational Data Model, Network Data Model, Hierarchical Data Model
DESCRIBE <Table>: Display structure of table. Example – DESCRIBE Student
and Object Oriented Data Model.
Relational Data Model: In Relational model, data is organized in the form of Relation or Table consisting rows and
Data Types in MySQL:
columns. This model is mostly used by RDBMS software. A column of the Table stores same type of values as defined while creating a table. Commonly used MySQL data
Relation: A Relation or Table is Two-Dimensional structure containing in Rows and Columns. It has the following types for a column are-
properties- INTEGER (Size)/INT (size) : Stores numbers without decimal upto given size.
 Column homogeneous- All values in a column are of same data type. DECIMAL (M, D)/NUMERIC (M, D)/FLOAT (M,D) : Numbers with decimal points upto M size and D decimal places.
 Unique columns- Each column assigned a unique name and must have atomic (indivisible) value. Ex: Decimal (8,2) will store like 123456.78
 Unique rows- All rows of a relation are distinct i.e. no two identical records can exist in the Relation (Table). CHAR (size): Stores string/text upto given size. Maximum size is 255 and default is 1, if size not given.
Tuple/Entity/ Record: A Row of a table is called Tuple or Record. VARCHAR (size): Stores variable size string upto given size. Maximum size is 65535.
Attribute/ Field: A column of a table is called Attribute or Field. DATE: Stores date string in YYYY-MM-DD format.
Domain: It is collection (set) of possible values from which the value for a column is derived. TIME: Store time string in HH:MM:SS format.
Degree: Number of columns (attributes) in a table. Note: All values must be enclosed in single or double quotes except Integer and Decimal numbers.
Cardinality: Number of Records in a table. Working with DDL Commands
Concept of Keys: Creating Database and Table:
A table may have several columns and some column or combination of columns which can identifies a record in CREATE DATABASE <Data base Name>
the table uniquely. Such column(s) are called Key of the Table. Keys can be categorized in following types. CREATE TABLE < Table Name> (<Col name1><data type>[(size)] [Constraints],….);
Primary Key: A column or group of Column, which uniquely identify a Record/Tuple in a Table is called Primary Constraints:
Key. The Primary key cannot have null or duplicate values. A table can have only ONE primary key. Example: Constraints are the rules, condition or checks applicable to a column or table which ensures the integrity or
Vehicle Number, Enrolment number, Admission No, Roll No,PNR Number , Aadhaar , PAN No. etc. validity of data. The commonly used constraints are-
Candidate Key: A Table may have multiple keys having candidature to work as primary key. Collection of all such Constraints Purpose
key-columns is called candidate keys. Note that Primary key is one of the candidate key. NOT NULL Ensures that a column cannot have NULL value.
Alternate Key: All candidate key other than Primary key are called Alternate key (Secondary Key) because they UNIQUE Ensures that all values in a column are different.
can be used as an alternative to Primary key. DEFAULT Provides a default value for a column, when nothing is given.
Foreign Key: is a non-key attribute, which establish a relation with another table. Mostly it is common column in CHECK Ensures that all values in a column should satisfy certain condition.
two tables and works as primary key of another table. PRIMARY KEY Defines Primary Key of the Table that can identify a row uniquely.
Consider the following tables and their columns: FOREIGN KEY Defines Foreign key which makes a relation with any other table to ensure Referential
Integrity of the data.
EMPLOYEE (EmpNo, Name, Designation, City, AadharNo, DeptNo)
Note: Constraints are optional. A table may have multiple Unique constraints but only one Primary Key.
DEPARTMENT (DeptNo, Dname, HODName)
Creating Database and table. Creating table with constraints.
Candidate Keys of EMPLOYEE Table : (EmpNo, AadharNo) CREATE DATABASE SCHOOL; CREATE TABLE Student
Primary Key of EMPLOYEE Table- EmpNo & Primary Key of DEPARTMENT Table- DeptNo USE SCHOOL; (StCode char(3) NOT NULL PRIMARY KEY,
Foreign Key of EMPLOYEE Table- DeptNo. (because it is common to both table and is primary key in Department CREATE TABLE Employee Stname char(20) NOT NULL,
Table) (Code char(3), StAdd varchar(40),
MySQL: EmpName char(20), AdmNo char(5) UNIQUE,
City varchar(40), StSex char(1) DEFAULT ‘M’,
MySQL is an open source Relational Database Management System (RDBMS) software based on SQL. The main
Pay Numeric(8,2)); StAge integer CHECK (StAge>=5) );
features of MySQL are –
Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 11 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 12 of 25
Modifying Structure of Table: Adding new column - Displaying Selected Records- WHERE Searching NULL Values – IS Operator
We can alter (modify) the structure of existing ALTER TABLE Student ADD (TelNo Integer); SELECT * FROM Student WHERE City=‘Mumbai’; SELECT * FROM Student
table by the using ALTER TABLE Command. With ALTER TABLE Student ADD (Code int(3) Primary Key); SELECT Name, City from Student WHERE City IS NULL ;
ALTER TABLE Command, we can- Modifying Existing Column : WHERE City <> ‘Mumbai’ AND Class>10; SELECT * FROM Student
 Add a new Column or Constraints ALTER TABLE Student MODIFY Name VARCHAR(40); SELECT * FROM Emp WHERE Sal >10000 OR Job =‘Manager’; WHERE City IS NOT NULL;
 Modifying existing column (data type, size etc.) Deleting Column: SELECT * FROM Student WHERE NOT Grade=‘A’;
ALTER TABLE Student DROP TelNo; Specifying Range of Values – BETWEEN Operator Specifying List of values– IN Operator
 Delete an existing column or Constraints
Renaming Column Name: SELECT * FROM Emp WHERE Sal BETWEEN 5000 SELECT * FROM Emp
 Rename Column Name
ALTER TABLE EMP CHANGE ENAME EMPNAME AND 10000; WHERE Sal IN (5000, 10000) ;
ALTER TABLE <Table Name> CHAR(40); OR [Same as SELECT * FROM Emp WHERE Sal >= 5000 [Same as SELECT * FROM Emp WHERE Sal = 5000 OR
ADD | MODIFY | DROP | CHANGE <Column ALTER TABLE EMP RENAME ENAME EMPNAME; AND Sal<=10000 ;] Sal =10000 ; ]
Definition(s)>
SELECT * FROM Emp WHERE NOT Sal BETWEEN SELECT * FROM Student WHERE City IN (‘Mumbai’,
Deleting Database and Table: DROP DATABASE School;
5000 AND 10000 ; ‘Delhi’,’Kanpur’) ;
DROP DATABASE <Data base Name> DROP TABLE Student;
Specifying Pattern of string- Ordering result of query – Order By Clause:
DROP TABLE <Table Name> SELECT * FROM Student WHERE Name LIKE ‘A%’; SELECT * FROM Student Order By City;
Working with DML commands SELECT * FROM Student WHERE Name LIKE ‘%Singh%’; SELECT * FROM Student Order By City DESC;
Inserting Records: Suppose a Table STUDENT (Code, Name, Fname, DOB, Class) SELECT Name, City FROM Student WHERE Class>=9 SELECT * FROM Student
You can insert record in the table by using by using is created. The following command will insert a record. AND Name LIKE ‘%Kumar%’ ; WHERE City=”Prayagraj” Order By Name;
the following DML command. INSERT INTO Student VALUES Functions in MySQL:
INSERT INTO <Table Name> [<Column list>] (‘s1’,’Amar’, ‘Dhirendra Kumar’,’1985-10-25’, 12); A function is a special types of command in MySQL that performs some operation on table and returns a single
VALUES <list of values> value as a result. MySQL functions may be divided in the following categories-
INSERT INTO Student VALUES
Note:  Math or Numeric Functions ( works on numeric columns and numeric data)
 Values to be given as per order of columns. (‘s2’,’Shaan’, NULL,’1972-5-25’, 10);  Text or String Functions (works on string data or text columns)
 ‘Null’ can be used in place of unknown values. INSERT INTO Student (StID, FName, Name, Class)  Date & Time Function (works on date and time data or columns)
 You can define order of column with table name VALUES (‘s3’,’Amitabh’, ’Abhishek’, 12);  Aggregate Functions (works on numeric/Text columns vertically and also called Multi Row function)
as per order of values to be inserted. Numeric Functions: SELECT MOD(5,2) ;  1
Deleting Records: DELETE FROM Student ; (All record will be deleted) MOD(N,M) Returns remainder of N divide by M SELECT POW(5,2) ;  25
DELETE FROM <Table Name> DELETE FROM Student WHERE City=‘Mumbai’ ; POWER(N,M) Returns N to the power M( N M) SELECT ROUND(‘212.567’,1 ) ;  212.6
[WHERE <Condition>] DELETE FROM Student WHERE Class >=11 ; POW(N,M) Select ROUND(15.193,1);  15.2
Modifying Records: UPDATE Student SET Class =10 ; ROUND (N [,M]) Returns a number rounded off up to M Select ROUND(15.193);  15
UPDATE <Table> SET <Column> = <Expression> UPDATE Student SET Class=10 WHERE class=9 ; place. If M is -1, it rounds nearest 10. Select ROUND (355.35,-1)  360
[WHERE <Condition>] UPDATE Emp SET Sal = Sal+(Sal*10/100) If M is not given, the N is rounded to the Select ROUND (124.35,-1)  120
WHERE Sal <=10000; nearest Integer. Select ROUND (355.35,-2)  400
UPDATE Emp SET City = ‘Dehradun’ WHERE CITY IS NULL; TRUNCATE(N,M) Returns number after truncating M SELECT TRUNCATE(‘212.567’,1 ) ; 212.5
Displaying Records: decimal places. SELECT ROUND(PAY,2) FROM EMP;
The SELECT command used to make a request (query) to retrieve stored records from the table. SQRT (N) Returns square root of N SELECT TRUNCATE(PRICE*QTY,2) FROM ITEMS;
SELECT < [Distinct | ALL] * | column name(s)> FROM <table(s)> [WHERE <condition> ]
String Functions: SELECT LENGTH(‘abcd’ ) ;  4
[ORDER BY <column(s)> [ASC | DESC] ] [GROUP BY <column(s)> [HAVING <condition>] ] ;
LENGTH(str) Returns the length of given string SELECT LENGTH(Name) FROM Student;
A condition defined with WHERE clause may have the following Relational and Logical operators: LOWER(str)/ Returns given string in lower case. SELECT LOWER(‘ABcD’ ) ;  abcd
=, > , < , >=, <=, <>, IS , LIKE, IN, BETWEEN, OR , AND , NOT (!) LCASE(str) SELECT LOWER(Name) FROM Student;
Note: SELECT UPPER(‘abcD’ ) ;  ABCD
UPPER(str)/ Returns given String in upper case
 IS operators is used to compare NULL value (Never use = (equal) with Null. SELECT UPPER(Name) FROM Student;
UCASE(str)
 BETWEEN operator defines a range of values as lower and upper range (both are inclusive) SELECT LTRIM(‘ abcd’ ) ;  abcd
LTRIM(str) Removes Leading/Trailing/both
 LIKE Operator used to define a condition based on a pattern of string. SELECT LTRIM(Name) FROM Student;
RTRIM(str) spaces from given string.
Pattern is a search string having the following wild cards- SELECT RTRIM(‘abcd ’ );  abcd
TRIM(str)
Percent (% ) - Represents a substring in any length SELECT TRIM(‘ abcd ’ ) ;  abcd
LEFT(str, N) Returns the (N) characters from
Under score ( _) - (Represents a single character at used position.) SELECT SUBSTR(‘MY COMPUTER’, 4,3’ )  COM
RIGHT(str,N) left/right from the given string.
Example. SELECT LEFT(‘MYSQL’, 2 )  MY
SUBSTR(str,P,[N]) Returns the substring for given
● ‘A%’ : Any string starting with ‘A’ character. ● ‘_ _A’ : Any 3 character string ending with ‘A’. SELECT LEFT( Name, 4) FROM Student;
MID (str,P,N) position (P) and (N) characters. If N
● ‘_B%’ : Any string having second character ‘B’ ● ‘_ _ _’ represents any 3 letter string. SELECT RIGHT(‘MYSQL’, 3 )  SQL
is (-ve) then backward position
Making Simple Queries Using SELECT Clause: SELECT MID(‘COMPUTER’, 4,3 )  PUT
counted.
Displaying all records with columns Using Column Aliases - SELECT MID (Name, 4,3) FROM Student;
SELECT * FROM Student ; SELECT Name, DOB AS ‘Date of Birth’ FROM Student; INSTR(str1,str2) Returns the index of first
occurrence of str2 in str1. SELECT SUBSTR(‘ABCDEFG’ , -5, 4) ;  CDEF
Displaying all records with selected columns. Making Expressions: SELECT SUBSTR(‘ABCDEFG’ , 3) ;  CDEFG
SELECT Name, City FROM Student ; SELECT 4*3 ; SELECT INSTR(‘CORPORATE’, ‘OR’);  2
Displaying unique values in a column SELECT Name, Sal*12 FROM EMP;
SELECT DISTINCT City FROM Student ; SELECT Name, Sal*12 AS ‘Annual Salary’ FROM EMP;
Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 13 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 14 of 25
Date & Time Functions: SELECT CURDATE() ;  2024-10-31
CURDATE() Returns the current date in YYYY- SELECT CURDATE()+10;  2024-11-10 UNIT-3 [10 Marks] 1M 2M 3M 4M 5M Total
CURRENT_DATE() MM-DD format. SELECT NOW() ; Introduction to Computer Networks 3 2 - - 5 10 M
NOW() Returns the current date & Time as SELECT DATE(‘2008-12-31 01:02:03’) ;
YYYY-MM-DD HH:MM:SS  2008-12-32 A computer network is a collection of two or more computing devices which are interconnected to share data and
DATE() Returns the date part of a date- SELECT YEAR(‘2008-12-31’) ;  2008 other resources. The Computer network facilitates transfer or exchange of information in the form of text, image,
time expression. SELECT YAER(DOB) FROM Student; and audio, video through wired or wireless transmission medium.
SELECT MONTH(‘2008-12-31’) ;  12 A computer Network may include-
DAY(), MONTH() Returns the Day/Month/Year from
SELECT * From Emp Where MONTH( DOB)=10;  Hosts or Nodes: Devices receives or sends data like computers, laptops, mobiles etc.
YEAR() given date or date type column.
SELECT * FROM Student Where DAY( DOB)=15;  Network devices: Devices manages transfer of data like Switch, Router and Modem etc.
DAYNAME() Returns the name of the weekday SELECT DAYOFWEEK(‘2008-12-31’) ; 1
DAYOFMONTH() Returns the day of month (1-31).  Transmission Media (wired or wireless): Media which carries data signals like wire or Bluetooth etc.
SELECT DAYOFYAER(‘2010-02-05’) ; 36
DAYOFWEEK() Returns the day of week (1-7).  Protocol: Set of rules which control the communication.
DAYOFYEAR() Returns the day of year (1-366). Advantages of Computer Network:
 Sharing Resources: Network facilitates sharing of hardware and software resources like sharing of data,
Aggregate Functions: SELECT SUM (Sal) FROM Emp; programs and printer etc. among users irrespective of their physical location.
SUM() Returns the sum of given column. SELECT SUM(Sal) FROM Emo WHERE
 Improved Communication: Computer network enables fast, reliable and secure communication between
MIN() Returns the minimum value in the column. City=‘Guwahati’;
users like Sending e-mail, SMS and MMS etc.
MAX() Returns the maximum value in the column. SELECT MAX (Sal) FROM Emp;
SELECT MAX(Sal) FROM Emp WHERE
 Reduced Communication cost: Sharing resources also reduces its communication cost. Internet and Mobile
AVG() Returns the Average value of the given column. network playing very important role in sending and receiving text, image, audio and video data at low cost.
City=‘Jaipur’;
COUNT() Returns the total number of NOT NULL values in
SELECT AVG (Sal) FROM Emp; Types of Computer Network:
the column/ number of records. A network may vary in size, complexity and coverage area. On the basis of coverage of geographical area, data
SELECT COUNT (Name) FROM Emp;
Note: SELECT COUNT (*) FROM Emp; transfer speed and complexity, a computer network may be classified as:
 Aggregate functions works on whole column (vertically) SELECT COUNT(*) FROM Emp  LAN (Local Area Network) : LAN connects devices placed in limited geographical area like a single room, a
and ignores NULL values. WHERE City=‘Jaipur’; floor, buildings or campus. LAN usage wires (Ethernet cables) or wireless (Wi-Fi) to connect devices and offers
 Never use Aggregate functions with WHERE clause. Note: Count(*) gives number of records. high speed data transfer rates usually varies from 10-100 Mbps.
Grouping Records - GROUP BY Clause Select Sum (Sal) from EMP where  MAN (Metropolitan Area Network): The MAN may connects several LANs and covers a larger geographical
Some time it is required to apply a Select query on a group of City=‘Kanpur’; area like a city or a town. Cable TV network or cable based broadband internet services are examples of MAN.
records instead of whole table. Select Min (Sal) from EMP Group By City; This kind of network may be extended up to 100 km.
GROUP BY <column> [HAVING <Condition>] clause with Select Select Job, Sum(Sal) from EMP Group By Job;  WAN (Wide Area Network): The WAN covers large geographical area like countries and continents. A WAN is
command makes groups. A group column is chosen which have Select AVG(Sal) from EMP Group By City; formed by connecting several LANs and MANs. The Internet is the largest WAN that connects billions of
non-distinct (repeating) values like City, Job etc. Select Count(*) from EMP Group By City; computers, smart phones and millions of LANs from different continents.
Condition may be applied on Groups with HAVING. Generally, Select Job, Sum(Pay) from EMP Group By Job  PAN (Personal Area Network): The PANs are small network which connects devices in small proximity up to 10
the Aggregate Functions are applied on groups. HAVING Avg(Pay)>=7000; meters using wired USB connectivity or wireless system like Bluetooth, Infrared , Wi-Fi etc. PAN facilitates
Tips: A query question containing “wise” or “for each” Select Job, Sum(Pay) from EMP Group By Job transfer of files like songs, videos, images etc. from one computer, mobile to other.
indicates the use of Group By clause with Select. HAVING Count(*)>=5; PAN LAN MAN WAN
Joining two tables (Join Query): Covered Area Approx. 10 mt. Room, Building, May cover a city Country or
Sometimes it is required to access information from two or more tables, which requires the Joining of tables. A complex or campus continents.
query in which two or tables are required to join is called Join Query. The following major types of Join can be Media used Data cable, Ethernet , Coaxial Optical fiber, Radio Microwave and
implemented on tables – Infrared/Bluetooth. cable, Wifi etc. wave, Microwave satellite etc.
Cross Join: Each record of Table-11 is joined with each record of Table-2. It is also called Cartesian product. If Network Cable, Dongle LAN card,Hub, MODEM, Router, MODEM, Router,
Table-1 has 3 columns and 5 records, and Table-2 has 4 columns and 6 records then 5x6=30 records with 3+4=7 Devices used Switch, Repeater Gateway Gateway
columns will be generated as result. Transmission Media:
Natural Join: Tables are joined on the equality of common column and common column will be displayed once. A Transmission medium is a medium of data transfer over a network. The selection of media depends on the cost,
Equi-Join: It is mostly similar to Natural Join where two tables are joined on the equal value of given column but data transfer speed, bandwidth and distance.
record contains all column from both tables. Transmission Medium is divided into two major categories:
The commonly used method of Joining table is- (A) Wired (Guided) Media:
SELECT < Column(s)> FROM <Table1, Table 2 > WHERE <Joining Condition> [Order By ..] [Group By ..]
 Twisted Pair Cable: Twisted pair or Ethernet cable is most common media which consists of four insulated
You may add more conditions using AND/OR/NOT operators, if required.
pairs of wires twisted around each other. It is low-cost, flexible and easy to install cables and can transfer
Join condition mostly usage Common Column of both tables and written as-
data upto 100 mts distance. It uses RJ-45 Connector for connecting devices.
Table1.Common col=Table2.Common col (You can also use alias (short name) of tables in Join condition.)
Ex. Find out the name of Employees working in Production Deptt.  Co-Axial Cable: This cable consists a solid insulated wire surrounded by wire mesh separated by foil or
Select Ename From EMP, DEPT Where Emp.DeptNo=Dept.DeptNo AND Dname=‘Production’; insulator. Co-axial Cable or Coax, is mostly used in Cable TV transmission and can carry data upto 500 mts.
Ex. Find out the name of Employees working in same city from where they belongs (hometown).  Optical Fiber: An optical fiber is a thin, flexible, and transparent strand of glass or plastic that carry light
Select Ename From EMP, DEPT Where Emp.DeptNo=Dept.DeptNo And City=Location; signals instead of electric current. Signal are transmitted in the form of light emitted from source using
Ex. Find out the name of students enrolled in B.Tech Course. Light Emitting Diode (LED) or LASER beam. Optical fibers offers secure and high speed transmission upto a
Select Ename From STUDENT AS S, COURSE AS C Where S.CourseID=C.CourseID and Cname=‘B.Tech’; long distance.
Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 15 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 16 of 25
(B) Wireless (Unguided) Media: Mesh Topology:
 Infrared Wave: It used for short-range (approx. 5 mt) communication using wireless signals. It is mostly In Mesh topology, all devices are directly connected to each other, forming a mesh-like structure. Mesh topology
used in Remote operated devices like TV, Toys, Cordless phones etc. is most expensive and complex to implement and manage.
 Bluetooth: Bluetooth is a wireless technology for creating personal networks operating within a range of
10 meters.
 Wi-Fi (Wireless Fidelity): Wi-Fi communication is similar to Bluetooth in operation, but it covers a large
coverage (50-200 mts.)
 Radio waves: Radio wave is used to make broadcast network like FM Radio within city. Radio wave
propagates in Omni direction (surrounding) and can penetrate solid walls/buildings etc.
 Microwaves: Microwave are high energy electromagnetic waves propagates in line of sight direction. It is Introduction to Internet:
high speed wave and can cover distance upto 100 km.  Internet is a network of networks that consists of millions of private, public, academic, business, and
 Satellite: Satellite works like a Trans-Receiver Antenna in the space, which receives, regenerates and government networks, that are linked by various wired, wireless, and optical networking technologies.
redirects signals using Microwave. Services like DTH, VSAT, GPS and Satellite phones etc. are offered by
 The Internet is a global system of interconnected computer networks that use the standard Internet protocol
the satellite.
suite (TCP/IP) to serve billion users worldwide.
Network Devices:  The modern Internet is an extension of ARPANet (Advanced Research Project Agency Network), created in
Networking devices are equipment that receive or transmit data or signal and make communication channel. 1969 by the American Department of Defense.
Some common Networking devices are-  The Internet carries variety of information resources and services, such as the inter-linked hypertext
 Network Interface Card (NIC): A NIC (Network Interface Card) or LAN Card enables computer to connect with documents of the World Wide Web (WWW), communicational infrastructure to support e-mail, chat and
a network using a RJ-45 port. Each LAN card possess a unique 6 Byte Physical (static) address known as Media transfer of Text, Images, Audio, Video etc.
Access Control (MAC) Address, which is used to identifies a device uniquely over the network. WLAN Application of Internet:
(Wireless) card is also used for connecting PC/Laptops with Wireless Network.
 World Wide Web (WWW):
 Hub: A Hub is a device which connects multiple computers together to form a Local Area Network (LAN). Hub
makes Broadcast type Network and do not manage traffic over the network channel. Nowadays Hub is Word Wide Web (WWW) or Web is a collection of inter-linked hypertext pages accessed through Web
obsolete technology and Switch is used in place of Hubs. Browser program using internet. A web page may contains information in form of text, images, audio,
video or Animation. The resources on the web can be shared or accessed through the Internet. The Web
 Switch: Switch is similar to Hub that also connects several nodes to form a Network. But Switch is faster than
pages (HTML pages) are stored on web server and transferred via the Hypertext Transfer Protocol (HTTP)
hub due to better traffic management and control over Network. Switch can also be used to combine various
using a software application called a web browser.
small network segments to form a big Network.
Tim Berners Lee, a British computer scientist invented the revolutionary World Wide Web in 1990 by
 Repeater: A Repeater is a device that regenerates the received signals and re-transmits to its destination. In
defining three fundamental technologies i.e. HTML, WWW and URL.
case of twisted pair cable (Ethernet), signals become weak after 100 meters. So, Repeaters are required at
each 90- 100 meters to maintain signal strength. A Hub or Switch also works as a repeater.  HTML: Hyper Text Markup Language (HTML) is a language which is used to design Web Pages. A web page
is designed using HTML tags like <HEAD>,<BODY> etc. to define the web page layout and organized
 Router: Router is an inter-networking device which connects multiple Networks to form a big Network. The
contents which to be displayed by the web browser. Webpages are stored as .html or .htm files.
basic role of Routers is to determine the best possible route (shortest path) for the data packets to be
transmitted. In a large network (WAN), multiple routers work to facilitate speedy delivery of data packets.  URL (Uniform Resource Locator) : URL is a unique address of web resources located on the web. It
provides the location and mechanism (protocol) to access the web resource. URL is also called a web
 Gateway: A Gateway device connects dissimilar networks having different protocols. Gateway is also called
address. A URL contains protocol, subdomain, Domain and name of webpage along with path/directory.
protocol converter, since it converts data packets from one protocol to other while connecting two dissimilar
networks. Usually it is implemented by software within a router device.
 MODEM: A MODEM (MOdulator-DEModulator) device connects Telephone line to the Computer. It converts
Digital signal into Analog (Modulation) and Analog to Digital (Demodulation). This conversion is required
because Telephone lines can’t carry digital data. Generally it is used to connect a PC with Telephone lines to Protocol- Protocols may be http, https, ftp and telnet etc.
access Internet or make voice call using PC.
Subdomain- Subdomain may be www, blog, and mail etc.
Network Topologies: Domain- Domain contains name of website and 3 characters Top level domain (TLD) like .com, .edu, .org,
The layout of interconnection of computers and devices in a network is called Topology. .net etc. Sometimes country domain (2 letters) also used like .uk, .in, .nz etc.
The selection of topology for a network, depends on Cost of media, Flexibility to add more devices and Reliability Path and Web page- last segment of URL may contains location/path and webpage name.
of network (Fault detection in case of Network failure). Some commonly used Topologies are-  E-Mail:
Bus Topology:
Email (electronic mail) is the ways of sending and receiving message(s) using the Internet. The message
In the bus topology, all devices are connected to a main or backbone cable. It is simple and oldest topology used can be either text onto the email application or an attached file (text, image, audio, video, etc.). E-mail
in the early days of computer networking. address like [email protected] identifies the sender and recipients. Now days Web-based e-mail services are
Ring Topology: available at free of cost through various service providers like Google-Gmail, Yahoo- Yahoo mail,
In a ring topology, all nodes are connected to a main cable making a closed loop (ring). All data packet travel in the Microsoft-Hotmail & Outlook etc. E-mail service providers may provide extra facilities like filtering spam,
ring in the same direction and passes through each node. search emails by sender or contents and organizing contacts and email ids, sending email to cc, bcc (blind
Tree Topology: carbon copy) recipients etc.
Tree topology combines multiple star topology networks together onto a bus (Bus-Star approach). In its simplest An Email application uses SMTP (Simple Mail Transfer Protocol), IMAP (Internet Mail Access Protocol) and
form all connecting devices (hub or switch) are connected to the bus network to make "root" of the network tree. POP(Post Office Protocol) etc. to handle mails over network.
Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 17 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 18 of 25
 Instant Messaging (Chat): responds to those requests.
Each web server is assigned a unique domain name, so that it can be accessed from anywhere using Internet. The
Instant Messaging (IM) or Chatting over the Internet means communicating to people at different
web browser from the client computer sends a HTTP request for a page and web server then accepts request,
geographic locations in real time through text message(s). It is similar to e-mail, except that message is
interprets, searches and responds (HTTP response) against request of the web browser. The requested web page
sent immediately to recipient. It facilitates user to type and send messages to make conversation.
is then displayed in the browser of the client. If the requested web page is not found, web server generates “Error:
Applications such as WhatsApp, Slack, Skype, Yahoo Messenger, Facebook Messenger etc., are examples
404 Not found” as a response.
of instant messengers. Some applications support sending audio and video along with text chat.
 Voice Over Internet Protocol (VoIP): Web Hosting:
Voice over Internet Protocol (VoIP), allows make voice call over the Internet. VoIP offers voice Web hosting is a service that enables you to publish website on the Internet. Once a website is created, it should
transmission over a computer network (IP) rather than through regular telephone network. It is also be placed on web server for global access.
known as Internet Telephony. Examples of Voip are Whatsapp, Skype, Google Chat etc. For webhosting, we need storage/space on a web server where all the files (webpage) and necessary data can be
 Video calls and Video Conferencing : stored. Mostly Web Server services (CPU, RAM, and storage etc.) are taken on rent basis from the cloud service
providers and web developer hosts website on server by uploading the files constituting the website (HTML, CSS,
Video Conferencing allows two or more people to make two-way video and audio transmissions. In Video
JavaScript, images, databases, etc.). These services are usually paid and resources can be increased or decreased
conferencing, group of people at multiple locations may participate rather than individuals. H.239 is
as per requirement.
commonly used protocol for Video conferencing. Google Meet, Microsoft Team, Skype, Zoom or
WhatsApp are most commonly used applications for video conferencing or meeting. All web servers are assigned a unique numeric address called IP address when connected to the Internet. This IP
address needs to be mapped to domain name (Website name/URL) of the website using DNS (Domain Name
Website: Service). The domain name can be registered (purchased) through an authorized agency i.e. Registrar Domain
In general, a website is an organized collection of interlinked web pages related through hyperlinks, stored on a Names.
web server to provide information or service to its visitor.
All the pages of a website are stored under one domain name and have a common theme or template. For Web Browser:
example, the website of CBSE will have all the pages related to syllabus, Circulars, Events, resource materials etc., A Web browser is a software application that helps us to view the web page(s) from web server to any client
under one domain name and having a common design theme. device. Some commonly used web browsers are Google Chrome, Internet Explorer, Mozilla Firefox, Opera, etc. A
A website can be accessed by providing the address of the website (URL) in the browser. The main page of web browser essentially displays the HTML documents which may include text, images, audio, video and
website (Home/Index page) will be open when it is opened on the browser. hyperlinks that help to navigate from one web page to another.
Web Page: The modern browsers allow a wide range of visual effects, use encryption for advanced security and also have
A web page is a HTML document on the WWW that can be viewed through web browser. To make web pages cookies that can store the browser settings and data.
more attractive, various styling CSS (Cascaded Style Sheet) and formatting are applied on a web page. Further, Every web browser offers certain settings that define the manner in which the browser will behave. These settings
program codes (scripts) may also be used to make webpage interactive and define different actions and behavior. may be related to privacy, search engine preferences, download options, auto fill and autocomplete feature,
JavaScript, PHP and Python are commonly used script language. theme and much more. Each browser application allows customization of its settings through setting options.
A web page is usually a part of a website and may contain information in the forms of texts, images, audio and Add-ons and Plug-ins:
video etc. Depending on the functionality and features, a web page may be classified as-
Add-ons and plug-ins are the tools that help to extend the functionality of the web browser.
Static Web Page:
A static webpage is one who’s content always remains static, i.e., does not change for person, location or device. An add-on is also called extension in some browsers and is used to add a particular functionality to the browser
Static web pages are generally written in HTML or CSS and have the extension .htm or .html. like playing sound or graphics is an example of an add-on. Mostly these Add-ons are provided as Extensions
Dynamic Web Page: through a library provided by the Web Browser which can be installed from the browsers setting options.
A dynamic web page is one in which the content of the web page can be different for different users according to A plug-in is a complete program or third-party software which offers some extra functionality to users. For
language, location or device. The dynamic are more complex in design and take more time to load than static web example, Flash players and Java are plug-ins etc. A Flash player is required to play a video in the browser. A plug-in
pages. Dynamic web pages can be created using script languages such as JavaScript, PHP, ASP.NET, Python etc. is a software that is installed on the host computer and can be used by the browser for multiple functionalities
Web pages displaying the date, time, weather report, multi-lingual pages or auto resizing webpage as per screen and can even be used by other applications as well.
size of the client device are Dynamic web page. Cookies:
Static V/s Dynamic Web Page
A cookie is a small text file, which is transferred by the webserver to the browser while surfing a website. The
Static Webpage Dynamic Web page
information stored in cookies are related to user, pages were visited, choices and menu(s) settings on a particular
The static web pages display the same content The dynamic Web page changes its appearance or
website. It helps in customizing the web pages like language, auto-login information, preferences and sometimes
each time, irrespective of location or device. contents according to user, location or device.
remembering the shopping preference and displaying advertisements of interest, etc.
It takes less time to display on browser at client Dynamic web pages take more time while displaying on
end. browser. Cookies are usually harmless and they can’t access information from the hard disk or transmit virus or malware.
These are simple in layout and style and no Mostly database is used at server-end to store contents However, cookies may be privacy threats. Sometimes viruses can also be tricked as cookies and cause harm to a
Database is used. and style information. computer system. Cookies can be disable by changing the Privacy and Security settings of the browser.
Mostly designed through HTML and stored as Designed in Script language like Java Script, ASP.Net,
.htm or .html format PHP etc. and stored as .php,.asp etc.
Web Server:
A web server stores and delivers the contents of a website to web clients (browser) when requested.
A web server as a computer, stores Web server Application software and a website's contents (HTML pages,
images, CSS style sheets, and Script files).
Web server as a software, is a specialized program that understands URLs and requests from browsers, and
Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 19 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 20 of 25
UNIT-4 [10 Marks] 1M 2M 3M 4M 5M Total Be Precise:
Societal Impacts 3 4 3 - - 10 M Always respect other’s precious time and data usage. So while writing emails, messages etc. be concise in
contents and share large sized files as attachment to avoid data usage for download. However necessary large
files may be shared through cloud storage like Google Drive, OneDrive, Dropbox etc.
Digital Footprint:
Be Polite:
Digital footprint is the trail of information that people leave online or in any communicating devices.
We should be polite and non-aggressive in our communication. So avoid being abusive even if we don’t agree with
Digital footprint incudes all activities carried over digital devices and Internet like websites we visit, emails and
others’ point of view.
messages we send, and any information we submit online, posts on social media, online purchases, software and
Be Credible:
apps used, music, video downloaded or uploaded etc.
We should be cautious while making a comment, replying or writing an email or post. Such acts decide our
All our online activities leave a data trace on the Internet as well as on the computing device that we use. This can
credibility and reflect our digital personality.
be used to trace the user, their location, device and other usage details.
There are two kinds of digital footprints we leave behind. Data Protection:
Data protection refers to the practices, safeguards, and rules to protect your personal information and ensure
 Active Footprints
that you remain in control of it. Personal data refers information relating to your private life like biometric
Active digital footprints includes information that we intentionally submit online. This may include emails we
information, health and financial information, or other personal documents, images or audios or videos etc.
write, or responses or posts we make on different websites or mobile Apps, etc.
How to protect our private Data?
 Passive Footprints
The digital data trail we leave online unintentionally is called passive digital footprints. This includes the data  Be careful while sharing information on Internet.
generated when we visit a website, use a mobile App, browse Internet, etc.  Browse websites privately and ensure that the URL contain HTTPS and a pad lock sign.
Net and Communication etiquettes:  Ensure safe and trusted sites while entering sensitive information.
Now days our society is turning as Digital Society. Digital society reflects the growing trend of using digital  Never save passwords while working on public computer.
technologies in all spheres of human activities. Anyone who uses digital technology along with Internet is a digital
 Avoid entering sensitive information onto a public computer and erase history and traces of your work
citizen or a Netizen.
from public computers, if used.
Being a good netizen, all of us need to be aware of some ethics, morals and values to be maintained during online.
Intellectual Property Rights (IPR):
A responsible netizen must abide by the following etiquettes-
Intellectual Property refers to the literary and artistic works, inventions, designs and symbols, names and logos
Net etiquettes :
etc. The ownership of such property lies with the creator, or the holder of the intellectual property.
Net Etiquettes or Netiquettes is code of good behavior on the Internet. It may include- The owners of Intellectual Property holds certain exclusive legal rights through which he/she can use their
 No copyright violation: We should not use copyrighted materials without the permission of the property without any disturbance and can prevent the misuse of their property. Like other tangible property,
Be Ethical

creator or owner. While downloading and using text, image, audio, video from the internet, we owner of IPR can earn recognition or financial benefit by using their creation or invention. So, violation of
must mention courtesy or credit to original author or owner. intellectual property right is punishable offence.
 Share expertise: Share only true and unambiguous information and knowledge on Internet so In India, Intellectual Property is governed under the Patents Act, 1970; Trademarks Act, 1999; Copyright Act, 1957;
that others can access to get benefitted from it. Designs Act, 2001 etc.
 Respect privacy: We should respect the right to privacy and the freedom of expression of Intellectual Property is also legally protected through copyrights, patents, trademarks etc. commonly known as
others. Our personal communication may include images, documents, files, etc., that may be Intellectual Property Right (IPR).
Be Respectful

private to both. We should not share such images, documents, files, etc. without consent of Copyrights:
owner.  Copyright gives legal rights to creators for their original works like writing, photograph, audio recordings,
 Respect diversity: In a group or public forum, we should respect the diversity of the people in video, sculptures, architectural works, Software and other creative works like literary and artistic work.
terms of knowledge, experience, culture, Religion and other aspects. Avoid comments and  The copyrights include right to copy (reproduce), share, display, distribute etc. It prevents others from
passing remarks on others in social media platforms. copying, using or selling the work.
 Don’t feed troll: Writing comments with the aim of getting a reactions from others is commonly  Copyrights are automatically granted to creators and authors. Copyright law gives the copyright holder a set
Be Responsible

referred to as “trolling”. Since trolls thrive on attention, the best way to discourage trolls is not of rights that they alone can avail legally. Copyright is valid for life time of the author and 60 years after
to pay any attention on such comments. his/her death.
 Avoid cyber bullying: Any insulting or degrading behavior like posting of rumors, giving threats Patent:
online, posting the other’s personal information, sexual harassment or comments aimed to  A patent is usually granted for inventions, innovations and process etc.
publicly ridicule a person is called cyber bullying. Cyber Bullying is a punishable offence and our  Patent owner gets an exclusive right to prevent others from using, selling, or distributing the protected
actions can be traced using our digital footprints. invention and gives full control to the patentee to decide whether or how the invention can be used by
 Secure password: We should have strong and frequently changed password. Never share others.
personal credentials with others to avoid misuse of account.  The inventor needs to apply (file) for patenting the invention. A patent protects an invention for 20 years.
Be Secure

 Know who you befriend: Be careful while being friend to unknown people as their intentions Trademark:
possibly could be malicious and unsafe.  Trademark includes any visual symbol, word, name, design, slogan, label, etc., that distinguishes the brand or
 Beware of fake information: We should apply our knowledge and experience to validate Fake commercial enterprise, from others.
news, messages and posts. Never forward fake posts.  Trademark prevents others from using a confusingly similar mark, including words or phrases. For example,
Communication Etiquettes: no company other than Nestle can use the Nescafe brand name to sell coffee.
Digital communication includes email, texting, instant messaging, talking on the cell phone, audio or video  The owner of a trademark may take legal action against trademark infringement. Most countries require
conferencing, posting on forums, social networking sites, etc. We should follow the following etiquettes while formal registration of a trademark for product or services for 10 years, if not renewed.
making communication-

Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 21 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 22 of 25
Plagiarism: Hacking:
Plagiarism is stealing someone else’s intellectual work, idea or thoughts and representing its own. Hacking is the act of unauthorized access to a computer, computer network or any digital system.
Plagiarism is an unethical practice of using other’s work without giving credit to its original author or source. A hacker gains unauthorized access to computers or networks in order to steal sensitive data with the intent to
Sometimes considered as an act of fraud. Some common example of plagiarism are- damage or bring down systems. Hackers as technical expert of the hardware and software, and use their skill for
 Copying someone’s work and presenting its own. illegal and malicious purposes or personal gain.
 Act of stealing or copying literary work and not giving the credit to its author or original creator. An Ethical hackers explore any vulnerability or loophole in the system with positive intent and reports to the
 Copying software programs written by other programmers and claiming them as your own. owner for improvement.
The following points may be used to avoid plagiarism. Phishing:
 Always use your own idea and words. Never claim other’s work and idea as your own. Phishing is an act of acquiring sensitive and private information such as User name, passwords, Credit card
 Always give reference of sources or website, if material is taken from elsewhere. number, bank account details etc. using a trap-mail or voice call in which user himself discloses their private
details. The most common phishing method is through a fake or forged email in which user is asked to provide
 Always give acknowledgement and credit to author or creator, if his/her material is used. confidential information and the user presumes that it is being asked by authentic source and gives all details in
 Quotations or phrases should be used as it is with citation of author. good faith.
Difference between Plagiarism and Copyright: Phishing attempts through phone calls or text messages are also common these days. So never disclose your
Plagiarism Copyright private and confidential data to anyone without knowing its authenticity.
Plagiarism is using someone else's work or ideas Copyright infringement includes the unauthorized or Cyber Bullying:
without giving proper credit. unlicensed copying of a work.
Cyberbullying is a form of harassment using electronic means or social media. Harmful bullying behavior can
Plagiarism is a violation of academic norms and Copyright violation is crime and punishable illegal
include posting rumors, threats, vulgar remarks, revealing victims' personal information etc.
unethical practice but normally not illegal. offence in terms of law.
Victims of cyberbullying may experience lower self-esteem and various negative emotional responses, including
Plagiarism applies when ideas are copied Copyright violation occurs only when a specific being scared, frustrated, angry, or depressed. Cyber Bullying is different from Troll in which a person (troll) posts
content like sequence of words or image is copied. inflammatory, insincere, digressive, or off-topic messages in an online community with the intent of
Licensing and copyright: provoking readers into displaying emotional responses, or manipulating others' perception.
A license is a type of contract or agreement between user and creator or copyright owner to describe the terms Overview of Indian IT Act:
under which user is allowed to use the copyrighted material.
The Information Technology Act 2000 (IT Act) in India provides legal framework against cybercrime and e-
Generally licensing term is related to computer software when developer/author of the software share their
commerce activities. The Information Technology Act, 2000 (IT Act) was notified on 17 October 2000. The original
works with others under license, and allows others to use and even modify the content. Since, software are also
Act contained 94 sections, divided into 13 chapters and 4 schedules.
intellectual work and are subject to copyright, so software are used under certain usage guidelines and
restrictions imposed by developer or software company. These usage guidelines are called License. The IT Act is applicable to all parts of the country. Persons of other countries can also be indicted under this Act, if
the crime involves a computer or network located in India.
The Licensing is different from copyright in the following ways-
Licensing Copyright The IT Act has been amended to cope with new challenges on 23rd December 2008 (IT Act 2008) and notified on
License is an agreement between user and content Copyright is legal right which describes the use and October 27, 2009. IT Act–2008, is a new version of IT Act 2000.
developer which describes the usage rights and access of contents without transferring ownership of E-waste: hazards and management:
restrictions on its application. the contents.  E-waste (Electronic waste) includes electric or electronic gadgets and devices that are no longer in use. E-
It describes the terms under which people are Copyright is the legal term used to declare and prove waste includes discarded or unusable electrical-electronic devices like computers, laptop, tablets, mobile
allowed to use the copyrighted material. who owns the intellectual property. phones, television sets, and other electronic home appliances.
 E-waste is one of the fastest growing environmental hazards in the world. It is major cause of degradation of
Free and Open Source Software (FOSS): environment and pollution.
In general, open source refers to any program whose source code is made available for use or modification by
others i.e. Source code is open for all. Open source software is usually developed as a public collaboration and  When e-waste is carelessly thrown or dumped in landfills or grounds, certain chemicals and metals used in
made freely available to all without any restrictions. electronic products cause air, water and soil pollution. Harmful chemicals and poisonous gases mixed up in
Open Source Software (OSS) which are freely available to all for self-use, study, distribute to others and groundwater, soil, and air and therefore affect animals and human life through crop’s yields, drinking water
modification or improvement in the software are called Free and Open Source Software (FOSS). and breathing.
Example: OpenOffice, Linux, Java, PHP, MySQL, Python etc. are commonly used Open Source Software.  If e-waste is not disposed of in proper manner, it can be extremely harmful to humans, plants, animals and
Cybercrime and Cyber laws: the environment. Therefore, it is very important that e-waste is disposed of in such a manner that it causes
Cybercrime refers to any crime wherein the computer is either a tool or a target or both. minimum damage to the environment and society.
Some example of Cyber Crime are- Managing e-Waste:
 Posting offensive messages on Social Networking Portals.
We can minimize the impact of E-waste by efficient disposal of e-waste. The best policy for e-waste
 Hacking of Computer or Cracking Security systems.
management is reduce, reuse and recycle.
 Unethical Financial transactions and Fraud through Internet
 Harassment through e-mails and messages. Reduce: Try to reduce the generation of e-waste by maximum use of devices till its useful life through proper
 Creation & propagation of Virus, Worms or Trojans etc. maintenance.
 Cyber terrorism. Reuse: The working equipment may be donated or sold to someone who is still willing to use it.
Like traditional crime such as theft, fraud, forgery, defamation and mischief, Cybercrime are also treated as Recycle: Recycling is the process of conversion of e-waste into something that can be used again and again in
criminal activities and are subject of punishment. The Information Technology Act 2000 (IT Act) in India provides some or the other manner.
protection against cybercrime and also known as Cyber Law.
Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 23 of 25 Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 24 of 25
Disposal of e-Waste:
 Donate your old usable and working devices to needy people, who can use it.
 Old and obsolete devices may be returned manufacture or seller to purchase new one (Buy Back).
 Non-repairable devices may be given to Recycling Agencies for proper disposal or re-cycling.
 Non-functional devices may be donated to Service Centers, so that they can utilize some functional parts
while repairing others.
 Do not through electronic product in open area or sell to street garbage collectors because they have no
proper disposal system.
Awareness about health concerns related to the usage of technology:
Today’s life cannot be imagined without using technologies like Mobile, Internet and other IT tools. The modern
technologies have effected every domain of human life like communication, education and health. Technology has
transformed our lives, and for most of us, life may not be easy without using gadgets and technologies.
But Excessive usage of digital devices has a negative impact on our physical as well as psychological well-being.
Some common impacts are-
 Decreasing use of our own memory.
 Decreased use mental and physical activity.
 More Device dependency.
 Addicted to screens, social media, games etc.
 Poor physical health: Eye strain, Muscle Problems, Sleep disorder, gaining weight etc.
 Social and emotional issues: Isolation, Depression, anti-social behaviour etc.
Proper use of technologies and devices:
 Use devices in proper posture. Prefer an ergonomic furniture and follow natural sitting style.
 Limit your time and set boundaries of using technologies. Never be addicted to Internet and Social media.
 Follow 20-20-20 rule i.e. take a 20-second break from the screen every 20 minutes and look at something
20 feet away to minimize eye strain.
 Take regular breaks from technology to reduce stress and improve mental clarity.
 Take help of others when needed and avoid excess use of technology and dependency on gadgets.

Quick Revision Material: Class XII - Informatics Practices (2024-25) Page: 25 of 25

You might also like