0% found this document useful (0 votes)
46 views92 pages

Ip Kvs

The document outlines the curriculum for Class XII Informatics Practices (065) for the academic year 2023-24, detailing the syllabus, learning outcomes, and practical components. It covers topics such as data handling with Pandas, SQL database queries, computer networks, and societal impacts of technology. Additionally, it includes a distribution of marks and suggested practical exercises for students.

Uploaded by

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

Ip Kvs

The document outlines the curriculum for Class XII Informatics Practices (065) for the academic year 2023-24, detailing the syllabus, learning outcomes, and practical components. It covers topics such as data handling with Pandas, SQL database queries, computer networks, and societal impacts of technology. Additionally, it includes a distribution of marks and suggested practical exercises for students.

Uploaded by

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

SESSION: 2023-24

केन्द्रीय विद्यालय संगठन,


पटना संभाग
KENDRIYA VIDYALAYA SANGATHAN,
PATNA REGION

INFORMATICS PRACTICES (065)

CLASS - XII
STUDENT SUPPORT MATERIAL
CBSE CURRICULUM
PATRON

SH. ANURAG BHATNAGAR


DEPUTY COMMISSIONER, KVS RO PATNA

OUR MOTIVATORS

SMT. SOMA GHOSH SH. MANISH K PRABHAT SH. PURNENDU MANDAL


AC, KVS RO PATNA AC, KVS RO PATNA AC, KVS RO PATNA

COURSE DIRECTOR

SH. RISHI RAMAN


PRINCIPAL, KV AFS DARBHANGA
CONTENTS PREPARED BY

SN TEACHER NAME DESIG. NAME OF KV


KV SASARAM
1 SH KUNDAN KAMAL PGT -CS
KV NPGCL NABINAGAR
2 SH RAJESH SINGLA PGT -CS
KV RAU PUSA
3 SH TARANJIT SINGH PGT -CS
KV AFS DARBHANGA
4 SH ABHIJEET SINGH GURENIYA PGT -CS
INDEX
SN CONTENTS Page No.
1 SYLLABUS

UNIT-1: Data Handling using Pandas and Data


2 01-31
Visualization

3 UNIT-2: Database Query using SQL 32-56

4 UNIT-3: Introduction to Computer Networks 57-69

5 UNIT-4: Societal Impacts 70-84


Informatics Practices
CLASS XII
Code No. 065
2023-2024

1. Prerequisite: Informatics Practices – Class XI

2. Learning Outcomes
At the end of this course, students will be able to:
● Create Series, Data frames and apply various operations.
● Visualize data using relevant graphs.
● Design SQL queries using aggregate functions.
● Import/Export data between SQL database and Pandas.
● Learn terminology related to networking and internet.
● Identify internet security issues and configure browser settings.
● Understand the impact of technology on society including gender and disability
issues.

3. Distribution of Marks and Periods


Unit Unit Name Marks Periods Periods Total
No Theory Practical Period
1 Data Handling using Pandas and 25 25 25 50
Data Visualization

2 Database Query using SQL 25 20 17 37

3 Introduction to Computer 10 12 0 12
Networks

4 Societal Impacts 10 14 - 14

Project - - 7 7

Practical 30 - - -

Total 100 71 49 120

4. Unit Wise syllabus

Unit 1: Data Handling using Pandas -I

Introduction to Python libraries- Pandas,


Matplotlib.
Data structures in Pandas - Series and
Data Frames.
Series: Creation of Series from – ndarray, dictionary, scalar value; mathematical
operations; Head and Tail functions; Selection, Indexing and Slicing.

Data Frames: creation - from dictionary of Series, list of dictionaries, Text/CSV files;
display; iteration; Operations on rows and columns: add, select, delete, rename; Head and
Tail functions; Indexing using Labels, Boolean Indexing;

Importing/Exporting Data between CSV files and


Data Frames.

Data Visualization
Purpose of plotting; drawing and saving following types of plots using Matplotlib – line
plot, bar graph,

histogram

Customizing plots: adding label, title, and legend in plots.

Unit 2: Database Query using SQL

Revision of database concepts and SQL commands covered in class XI

Math functions: POWER (), ROUND (), MOD ().

Text functions: UCASE ()/UPPER (), LCASE ()/LOWER (), MID ()/SUBSTRING
()/SUBSTR (),
LENGTH (), LEFT (), RIGHT (), INSTR (), LTRIM (), RTRIM (), TRIM ().

Date Functions: NOW (), DATE (), MONTH (), MONTHNAME (), YEAR (), DAY (),
DAYNAME ().

Aggregate Functions: MAX (), MIN (), AVG (), SUM (), COUNT (); using COUNT (*).

Querying and manipulating data using Group by, Having, Order by.

Working with two tables using equi-join

Unit 3: Introduction to Computer Networks

Introduction to networks, Types of network: PAN, LAN, MAN, WAN.


Network Devices: modem, hub, switch, repeater, router, gateway
Network Topologies: Star, Bus, Tree, Mesh.
Introduction to Internet, URL, WWW, and its applications- Web, email, Chat, VoIP.
Website: Introduction, difference between a website and webpage, static vs dynamic
web page, web server and hosting of a website.

Web Browsers: Introduction, commonly used browsers, browser settings, add-ons and
plug-ins, cookies.

Unit 4: Societal Impacts

Digital footprint, net and communication etiquettes, data protection, intellectual property
rights (IPR), plagiarism, licensing and copyright, free and open source software (FOSS),
cybercrime and cyber laws, hacking, phishing, cyber bullying, overview of Indian IT Act.

E-waste: hazards and


management.

Awareness about health concerns related to the usage of technology.

Project Work
The aim of the class project is to create tangible and useful IT application. The learner
may identify a real-world problem by exploring the environment. e.g. Students can
visit shops/business places, communities or other organizations in their localities
and enquire about the functioning of the organization, and how data are generated,
stored, and managed.

The learner can take data stored in csv or database file and analyze using Python libraries
and generate appropriate charts to visualize.

Learners can use Python libraries of their choice to develop software for their school or
any other social good.

Learners should be sensitized to avoid plagiarism and violation of copyright issues while
working on projects. Teachers should take necessary measures for this. Any
resources (data, image etc.) used in the project must be suitably referenced.

The project can be done individually or in groups of 2 to 3 students. The project should be
started by students at least 6 months before the submission deadline.

Practical Marks Distribution

S. No. Unit Name Marks

1 Programs using Pandas and Matplotlib 8

2 SQL Queries 7
3 Practical file (minimum of 15 programs based on Pandas, 4 based on 5
Matplotlib and 15 SQL queries must be included)

4 Project Work (using concepts learned in class XI and XII) 5

5 Viva-Voce 5

TOTAL 30

5. Suggested Practical List


5.1 Data Handling
1. Create a panda’s series from a dictionary of values and a ndarray
2. Given a Series, print all the elements that are above the 75th percentile.
3. Create a Data Frame quarterly sales where each row contains the item category, item
name, and expenditure. Group the rows by the category and print the total expenditure
per category.
4. Create a data frame for examination result and display row labels, column labels data
types of each column and the dimensions
5. Filter out rows based on different criteria such as duplicate rows.
6. Importing and exporting data between pandas and CSV file

5.2 Visualization
1. Given the school result data, analyses the performance of the students on different
parameters, e.g subject wise or class wise.
2. For the Data frames created above, analyze, and plot appropriate charts with title and
legend.
3. Take data of your interest from an open source (e.g. data.gov.in), aggregate and
summarize it. Then plot it using different plotting functions of the Matplotlib library.
5.3 Data Management
1. Create a student table with the student id, name, and marks as attributes where the
student id is the primary key.
2. Insert the details of a new student in the above table.
3. Delete the details of a student in the above table.
4. Use the select command to get the details of the students with marks more than 80.
5. Find the min, max, sum, and average of the marks in a student marks table.
6. Find the total number of customers from each country in the table (customer ID,
customer Name, country) using group by.
7. Write a SQL query to order the (student ID, marks) table in descending order of the
marks.
Python Library - Pandas
It is a most famous Python package for data science, which offers powerful and flexible data structures that
make data analysis and manipulation easy. Pandas builds on packages like numpy and matplotlib to give us
a single convenient place for data analysis and visualization work.
Basic Features of Pandas
1. Dataframe object help a lot in keeping track of our data.
2. With a pandas dataframe, we can have different data types (float, int, string, datetime etc.) all in one
place.
3. Pandas has built in functionality like easy grouping & joins of data.
4. Good IO capabilities; easily pull data from a MySQL database directly into a data frame.
5. Tools for loading data in to in memory data objects from different file formats.
6. Data alignment and integrated handling of missing data.
7. Reshaping and pivoting of data sets.
8. Label based slicing, indexing and sub setting of large data sets.
1. Series
Series is like a one-dimensional array like structure with homogeneous data.

Basic feature of series are


❖ Homogeneous data
❖ Size Immutable
❖ Values of Data Mutable

Creation of Series is possible from – ndarray, dictionary, and scalar value.


Syntax: pandas.Series(data, index, dtype, copy).
Series can be created using
1. Array
2. Dict
3. Scalar value or constant

Creation of an Empty Series:


import pandas as pd
s = pd.Series()
print(s)
Output: Series([], dtype: float64)

Creation of a Series from ndarray without index:


import pandas as pd
import numpy as np
data = np.array(['a', 'b', 'c', 'd'])
s = pd.Series(data)
print(s)
Output:
1 a
2 b
3 c
4 d
dtype: object

Note: default index is starting from 0


Creation of a Series from ndarray with index:
import pandas as pd
import numpy as np
1
data = np.array(['a', 'b', 'c', 'd'])
s = pd.Series(data, index = [100, 101, 102, 103])
print(s)
Output:
100 a
101 b
102 c
103 d
dtype: object
Note: index is starting from 100
Creation a Series from dict:
Eg.1(without index)
import pandas as pd
import numpy as np
data = {'a' : 0., 'b' : 1., 'c' : 2.}
s = pd.Series(data)
print(s)
Output:
a 0.0
b 1.0
c 2.0
dtype: float64

Eg.2 (with index)


import pandas as pd
import numpy as np
data = {'a' : 0., 'b' : 1., 'c' : 2.}
s = pd.Series(data, index = ['b', 'c', 'd', 'a'])
print(s)
Output
b 1.0
c 2.0
d NaN
a 0.0
dtype: float64

Creation a Series from Scalar:


import pandas as pd
import numpy as np
s = pd.Series(5, index = [0, 1, 2, 3])
print(s)

Output:
0 5
1 5
2 5
3 5
dtype: int64

Note: Here 5 is repeated for 4 times (as per number of index)

Arithmetical operations with Series:


import pandas as pd output:

2
s = pd.Series([1, 2, 3]) 0 2
t = pd.Series([1, 2, 4]) 1 4
u= s + t #addition operation 2 7
print(u) dtype: int64

u=s * t # multiplication operation 0 1


print(u) 1 4
2 12
dtype: int64

head() function:
import pandas as pd
s = pd.Series([1, 2, 3, 4, 5], index = ['a', 'b' ,'c' ,'d' , 'e'])
print (s.head(3)) # Return first 3 elements

Output:
a 1
b 2
c 3
dtype: int64

tail() function:
import pandas as pd
s = pd.Series([1, 2, 3, 4, 5], index = ['a', 'b', 'c', 'd', 'e'])
print (s.tail(3)) # Return last 3 elements

Output:
c 3
d 4
e 5
dtype: int64
Accessing Data from Series with indexing and slicing:
import pandas as pd
s = pd.Series([1, 2, 3, 4, 5], index = ['a', 'b', 'c' ,'d', 'e'])
print(s[0]) #for 0 index position
print(s[:3]) #for first 3 index values
print([-3:]) #for last 3 index values

Output:
1
a 1
b 2
c 3
dtype: int64
c 3
d 4
e 5
dtype: int64

Retrieve Data Using Label as index:


import pandas as pd
s = pd.Series([1,2,3,4,5], index = ['a', 'b', 'c', 'd', 'e'])

3
print (s[[‘c’, ’d’]])
Output
c 3
d 4
dtype:int64

Retrieve Data from selection:


There are two methods for data selection:
❖ loc gets rows (or columns) with particular labels from the index.
❖ iloc gets rows (or columns) at particular positions in the index (so it only takes integers).
e.g.
>>> s = pd.Series(np.nan , index=[49,48,47,46,45, 1, 2, 3, 4, 5])
>>>s.iloc [:3] # slice the first three rows
49 NaN
48 NaN
47 NaN
>>> s.loc [:3] # slice up to label 3
49 NaN
48 NaN
47 NaN
46 NaN
45 NaN
1 NaN
2 NaN
3 NaN

Related questions from pre board papers


1. Write the output of the following: 25 35
import pandas as pd
D = {} 35 45

for i in range(25, 95, 10):


D[i] = i + 10 45 55

S1 = pd.Series(D)
print(S1) 55 65

Ans.
65 75
25 35
35 45
75 85
45 55
55 65 85 95
65 75 dtype:int64

75 85
85 95
dtype: int64

2. Write the output of the following:


import pandas as pd 0 1
L = [1, 2] 1 2
for i in range(25, 95, 10): 2 25
L.append(i) 3 35
S1 = pd.Series(L) 4 45
print(S1) 5 55
6 65
Ans.
7 75
0 1
8 85
dtype:int64
4
1 2
2 25
3 35
4 45
5 55
6 65
7 75
8 85
dtype: int64

3. Write a program to display all odd numbers and its sum from the given Pandas Series.
0 15
1 2
2 8
3 4
4 1
5 25
6 30
Ans.
import pandas as pd
S1 = pd.Series([15, 2, 8, 4, 1, 25, 30])
S2 = S1[S1 % 2 != 0]
print("Sum of all odd numbers is : ", sum(S2.values))

4. Write a program in python to display all values of given pandas series with first character in upper case.
for example original Series is :
0 ravi
1 ram
2 sonu
3 david

Expected Output:

0 Ravi
1 Ram
2 Sonu
3 David
dtype: object
Ans.
import pandas as pd
S1 = pd.Series(["ravi", "ram", "sonu", "david"])
L = S1.values
L1 = [ ]
for i in L:
L1.append(i[0].upper() + i[1:])
S2 = pd.Series(L1)
print(S2)

5. Write a program to find the minimum, maximum, and average of all the values of given Pandas Series.
0 15
1 2
2 8
3 4

5
4 1
5 5
6 14
Ans.
import pandas as pd
S1 = pd.Series([15, 2, 8, 4, 1, 5, 14])
print("Maximum value is : ", max(S1.values))
print("Minimum value is : ", min(S1.values))
print("Average value is : ", sum(S1.values) / S1.count())

6. Write a program to arrange the given Pandas Series in increasing order.


0 150
1 252
2 85
3 420
4 111
5 275
Ans.
import pandas as pd
S1 = pd.Series([150, 252, 85, 420, 111, 235])
print("Series after sorting is: ")
print(S1.sort_values())

7. Write a program to increase those value in the given Pandas Series by 50 which are less than 70.
0 150
1 252
2 35
3 420
4 50
5 61
6 275
Ans.
import pandas as pd
S1 = pd.Series([150, 252, 35, 420, 61, 275])
S1[S1 < 70] = S1[S1 < 70] + 50
print(S1)

Data Frames
Data Frames is a two-dimensional (2-D) data structure defined in pandas which consist of rows and columns.

6
Characteristics of Data Frames:
1. The data stored in a data frame is heterogeneous can be of numeric, factor or character type.
2. Data Frame has 2 axes (indices) rows and columns
o Row index (axis=0) ->known as index
o Column index (axis=1) ->known as column-name
3. Size – Mutable
4. Value is mutable
5. Element of data frame can be accessed using row indices along with column indices.
6. Can Perform Arithmetic operations on rows and columns
Creation of Data Frames:
A pandas DataFrame can be created using the following constructor function:
pandas.DataFrame(data, index, columns, dtype, copy)
Parameters Details:

Creation an Empty DataFrame:

Creation a DataFrame from List:

7
Creation a DataFrame from Dict of Lists: All the Lists must be of same length. If index is passed, then the
length of the index should equal to the length of the Lists.

Creation an indexed DataFrame using Lists:

Creation a DataFrame from List of Dicts: List of Dictionaries can be passed as input data to create a
DataFrame. The dictionary keys are by default taken as column names.

8
Creation an indexed DataFrame using Lists of Dicts

Creation a Data Frame from Dictionary of Series: Dictionary of Series can be passed to form a DataFrame.
The resultant index is the union of all the series indexes passed. The dictionary keys are by default taken as
column names.

Creation a Data Frame from 2D numpy array: Each row is the corresponding row required in the dataframe.

9
Attributes of DataFrames:
Attributes are the properties of a DataFrame that can be used to fetch data or any information related to a
particular dataframe.

1. index - The index(row labels) of the DataFrame

2. If index is 0, 1, 2 then it will return range index

3. columns - The Columns labels of the DataFrame

4. axes - Returns a list containing both the axes(row and column axis)

5. dtypes - Returns the dtypes of the DataFrame

6. size - Returns an integer representing the number of elements in the DataFrame

7. shape - Returns a tuple representing the dimension of the DataFrame

10
8. values - Returns a numpy array of the dataframe values

9. empty - Indicates whether the dataframe is empty or not

10. T - This attribute is used to change the rows into columns and columns into rows.

11. ndim - ndim means the number of dimensions.

Accessing DataFrame elements:

1. To Access a particular column give the name of column inside access operator:

2. To Access a multiple columns pass a list name of column inside access operator:

Access using loc property:


It Access a group of rows and columns by label. loc[] is primarily label based, but may also be used with a
Boolean array.

11
It allows input:
1. A single label
2. A list or array of labels
3. A slice object with labels (both the start and the stop are included)
4. A Boolean array of the same length as the axis being sliced, e.g. [True, False, True].
5. Conditional that returns a Boolean Series

1. Single label. Note this returns the row as a Series.

2. List of labels.

3. A slice object with index labels.

4. A Boolean array of the same length as index being sliced.

5. Condition that returns a Boolean Series.


12
Single label for row and column.

Slice with labels for row and column.

Boolean list with the same length as the row axis.

Condition that returns a Boolean Series.

ACCESS USING iloc PROPERTY


It Access a group of rows and columns by integer index. It allows input:
1. A single integer index.
2. A list or array of integer index.
3. A slice object with integer index (start index included and the stop not included).
4. A Boolean array of the same length as the axis being sliced, e.g. [True, False, True].
5. Conditional that returns a Boolean Series.

1. A single integer index.

13
2. A list or array of integer index.

3. A slice object with integer index.

4. A Boolean array.

Indexing the rows and columns:


You can mix the indexer types for the index and columns.
1. A single integer index.

2. A list or array of integer index.

3. A slice object with integer index.

4. With a Boolean array whose length matches the columns.

14
iterrows DataFrame elements:
DataFrame.iterrows(): The iterrows() method generates an iterator object of the DataFrame, allowing us to
iterate each row of the DataFrame . It returns DataFrame rows as (index, Series) pairs. Iterrows() returns a
Series for each row, it does not preserve dtypes across the rows.

You can use next () function returns the next item of an iterator

You can use next () function returns the next item of an iterator

15
head() method of DataFrame:
DataFrame.head (n = 5): Return the first n rows. This function returns the first n rows for the object based
on position. For negative values of n, this function returns all rows except the last n rows

1. When no parameter is given default top 5 Rows will returned

2. When parameter (n) is given top n Rows will returned

3. When negative parameter (-n) is given it will returned all rows excluding last n Rows.

tail() method of DataFrame:


DataFrame.tail (n = 5): Return the last n rows. This function returns the last n rows for the object based on
position.For negative values of n, this function returns all rows except the first n rows
1. When no parameter is given default last 5 Rows will returned

16
2. When parameter (n) is given last n Rows will returned

3. When negative parameter (-n) is given it will returned all rows excluding first n Rows.

Modify DataFrame elements:

loc/iloc is used to modify one or multiple elements:


Modify single element using loc property

Modify Multiple elements using loc property

Modify Single element using iloc property

Modify multiple elements using iloc property


17
We can also change data of an entire column to a particular value in a DataFrame:

For example, the following statement sets marks 100 for the column name ‘Eng':

We can also change data of an entire row to a particular value in a DataFrame using loc:
For example if we want to change the record of R1 to [‘TOM’, 100, 100]

Adding new column to DataFrame

18
Add a new column Hindi to the dataframe df
Method -1: By declaring a new list as a column. New column will add in last

Method -2: By using DataFrame.insert() to add a column at any position we like and not just at the end

Add a new record [‘Tom’, 80, 40] to the dataframe df


EX-1: loc is used add a row at the last of dataframe

EX-2: if row inserted in between the dataframe existing row will replaced

19
Deleting rows and columns from a DataFrame
We can use the DataFrame.drop() method to delete rows and columns from a DataFrame. We need to
specify the names of the labels to be dropped and the axis from which they need to be dropped. By Default
axis is 0 or index
DELETING ROWs

Deleting columns from a DataFrame

Boolean Indexing in a DataFrame


Boolean indexing helps us to select the data from the DataFrames using a Boolean vector We need a
DataFrame with a Boolean index to use the Boolean indexing. Consider the dataFrame df bellow:

20
Now, we can access the DataFrame by passing Booleans to the methods loc[]

Access DataFrame elements using condition test

Importing/Exporting Data between CSV files and Data Frames.


CSV - A comma-separated values file is a text file that uses a comma to separate values. Each line of the file
is a data record. Each record consists of one or more fields, separated by commas.
To read a csv file in dataframe read_csv() method is used

Example Consider a csv file product

To write a dataframe to a csv file to_csv() method is used


Consider following DataFrame df which has Name of candidate and course name

21
22
Related questions from pre board papers
1. Write the output of the following code:
import numpy as np
import pandas as pd
A = np.array([35, 40, 71, 25])
B = np.array([27, 34, 56, 73])
C = [11, 22, 33, 44]
DF = pd.DataFrame([A, B, C])
print(DF)
Ans.
0 1 2 3
0 35 40 71 25
1 27 34 56 73
2 11 22 33 44

2. Complete the following code to get the Output given below:


import pandas as ________________
L1 = [["Aman", 45], ["Ankit", 56], ["__________", 67]]
DF = pd.______________(L1, ______________=["Name", "Marks"], index=[__________])
print(DF)
Output:
Name Marks
1 Aman 45
2 Ankit 56
3 Sunita 67
Ans.
import pandas as pd
L1 = [["Aman", 45], ["Ankit", 56], ["Sunita", 67]]
DF = pd.DataFrame(L1, columns = ["Name", "Marks"], index = [1, 2, 3])
print(DF)

3. Which attribute of dataframe is used for the following:


(i) To display row labels.
(ii) To display column labels.
(iii) To display data type of each column in the DataFrame.
(iv) To display all the values in the DataFrame.
(v) To display number of rows and columns in a tuple.
(vi) To display total number of values in the dataframe.
(vii) To transpose the dataframe.
(viii) To returns the value True if DataFrame is empty and False otherwise.

Ans.
(i) index, (ii) columns, (iii) dtypes, (iv) values, (v) shape, (vi) size, (vii) T, (viii) empty

4. Aman wants to add a new row with values (“Suman”, 9, 11) at the end of the dataframe “df”. He does not
know the total number of rows available in dataframe. As a friend of Aman, help him to write the code.
Ans. df.loc[len(df.index)] = ("Suman", 9, 11)

5. Write the code to delete the columns with label ‘Marks’, ‘Class’ and ‘Rollno’ from dataframe “DF”.
Ans. DF = DF.drop([‘Marks’, ‘Class’, ‘Rollno’], axis = 1)

6. Raman wants to change the column label “Salary” to “Salaries”. Help him to write the code.
Ans. DF = DF.rename({“Salary” : “Salaries”}, axis=’columns’)

23
7. Raman wants to change the row label 0, 1, 2 to “One”, “Two”, “Three” respectively. Help him to write
the code.
Ans. DF = DF.rename({0 : “One”, 1 : “Two”,2 : “Three”}, axis = ‘index’)
8. Consider the pandas dataframe “DF” given below:
Arnab Ramit Samridhi Riya Mallika
Maths 90 92 89 81 94
Science 91 81 91 71 95
English 85 86 83 80 90
Hindi 97 96 88 67 99
Write the output of :
a. print(DF.loc[“Maths”] > 90)
Ans.
Arnab False
Ramit True
Samridhi False
Riya False
Mallika True
Name: Maths, dtype: bool

b. print(DF.loc[ : , “Arnab”] > 90)


Ans.
Maths False
Science True
English False
Hindi True
Name: Arnab, dtype: bool

c. print(DF.loc[[True , False , True , False]])


Ans.
Arnab Ramit Samridhi Riya Mallika
Maths 90 92 89 81 94
English 85 86 83 80 90

9. Consider the dataframe created (‘DF’) in Q. No. 8 above and answer the following questions:
a. Write the code to insert column “Amit” with values (90, 92, 95, 89) at position 5 (after Mallika)
Ans. DF.insert(5, “Amit” , [90, 92, 95, 89]) or DF[“Amit”]=[90, 95, 80, 75]
b. Write the code to insert column “Amit” with values (90, 92, 95, 89) at position 2.
Ans. DF.insert(2, “Amit” , [90, 92, 95, 89])
c. Write the code to delete column “Riya” from dataframe “DF”
Ans. del DF[“Riya”] or DF.drop(“Riya”, axis = 1)
d. Write the code to delete columns “Ramit” and “Riya” from dataframe “DF”
Ans. DF.drop(["Ramit" , "Riya"], axis = 1, inplace = True)
d. Write the statement to display marks of “Amit” in “Maths”.
Ans. print(DF.loc[“Maths” , “Amit”]) or print(DF.loc[“Maths” : “Maths”, “Amit” : “Amit”])

10. Write two differences between del statement and drop() function of pandas dataframe.
Ans. Differences are :
del drop( )
(i) It can delete only column (i) It can delete both row and column.
(ii) del can delete only one column at one time. (ii) Multiple columns can be deleted by drop( )
24
Data Visualization
Data visualization is the presentation of data in graphical format. To do so using script of Python we use one
of the libraries available with Python, called matplotlib. Matplotlib is a comprehensive library for creating
static, animated, and interactive visualizations in Python.

The various types of plotting:


Line Chart: Line graphs are plots where a line is drawn to indicate a relationship between a particular set of
x and y values.

Scatter Plot: Scatter plots are the graphs that present the relationship between two variables in a data-set. It
represents data points on a two-dimensional plane or on a Cartesian system. The independent variable or
attribute is plotted on the X-axis, while the dependent variable is plotted on the Y-axis.

25
Bar Graph: A bar chart is used to show a comparison among different attributes, or it can show a comparison
of items over time.

Histogram: Histograms provide a visual interpretation of numerical data by indicating the number of data
points that lie within a range of values. The higher that the bar is, the greater the frequency of data values in
that bin.

Pie Chart: A Pie Chart is a circular statistical graphic which is divided into slices to illustrate numerical
proportion.

26
Frequency Polygon: A frequency polygon is a graph constructed by using lines to join the midpoints of each
interval or bin.

Box Plot: A box plot is a graphical representation of statistical data based on the minimum, first quartile,
median, third quartile, and maximum. The term “box plot” comes from the fact that the graph looks like a
rectangle with lines extending from the top and bottom.

Functions to be remembered:
Function Name Use Syntax
xlabel(), ylabel() To give labels for x plt.xlabel(‘Year')
axis and y axis plt.ylabel(‘No of visitors’)
title() To give chart title plt.title('Park Analysis')
show() To display the chart plt.show()
legend() To place a legend in plt.legend() - label is expected with X and Y
the chart (an area plt.legend((‘sine’, ‘cosine’), loc='upper left',
describing the frameon=False) -customizing
elements of the
graph).
xticks(), yticks() TO SET ticks (the plt.xticks(index, label, fontsize = 6)
values used to show
specific points on the
coordinate axes. They
can be numeric or
string) label of x axis.
plot() To plot the graph plt.plot(X, Y, color = 'b')

27
plt.plot(X, Y, color = 'green', linestyle = '-' , linewidth =
4)
scatter() To create a scatter plot plt.scatter(days, weight, c = ‘red', marker = 'o‘, s = 75)
bar() To create the bar chart plt.bar(year, total_vehicles, align = ’center’)
barh() To create a horizontal plt.barh(year, total_vehicles)
bar chart
pie() To create a pie chart. slices = [7, 2, 2, 13]
activities = ['sleeping', 'eating', 'working', 'playing']
cols = ['c', 'm', 'r', 'b']
plt.pie(slices, labels = activities, colors = cols,
startangle=90,\ shadow = True, explode = (0, 0.1, 0, 0),
autopct = '%1.1f%%')

Note: Start angle = 90 means everything is rotated


counter-clockwise by 90 degrees. Shadow gives the
shadow effect to the slices. Explode to make slices
appear out of the pie or offsetting a slice. Autopct string
used to label the wedges with the numeric value. The
value after point indicates how many numbers after the
decimal point.
hist() To create a histogram plt.hist([5, 15, 25, 35, 45, 55], bins = [0, 10, 20, 30, 40,
50, 60], weights = [20, 10, 45, 33, 6, 8], edgecolor =
"orange")

Note: bins - block used to combine values before getting


the frequency.
hist() To create a frequency plt.hist([5, 15, 25, 35, 15, 55], bins=[0, 10, 20, 30, 40, 50,
[histtype = 'step'] polygon 60], weights=[20, 10, 45, 33, 6, 8],\
edgecolor = "orange", histtype = 'step')
boxplot() To create a boxplot plt.boxplot(data, labels = [‘pattern1’, ’pattern2’,\
’pattern3’], patch_artist = True)

Note: patch_artist attribute used to fill the boxplot with


colours.
savefig() To save a plot in a file plt.savefig('bar_plot.pdf')
plt.savefig('hist_plot.
plt.savefig('scatter_plot.png')

Related questions from pre board papers


1. Create a horizontal bar graph of following data. Add suitable labels.
City Population
Delhi 23456123
Mumbai 20083104
Bangalore 18456123
Hyderabad 13411093
Ans:
import numpy as np
import matplotlib.pyplot as plt
Cities = [‘Delhi’, ’Mumbai’, ’Bangalore’, ’Hyderabad’]
Population = [23456123, 20083104, 18456123, 13411093]
plt.barh(Cities, Population]
plt. ylabel(‘Cities’)
plt.xlabel(‘Population’)
plt.show()

28
2. What will be the output of the following code?
import matplotlib.pyplot as p
x = [6, 7, 8, 9, 10]
y = [60, 40, 55, 30, 70]
p.title('Secondary Class Strength')
p.xlabel('Class')
p.ylabel('No. of students')
p.bar(x, y)
p.show()

Ans:

3. Fill in the blank with appropriate pyplot methods:


import matplotlib.pyplot as p
Year = [2000, 2002, 2004, 2006]
Rate = [21.0, 20.7, 21.2, 21.6]
___________________ # To draw a line graph
p.xlabel('Year')
p.ylabel('Rate')
p.title('Fuel Rates in every Two Year')
__________________(“Graph1.pdf”) # To save the graph
p.show()

Ans. p.plot(Year, Rate), p.savefig

4. Write a python program to draw a bar chart with the following information:
City Population
Kolkata 78
Delhi 91
Kanpur 88
Patna 90
Banglore 82

The barchart should have the following features:


a) X-axis label should be City and Y-axis label should be Pollution
b) The title of the chart should be Pollution Index
c) The colour of the bars should be Red

29
Ans:
import matplotlib.pyplot as plt
import numpy as np
city = np.array(['Kolkata', 'Delhi', 'Kanpur', 'Patna', 'Bangalore'])
pollution = np.array([78, 91, 88, 90, 82])
plt.xlabel('City')
plt.ylabel('Pollution')
plt.title('Pollution Index')
plt.bar(city, pollution, color = 'red')
plt.show()

5. Write a python program to draw a histogram with following information:


10, 15, 10, 10, 10, 15, 20, 20, 20, 20, 20, 25, 25
The histogram should have following information
a) X-axis label should be score and Y-axis should be Frequency
b) The title should be Frequency of Score
c) The colour of histogram should be blue with 10 bins
Ans:
import matplotlib.pyplot as plt
import numpy as np
arr = np.array([10, 15, 10, 10, 10, 15, 20, 20, 20, 20, 20, 25, 25])
plt.xlabel('Score')
plt.ylabel('Frequency')
plt.title('Frequency of Score')
plt.hist(arr, color = 'blue', bins = 10)
plt.show()

6. Ms. Sujata, a class teacher want to plot a bar graph for the name of days on x-axis and total students
present on those days on y-axis to get the average weekly attendance. Complete the code to perform the
following:
i. To plot the bar chart in statement1
ii. To show the chart in statement 2
import matplotlib.pyplot as pl
Days=['Mon', 'Tue', 'Wed', 'Thurs', 'Fri', 'Sat']
Present=[36, 37, 32, 31, 35, 39]
pl.bar(Days, Present) #Statement1
pl.show() #Statement2
Ans. Statement1 -> pl.bar(Days,Present), Statement2 -> pl.show()

7. Mr. Shiv wants to plot a scatter chart for the given set of values of subject on x-axis and number of
students who opted for that subject on y-axis.
Complete the code to perform the following :
(i) To plot the scatter chart in statement 1
(ii) To display the scatter chart in statement 2
import matplotlib.pyplot as plt
x = ['Hindi', 'English', ’Math’, 'Science', 'SST']
y = [10, 20, 30, 40, 50]
__________#Statement 1
__________#Statement 2
Ans: Statement 1 -> plt.scatter(x,y), Statement 2 -> plt.show()

8. MrAjay wants to plot a horizontal bar graph of the above given set of values with programming language
on x axis and its popularity on y axis with following code.

30
Import matplotlib.pyplot as plt
x = ['Java', 'Python', 'PHP', 'JS', 'C#', 'C++']
popularity =[22.2, 17.6, 8.8, 8, 7.7, 6.7]
_______________________ #Statement1
plt.xlabel("Popularity")
plt.ylabel("Languages")
plt.show()
Complete the code by writing statement1 to print the horizontal bar graph with colour green
Ans: plt.barh(x, popularity, color = 'green')

9. Mr. Kamlesh wants to plot a Bar Graph for the given set of values of months on x-axis and number of
participants who attended workshop in particular month on y-axis. Complete the code to perform the
following:
(i) To plot the bar graph in statement1
(ii) To add label for x-axis as “No. of Students attended” in graph in statement2
import matplotlib.pyplot as plt
x = ['JAN', 'FEB', 'MAR’, 'APR', ’MAY’, ’JUN’]
y = [30, 20, 30, 50, 10, 60]
_____________________ #Statement 1
_____________________ #Statement 2
Ans: Statement1 -> plt.bar(x,y), Statement2 -> plt.xlabel(“No. of Students attended”)

10. Ms. Shalu wants to plot a Line Chart for the given set of values of months on x-axis and number of
participants who attended workshop in particular month on y-axis. Complete the code to perform the
following:
(i) To plot the Line Chart in statement1
(ii) To add Title as “Status of Workshop” in graph in statement2
import matplotlib.pyplot as plt
x = ['JAN', 'FEB', 'MAR’, 'APR', ’MAY’, ’JUN’]
y = [30, 20, 30, 50, 10, 60]
_____________________ #Statement1
_____________________ #Statement2
Ans.
Statement1 -> plt.plot(x,y), Statement2 -> plt.title( “Status of Workshop”)

31
Unit-2: Database Query Using SQL
Revision of database concepts and SQL command covered in class XI

DATABASE: DBMS is a collection of interrelated data in arranged form and set of


programs used to access those data.
Advantages of DBMS:
▪ Elimination of data redundancy
▪ Data consistency
▪ Sharing of data
▪ Data Integrity
▪ Data isolation
▪ Privacy and Security
▪ Improved Backup and Recovery
DATA MODELS:
Data models describe the structure of the database. There are four data models in DBMS:
1. Relational Data Model
2. Hierarchical Data Model
3. Network Model
4. Object Oriented Data Model
Relational Data Model: This database consists of a collection of table. These tables are
called relations. A row in a table represents a relationship among a set of values.
▪ Relation: A relation is a table with columns and rows.
▪ Tuple: A row of a relation OR each row of a table.

▪ Domain: A set of values for the columns.


▪ Attribute: Column name of a relation.
▪ Degree: Total number of attributes/Column in a table

▪ Cardinality: Total number of tuples OR Number of rows in a table.


▪ View: A virtual table that does not exists but it is derived from other table

PRIMARY KEY: A column or Group of Column, which uniquely identify a Tuple in a


Table, is called Primary Key. A Primary key cannot have null or duplicate values. A table can

32
have only ONE primary key but a Combination of columns can also act as primary key.
Example Roll No., PNR Number, Aadhaar etc.

CANDIDATE KEY: All Columns or group of Column, that can act as a primary key are
called Candidate key.
ALTERNATE KEY: A candidate key that is not the primary key or All candidate
key other than Primary key is known as alternate key.
FOREIGN KEY: is a non-key attribute, which helps to establish a relation with another
table. It is generally the Primary Key of another table.

SQL:
▪ SQL stands for Structured Query Language.
▪ This is non-procedural Language.
▪ This is the common language for relational database. Means this language is used in
MySQL.
MySQL:
▪ MySQL stands for My Structured Query Language.
▪ MySQL is freely available, Open source Relational Database Management System
(RDBMS).
▪ It provides features for creating, storing, manipulating and accessing data stored in the
form of database and their tables.
Advantages of MySQL:
1 Ease of Use: It is very easy to learn and use.
2 Performance: MySQL is fast and large volume of database can be handled.
3 Data Security: In has powerful mechanism for ensuring only authorized users have access
the data.
4 Flexibility: MySQL can be linked to most of the other high level languages.
5 Portable: it is compatible with other languages like MS Access, Oracle etc.
6 Case Sensitive: MySQL is not case sensitive language.
Data Types:- Data types are rules that define what type of data may be stored in a column
and how that data is actually stored. Data types used in MySQL categorized into following
categories:

(i) Numeric –Integer, Float, Decimal, Numeric

33
(ii) String – Char, Varchar

(iii) Date -Date

(iv) Time -Time

NULL Values: If a column in a row has no value, then column is said to be null. NULLs
can appear in a column if the column is not restricted by NOT NULL or Primary Key. You
should use a null value when the actual value is not known.
Null and Zero is not equivalent. Any arithmetic expression containing a null always evaluates
to null.
Example: 7 + null = null
7 + 0 = 7 Difference between null and zero.

Classification of SQL commands:


SQL commands are categorized into four sub languages:
(i) Data Definition Language (DDL)
(ii) Data Manipulation Language (DML)
(iii) Data Query Language (DQL)
(iv) Transaction Control Language (TCL)
(v) Data Control Language (DCL)
(i) Data Definition Language (DDL): It consist the commands for creating, manipulating,
altering and deleting the table.
COMMANDS: CREATE, ALTER, DROP, RENAME, TRUNCATE, USE, SHOW

(ii) Data Manipulation Language (DML): It is used to manipulates data and for queries.
e.g. retrieval, insertion, deletion, modification of data stored in database.
COMMANDS: SELECT, INSERT IN TO, UPDATE, DELETE
Data Definition Language (DDL):
1. CREATE DATABASE
To create a new database in the system.
Syntax: CREATE DATABASE <DATABASE NAME>;
e.g. CREATE DATABASE office;
2. SHOW
To display the names of all the databases in the database system
Syntax: SHOW DATABASES;
e.g. SHOW Databases;

34
3. USE
To open a database to work in it that database.
Syntax: USE <DATABASENAME>;
e.g. USE office;
4 DROP DATABASE
To remove or delete a database.
Syntax: DROP database <database name>;
e.g: DROP database Office;
5. ALTER TABLE
To modify the structure of the table. i.e. add a new attribute, delete an existing
attribute, change to size and data type of a new attribute, renaming an attribute.
ALTER TABLE EMP ADD DEPTID INT(5) //To add new column DEPT
ALTER TABLE EMP DROP DEPTID; // To delete column DEPT
ALTER TABLE EMP MODIFY ENAME VARCHAR(15); //to change data type of
a column
ALTER TABLE EMP CHANGE ECITY CITY VARCHAR(25); //to rename column
6. CREATE TABLE
To create a new table.
Eg. CREATE TABLE EMP (Ecode int(6), Ename varchar(30), Dept varchar(30), city
varchar(25), sex char(1), DOB Date, salary float(12,2) );

Ecode Ename Dept City Sex Dob Salary

7. SHOW TABLES
To display the names of all the databases in the database system
Syntax: SHOW TABLES;
e.g. SHOW TABLES;
8. DROP TABLE
To remove or delete a table permanently.
Syntax: DROP TABLE <table name>;
e.g: DROP TABLE school;
9. DESCRIBE /DESC
To view the structure of the table.
Eg. DESC EMP; or DESCRIBE EMP;
35
Data Manipulation Language (DML)
1. INSERT INTO
To add new record or records into a table
e.g. INSERT INTO EMP VALUES(101,”KARAN”, “Sales”, :Delhi”, “M”, “11-04-
23”,12000);
2. DELETE
To delete rows/tuples from a table:
e.g. DELETE FROM EMP WHERE ENAME = ’Vishal’
3. UPDATE
To modify/update the values in the existing record.
Eg: UPDATE EMP set SALARY = SALARY+ 5000 where Ecode =102;
4. SELECT
To display all records or to retrieve a subset of rows and columns from one or more
tables present in a database.
SELECT * FROM EMP;
SELECT * FROM EMP WHERE SALARY>1000;
SELECT * FROM EMP WHERE SALARY BETWEEN 5000 AND 10000;
SELECT * FROM EMP WHERE ENAME LIKE “%A”;

SQL FUNCTIONS

A function is a special type of predefine command set that performs some operations and
return a single value. The values that are provided to the functions are called parameters or
arguments. Some common functions are as follows:-

Math Functions:

Mathematical functions perform operation over numeric value.

Function Syntax Description Examples


POWER() POW(A,B) Power () returns the value of a number Select POWER(2,5);
POW() raised to the power of another number Output: 32
mean return a power to B

36
ROUND() ROUND(N,D) ROUND () function rounds a number to Select round(134.29,1);
a specified number of decimal places Output: 134.3
Means Select round(135.375, 2)
Return number rounded to D place after Output: 135.38
decimals
MOD() MOD(Dividend Mod () returns the remainder of one Select MOD(16,5);
, Divisor) number divided by another. Output: 1
Select MOD(10.5, 3);
MOD(M,N) Return remainder M/N Output: 1.5

Text Functions:

FUNCTION Syntax Description Examples


UPPER () UPPER(str) Upper/Ucase() SELECT LCASE (“HELLO
UCASE() UCASE(str) function return string WORLD”);
in small letters. Output:
hello world
LOWER() LOWER(str) Lower/Lcase() SELECT UPPER (“india”) ;
LCASE() LCASE(str) function return string Output:
in upper letters. INDIA
SUBSTR() SUBSTR (str, pos, len) Return the substring SELECT SUBSTR
MID() MID(S,P,N) as specified (“HELLO WORLD”,1,5);
Return N character Output: HELLO
of string S, SELECT MID
beginning from P (“COMPUTER”,4,3);
Output: PUT
LENGTH() LENGTH(“hello India”) Return the length of SELECT LENGTH (“hello
a string in bytes India”) ;
Output: 11
Include blank space also
LEFT() SELECT LEFT Will return n SELECT LEFT (“HELLO
(“string”,n); characters of a string WORLD”,5);
from left side Output: HELLO

37
RIGHT() SELECT RIGHT Will return n SELECT RIGHT (“HELLO
(“string”,n); characters of a string WORLD”,3);
from right side Output: RLD
INSTR() SELECT INSTR It returns the SELECT INSTR
(‘string’, ’sub str’); position of sub string (“CORPORATE
in main string. FLOOR”,’OR’);
Output: 2
LTRIM() LTRIM (‘ HELLO ‘); It will remove space SELECT LTRIM
from left side (“ HELLO “);
Output: ‘HELLO ‘
RTRIM() RTRIM (‘ HELLO ‘); It will remove space SELECT RTRIM
from right side (“ HELLO “);
Output: “ HELLO“
TRIM() TRIM (‘ large ‘) Removes leading SELECT LTRIM(“ Apple “) ;
and trailing space Output-‘Apple’

Date Functions:

FUNCTION Syntax Description Examples


NOW() NOW(); Will return the SELECT NOW();
current date and time 2023-10-04 01:05:33
DATE() DATE(‘date time’); Extract the date part SELECT DATE(“2023-
of a date or date time 10-04 01:05:33”);
expression Output: 2023-10-04
MONTH() MONTH(‘date’); Return the month SELECT MONTH
from the date passed (“2013-11-04”);
Output: 11
MONTHNAME() MONTHNAME(‘date’); Returns the full SELECT MONTHNAME
name of the month (“2008-02-03”);
for date Output: 'February‘
YEAR() YEAR(‘date’); Return the year SELECT YEAR(“2023-
11-04”);
Output: 2023

38
DAY() DAY(‘date’); Returns the day of SELECT DAY(“2023-07-
the month for date, 04”);
in the range 1to 31 Output: 4
DAYNAME() DAYNAME(‘date’); Returns the name of SELECT DAYNAME
the weekday for date (“2023-10-10”);
Output: Tuesday

Aggregate Functions:
Aggregate functions are functions that take a collection of values as input and return a single
value. SQL offers five types of aggregate functions. Aggregate functions perform operation
over set of Values Consider a table Emp having following records.
Table: Emp
Empno Name Dept Salary
1 Raman Purchase 35000
2 Satish Sales 42000
3 Sonam Finance 42000
4 Vijay Sales 53000
5 Naveen Finance 65000

Table: Emp1

Code Name Sal


E1 Mohak NULL
E2 Anuj 4500
E3 Vijay NULL
E4 Vishal 3500
E5 Anil 4000

FUNCTION Syntax Description Examples


MAX() MAX(column Returns the MAXIMUM SELECT MAX(salary) from
name/expression); of the values under the emp;
specified column/ Output: 65000
expression SELECT MAX(salary) from
emp where dept=”sales”;
Output: 53000

39
MIN() MIN(column Returns the MINIMUM SELECT MIN(salary) from
name/expression); of the values under the emp;
specified Output: 35000
column/expression. SELECT MIN(salary) from
emp where dept=”finance”;
Output: 42000
AVG() AVG(column Returns the SUM of the SELECT AVG(salary) from
name/expression); values under the specified emp;
column/expression. Output: 47400.00
Null values are excluded SELECT AVG(salary) from
while avg ()aggregate emp1;
function is used Output: 4000.00
SUM() SUM(column Return the sum of the SELECT SUM(salary) from
name/expression); values in the given emp;
column Output: 237000
COUNT() COUNT(column Returns the COUNT of SELECT COUNT(Dept)
name); the number of values from emp;
Count(Distinct under the specified Output: 5
column name) column/ expression. Select count(Distinct Dept)
Null values not included from emp;
Output: 3
COUNT(*) COUNT(*); It count the number of SELECT COUNT(*) from
records in table emp emp;
Output: 5
COUNT() VS COUNT(*)

Count(<column>) – counts non-null values of the specified column

Count(*) – counts no. of records

NOTE: - The input to sum ( ) and avg( ) must be a collection of numbers, but the other
functions can operate on non-numeric data types e.g. string

Group By: The Group by clause can be used in a select statement to collect data across
multiple records and group the result one or more column. It group the rows on the basis of

40
the values present in one of the column and then aggregate functions are applied on any
column of these groups to obtains the result of the query.

In some circumstance, we would like to apply the aggregate function not only to a single set
of tuples, but also to a group of sets of tuples. We specify this wish in SQL using the group
by clause.
The attributes given in the group by clause are used to form groups.
Example: - Find the average salary at each department.

Solution: - SELECT Dept, avg(salary) FROM EMP group by Dept;


Dept Avg(salary)
Purchase 35000.00
Sales 47500.00
Finance 53500.00

Having: The HAVING clause is used in the SELECT statement to specify filter conditions
for a group of rows or aggregates The HAVING clause is often used with the GROUP BY
clause to filter groups based on a specified condition To filter the groups returned by GROUP
BY clause, we use a HAVING clause

WHERE is applied before GROUP BY, HAVING is applied after (and can filter on
aggregates) is applied before GROUP BY, HAVING is applied after (and can filter on
aggregates)

Example:
Select <column1>, <column2>,..<column n>, <aggregate function(expression)> from table
WHERE <condition> Group by[column 1, column2,… column n] Having[<condition 1,
condition 2, condition n>];
SELECT DEPT, AVG(SALARY) FROM EMP GROUP BY DEPT HAVING
AVG(SALARY)<45000;

Dept Avg(salary)
Purchase 35000.00
Order By: the SQL order by clause is used to sort the result in a specific order using
ORDER BY clause. The sorting can be done either in ascending or descending order. The
default order is ascending.
Example:- Display the list of employees in descending order of employee code.

41
Example:
Select <column list> from <table name> [where <condition>] ORDER BY <column name>
[ASC| DESC];
SELECT NAME FROM EMP ORDER BY NAME;

Name
Naveen
Raman
Satish
Sonam
Vijay
SELECT NAME, SALARY FROM EMP ORDER BY SALARY DESC;

Name Salary
Naveen 65000
Vijay 53000
Satish 42000
Sonam 42000
Raman 35000
Suppose that we wish to list the entire emp relation in descending order of salary. If several
employees have the same salary, we order them in ascending order by empno. We express
this query in SQL as follows:-
SELECT EMPNO,SALARY FROM EMP ORDER BY SALARY DESC, EMPNO ASC;
empno Salary
5 65000
4 53000
2 42000
3 42000
1 35000

• Joins: Join is query that combines rows from two or more tables, based on a common

field between them.

42
• For joining the tables more than one table is listed in the from clause of Select
Command.
• E.g: SELECT * FROM EMP, DEPT;
Types of Joins:
1. Cartesian Product
2. Equi Join
3. Natural Join
• Cartesian Product
• It return all possible concatenation of all rows from both table i e one row of First
table is joined with all the rows of second table
• Cartesian product join each row of one table with each row of another table
• So if First table have 6 rows and second table have 4 rows then total number of rows
in output will be 6 x 4 =24.
Example:
TABLE: DEPT
Deptno Dname LOC
10 SALES CHENNAI
20 RESEARCH KOLKATA
30 HR DELHI

TABLE: EMP

Eno Ename Deptno


1 Suresh 10
2 Anoop 20
SELECT * FROM EMP, DEPT;
Eno Ename Deptno Deptno Dname LOC
1 Suresh 10 10 SALES CHENNAI
2 Anoop 20 10 SALES CHENNAI
1 Suresh 10 20 RESEARCH KOLKATA
2 Anoop 20 20 RESEARCH KOLKATA
1 Suresh 10 30 HR DELHI
2 Anoop 20 30 HR DELHI

43
EQUI JOIN: When two tables are joined on the basis of equality.

Ex: Select <Column 1>, <Column2> FROM <Table1>, <table2> WHERE <table1. Primary
Key Column= Table2. Foreign Key Column>
Select Eno, Ename,, edp.Deptno, Dname, LOC from Empl, Dept WHERE Emp.Deptno=
Dept.Deptno;
Eno Ename Deptno Dname LOC
1 Suresh 10 SALES CHENNAI
2 Anoop 20 RESEARCH KOLKATA

Natural Join: Only one of the identical columns exists.

** The equi join and Natural Join are equivalent except that duplicate columns are
eliminated in the Natural Join.

• The JOIN in which only one of the identical columns exists in called Natural Join It is
similar to Equi join except that duplicate columns are eliminated in Natural join that would
otherwise appear in Equi Join

•In natural join we specify the names of column to fetch in place of which is responsible of
appearing common column twice in

44
MULTIPLE CHOICE QUESTIONS (MCQ)-1 Mark)

1 Write the output of the following SQL command.


select round(69.88,-1);
a. 69.88 b. 69.8 c. 70 d. 69.0
2 The round() function in MySql is an example of ___________________.
a. Math function b. Text function
c. Date Function d. Aggregate Function
3 If column “MARKS” of table STUDENT contains the data set (20,50, NULL,12, 73) , what
will be the output after execution of the following query.
SELECT MAX(MARKS) -COUNT(MARKS) FROM STUDENT;
a. 61 b. 95 c. 123 d.69
4 If column “salary” of table employee contains the data set (2000,500, 4300,2000, 500) , what
will be the output after execution of the following query.
SELECT COUNT(DISTINCT SALARY) FROM EMPLOYEE ;
a. 5 b. 0 c. 3 d.1
5 Consider the string “Preboard Exam 2023”. Which among the following SQL command will
gives the last 4 characters of the string as output?
(i). SELECT right(“Preboard Exam 2023”,4);
(ii). SELECT left(“Preboard Exam 2023”,4);
(iii). SELECT substr(“Preboard Exam 2023”,14,4);
(iv). SELECT substr(“Preboard Exam 2023”,15,4)
a. option (i) b. option (i) and (iii)
c. option (i) and (iv) d. option (ii)
6 The mid( ) function in MySQL is an example of _______________.
a. Math function b. Text function
c. Date Function d. Aggregate Function
7 In SQL, which function used to display current date and time?
a. Date( ) b. Time( ) c. Current( ) d. Now( )
8 Which type of values will not be considered by SQL while executing the following statement?
SELECT COUNT(column name) FROM inventory;
a. Numeric value b. text value c. Null value d. Date value

45
9 Neha, a Database Administrator, needs to display the average pay of workers from those
departments which have more than five employees. He is experiencing a problem while running
the following query: SELECT DEPT, AVG(SAL) FROM EMP WHERE COUNT(*) > 5
GROUP BY DEPT;
Which of the following is a correct query to perform the given task?
a. SELECT DEPT, AVG(SAL) FROM EMP WHERE COUNT(*) > 5 GROUP BY DEPT;
b. SELECT DEPT, AVG(SAL) FROM EMP HAVING COUNT(*) > 5 GROUP BY DEPT;
c. SELECT DEPT, AVG(SAL) FROM EMP GROUP BY DEPT WHERE COUNT(*) > 5;
d. SELECT DEPT, AVG(SAL) FROM EMP GROUP BY DEPT HAVING COUNT(*) > 5;
10 If column “Fees” contains the data set (5000,8000,7500,5000,8000), what will be the output
after the execution of the given query?
SELECT SUM (DISTINCT Fees) FROM student;
a. 20500 b. 10000 c. 20000 d. 33500
11 Which SQL statement do we use to find out the total number of records present in the table
ORDERS?
a. SELECT * FROM ORDERS;
b. SELECT COUNT (*) FROM ORDERS;
c. SELECT FIND (*) FROM ORDERS;
d. SELECT SUM () FROM ORDERS
12 Which of the following SQL functions does not belong to the Math functions category?
a. POWER() b. ROUND() c. LENGTH() d. MOD()
13 What will be printed by the given query?
SELECT LENGTH(“WIN.NER”);
a. 7 b. 6 c. 8 d. 9
14 Predict the output of the following query: 1
SELECT MOD (9,0);
a. 0 b. NULL c. NaN d. 9
15 With reference to SQL, identify the invalid data type.
a. Date b. Integer c. Varchar d. Month
16 In SQL, the equivalent of UCASE() is:
a. UPPERCASE () b. CAPITALCASE() c.UPPER() d.TITLE ()
17 In SQL, this function returns the time at which the function executes:
a. SYSDATE b. NOW c. CURRENT d. TIME

46
18 The correct SQL from below to find the city, temperature in increasing order of all cities.
A. SELECT city FROM weather order by temperature;
B. SELECT city, temperature FROM weather;
C. SELECT city, temperature FROM weather ORDER BY temperature;
D. SELECT city, temperature FROM weather ORDER BY city;
19 Where and Having clauses can be used interchangeably in SELECT queries?
a. True b. False c. Only in views d. With order by
20 Write the output of the following SQL command:
select truncate(15.88,1);
a. 15.88 b. 15.8 c. 15.9 d. 16
21 Which SQL statement is used to display all the data from product table in the decreasing order
of price?
A. SELECT * FROM PRODUCT;
B. SELECT * FROM PRODUCT ORDER BY PRICE;
C. SELECT * FROM PRODUCT ORDER BY PRICE DESC;
D. SELECT * FROM PRODUCT ORDER BY DESC;
22 In SQL, which function returns the weekday name for a given date.
a. DAY b. DAYNAME c. NAME d. DNAME
23 Which clause is used with “aggregate functions”?
a. GROUP BY b. SELECT c. WHERE d. Both A and B
24 Write output of the following MySQL command:
SELECT SUBSTR("Informatics Practices",6,9);
a. matics Pr b. aticsPra c. maticsPra d. None
25 Select the proper output for the following query from the options: .
select right (substr('Innovative ideas',2,7),3);
a.vati b. ati c.itav d. ita
26 Identify the SQL function which returns output as a group of characters.
a .NOW() b. MONTHNAME() c. MONTH() d. WEEKNAME()
27 Predict the output of the following query:
SELECT LCASE (MONTHNAME ('2023-03-05'));
a. May b. March c. MAY d. MARCH

47
ANSWER OF MCQ:

1 C 7 D 13 A 19 B 25 B
2 A 8 C 14 B 20 B 26 B
3 D 9 D 15 D 21 C 27 D
4 C 10 A 16 C 22 B
5 C 11 B 17 A 23 A
6 B 12 C 18 D 24 A

SHORT ANSWER TYPE QUESTION:

1 Ajay is working with a table Employee. The table contains the following columns:
Code, Name, Salary, DeptCode
He wants to display the maximum salary department wise. He wrote the following
query:
Select Deptcode, max(salary) from Employee;
But he did not get the desired result.
Rewrite the above query with necessary changes to help him get the desired result
2 What is the difference between the order by and group by clause when used along
with the select statement? Explain with an example
3 Riya, a database administrator needs to display house wise total number of records
of ‘Computer’ and ‘Electronics’ Department. She is encountering an error while
executing the following query:
SELECT Department, COUNT (*) FROM Employee GROUP BY Department
WHERE Department=’Computer’ OR Department= ‘Electronics”;
Help her in identifying the reason of the error and write the correct query by
suggesting the possible correction (s).
4 What is the purpose of WHERE clause in SQL? Explain with the help of suitable
example
5 Predict the output of the following queries:
i. select instr('[email protected]','.');
ii. select substr('[email protected]',5,5);
iii. select left('[email protected]',4);

48
6 Consider the given SQL string:
“12#All the Best!”
Write suitable SQL queries for the following:
i. Returns the position of the first occurrence of the substring “the” in the given string.
ii. To extract last seven characters from the string
7 What are aggregate functions in SQL? Name any two aggregate functions.
8 Write MySQL statements for the following:
i. To create a database named HEALTH.
ii. To create a table named Nutrients based on the following specification
Column name Data Type Constraints
Food_Name Varchar(20) Primary Key
Calorie Integer

9 What is the purpose of Order By clause in SQL? Explain with the help of suitable
example.
10 Explain the following SQL functions using suitable examples.
i. UCASE()
ii. TRIM()
iii. MID()
iv. DAYNAME()
v. POWER()
ANSWER: SHORT ANSWER TYPE QUESTION:
1 SELECT DeptCode, max(Salary) FROM Employee GROUP BY Deptcode;
2 The order by clause is used to show the contents of a table/relation in a sorted
manner with respect to the column mentioned after the order by clause. The
contents of the column can be arranged in ascending or descending order.
The group by clause is used to group rows in a given column and then apply an
aggregate function eg max(), min() etc on the entire group.
3 The problem with the given SQL query is that WHERE clause should not be used
with Group By clause. To correct the error, HAVING clause should be used instead of
WHERE.
Corrected Query:
SELECT Department, COUNT (*) FROM Employee GROUP BY Department
HAVING Department=’Computer’ OR Department= ‘Electronics”;

49
4 WHERE Clause in MySQL is a keyword used to specify the exact criteria of data or
rows that will be affected by the specified SQL statement. The WHERE clause can be
used with SQL statements like INSERT, UPDATE, SELECT, and DELETE to filter
records and perform various operations on the data. For Example:
To see details of employees whose ecode is e001 or e006 then query would be:
Select * from employee WHERE ecode in (‘e001’,’e006’);
5 i. 11
ii. 5@cbs
iii. exam
6 i. SELECT INSTR("12#All the Best!","the");
ii. SELECT RIGHT("12#All the Best!",7);
7 Aggregate functions: These are also called multiple row functions. These functions
work on a set of records as a whole, and return a single value for each column of the
records on which the function is applied.
Max(), Min(), Avg(), Sum(), Count() and Count(*) are few examples of multiple row
functions.
8 i. CREATE DATABASE HEALTH;
ii. CREATE TABLE NUTRIENTS(FOOD_NAME VARCHAR(20) PRIMARY
KEY,CALORIES INTEGER);
9 Order By clause:
The ORDER BY command is used to sort the result set in ascending or descending
order. The following SQL statement displays all the customer’s names in alphabetical
order:
SELECT Cname FROM Customers ORDER BY Cname;
10 1.UCASE(): It converts the string into upper case.
Example:
SELECT UCASE(‘welcome world’);
Output:
WELCOME WORLD
2. TRIM(): It removes the leading and trailing spaces from the given string.
Example:
SELECT TRIM(‘ Welcome world ‘ );
Output:
Welcome world

50
3. MID(): It extracts the specified number of characters from given string.
Example:
SELECT MID(‘ Welcome world,4,,4);
Output:
Come
4. DAYNAME(): It returns the weekday name for a given date
Example:
SELECT DAYNAME(‘2022-07-22’);
Output:
Friday
5. POWER(): It returns the value of a number raised to the power of another number.
Example:
SELECT POW(6,2);
Output:
36

CASE STUDY BASED/LONG ANSWER TYPE QUESTIONS:


1 Write outputs for SQL queries (A) to (C) which are based on the given table
GAME.
GID NAME DATEOFGAME UNDER WINNER

1 JUDO 2022-10-17 17 RAMESH

2 BADMINTON 2022-5-18 14 KIRTI

3 JUDO 2022-8-18 19 KAMAL

4 TAEKWONDO 2021-7-20 14 SADIQ

5 CHESS 2021-5-6 17 ALANKAR

A. Select name, under, winner from GAME where month(dateofgame)>7;


B. Select lcase(mid(winner,2,3)) from GAME where NAME like "%O";
C. Select mod(under, month(dateofgame)) from GAME where NAME="JUDO";
2 Write the output of the queries (a) to (d) based on the table, TECH_COURSE given
below:

51
Table: TECH_COURSE
CID CNAME FEES STARTDATE TID
C201 Animation and VFX 12000 2022-07-02 101
C202 CADD 15000 2021-11-15 NULL
C203 DCA 10000 20220-10-01 102
C204 DDTP 9000 2021-09-15 104
C205 Mobile Application Development 18000 2022-11-01 101
C206 Digital Marketing 16000 2022-07-25 103
A. SELECT DISTINCT TID FROM TECH_COURSE;
B. SELECT TID, COUNT(*), MIN(FEES) FROM TECH_COURSE
GROUP BY TID HAVING COUNT(TID)>1;
C. SELECT CNAME FROM TECH_COURSE WHERE FEES>15000 ORDER
BY CNAME;

D. SELECT AVG(FEES) FROM TECH_COURSE WHERE FEES


BETWEEN 15000 AND17000;
3 Consider the table Hospital given below showing information of patients. Write
commands in MySQL for (i) to (iii)

i. To show all information of patients who are in Orthopedic department from


hospital table in descending order of their age.
ii. Increase the charges of male patient in ENT department by 4%.
iii. Display a report listing name, age, charges and amount. Amount is charges +
VAT as 2% on charges, name the column as total charges
4 “XYZ” Company conducts workshops for employees of organizations. The
company requires data of workshops that are organized. As a database
administrator you have decided that:
Name of the Database: ABCINC

52
Name of the Table: WORKSHOP
Attributes of Table ‘Workshop’ are as follows:

Table : WORKSHOP
WorkshopId Title DateWorkshop NumSpeakers

1001 Robotics 2020-03-21 3

1002 AI 2020-05-24 4

1003 Humanoids 2020-07-15 3

1004 Block Chain 2020-04-25 5

1005 Cloud 2020-03-03 4

a. Identify the attribute best suited to be declared Primary Key


b. Write a command to display details of workshop whose Title ends with letter s.
c. Write SQL command to update/modify the Number of Speakers from 3 to 4 for
Humanoids Workshop.
d. Write SQL command to display details of workshops to be conducted in 3rd
month (march).
5 Consider the below mentioned table of ‘CLOTH’
Write the SQL commands for the following:
a. Display first three letters of all values in DESCRIPTION column e.g. ‘FRO’
for ‘FROCK’
b. Display number of cloths of each Fabric.
c. Display average price of cloths of each Fabric.
6 Write suitable SQL query for the following: (5
A. Display 4 characters extracted from 3rd character onwards from string
“IMPOSSIBLE‟.
B. Display the position of occurrence of string “GO‟ in the string “LET‟s GO to
GOA”.
C. Round off the value 257.75 to nearest ten rupees.

53
D. Display the remainder of 18 divided by 5.
E. Remove all the leading and trailing spaces from a column passwd of the table
“USER‟.
7 i. Display 7 characters extracted from the 7th left character onwards from the
string ‘INDIA SHINING’.
ii. Display the position of the occurrence of string ‘COME’ in the string
‘WELCOME WORLD’.
iii. Round off the value 23.78 to one decimal place.
iv. Display the remainder of 100 divided by 9.
v. Remove all the expected leading and trailing spaces from a column userid of the
table ‘USERS’.
82. Akash wants to find the following data from mysql using functions. What
commands he will write to
I. Find the name of the day of the current date.
II. Display ‘infomatics practices’ in capital letter.
III. Display the name of the month in which you are giving yours pre boards.
IV. To Round off the value 23.7856 to two decimal place.
V. Display the remainder of 45 divided by 9.
9 Reena is working with functions of MySQL. Explain her following:
i. What is the purpose of now () function?
ii. How many parameters does it accept?
iii. What is the general format of its return type?
10 Consider the following table – Persons

Based on above table write queries in MySQL for the following:


i. To display records in ascending order of salary.
ii. To remove the decimal values from salary.
iii. To display sum of Salary of Persons whose Address is Delhi.
iv. To display the details of person whose name starts with letter ‘R’ or ends
with letter ‘e’.

54
ANSWERS:
1 A. Name Under Winner
Judo 17 RAMESH
Judo 19 KAMAL
B. lcase(mid(winner,2,3))
ame
ama
adi
C. mod(under, month(dateofgame))
7
3
2 A. Distinct TID
101
102
103
104
B. TID COUNT(*) MIN(FEES)
101 2 12000
C NAME
Digital Marketing
Mobile Application Development
D. AVG(FEES) 15500
3 i. Select * from hospital where Department= “Orthopedic” order by age DESC;
ii. Update Hospital set charges=Charges+.04*Charges where Sex=’M’
iii. Select Name, Age, Charges, Charges+.02*Charges as ‘Total Charges’ from
Hospital;

4 a. WorkshopId
b. Select * from workshop where title like “%s”;
c. UPDATE WORKSHOP SET NUMSPEAKERS = 4 WHERE TITLE=’
HUMANOIDS’;
d. Select * from workshop where month(DateWorkshop)=3;

55
5 a) Select substr(description,1,3) from cloth;
b) select fabric , count(*) from cloth group by fabric;
c) select fabric , avg(price) from cloth group by fabric;
6 A. select mid(“IMPOSSIBLE‟, 3, 4);
B. select INSTR(“LET‟s GO to GOA”, “GO”);
C. select round(257.75, -1);
D. select mod(18, 5);
E. select trim(passwd) from USER
7 i. select mid('INDIA SHINING',7,7);
ii. select INSTR('WELCOME WORLD','COME');
iii. select round(23.78,1);
iv. select mod(100,9);
v. select trim(userid) from users
8 i. select dayname(now());
ii. Select UPPER(‘infomatics practices’);
iii. Select monthname(now());
iv. Select round(23.7856,2);
v. Select mod(45,9);
9 i. It returns the current date and time.
ii. None
iii. The return type for NOW() function is either in ‘YYYYMM-DD HH:MM:SS’
format or YYYYMMDDHHMMSS. format, depending on whether the function is
used in a string or numeric context.
10 i. select * from Persons order by salary;
ii. update Persons set salary = round(salary, 0);
iii. select sum(salary) from Persons where Address = “Delhi”;
iv. select * from Persons where PName like “R%e” ;

56
XII INFORMATICS PRACTICES
UNIT - 3

INTRODUCTION TO COMPUTER NETWORKS

THIS UNIT HAS 10 MARKS WEIGTAGE OUT OF 70 MARKS

COMPUTER NETWORKS:
A computer network is a set of nodes (Computers and other networking devices) that
are connected through communication media for the purpose of communication and sharing
resources (hardware / software ) among the users

Advantages of Networks:

1. Facilitate Communication through email, messages, video conferencing


2. Share hardware devices like a printer or scanner
3. Enable file sharing
4. Share softwares
5. Sharing of Information
TYPES OF NETWORK
NET DEFINITION AND EXAMPLE AREA
WOR FULL FORM COVERE TECHNOLOGY
K D

IT IS FORMED WHEN USER


PERSONAL MAKE A NETWORK OF ITS
UPTO 10 INFRARED,
PAN AREA PERSONAL DEVICES LIKE
METER BLUETOOTH
NETWORK MOBILE PHONES, LAPTOPS,
DESKTOPS

SUCH NETWORKS ARE


LOCAL
CONFINED TO A SINGLE UPT0 10 ETHERNET, WI-
LAN AREA
BUILDING, OFFICE ETC. E.G KM FI
NETWORK
NETWORK WITHIN A SCHOOL

SUCH NETWORKS ARE


METROPOL SPREAD OVER A WHOLE UPTO OPTICAL FIBER,
MAN ITAN AREA CITY. E.G NETWORK OF ALL 100KM RADIO WAVE,
NETWORK BRANCHES OF SCHOOL IN A RADIUS MICROWAVE
DELHI , CABLE TV NETWORK

SUCH NETWORKS ARE ENTIRE


WIDE AREA SPREAD IN WHOLE COUNTRY COUNTR ROUTER,
WAN
NETWORK AND AT WORLD LEVEL. E.G Y OR GATEWAY
INTERNET GLOBE

57
NETWORKING DEVICES

1. MODEM (Modulator Demodulator) :- MODEM is a device that Converts analog


signal to digital (known as modulation) and digital signal to analog (known as
demodulation)
2. HUB :- It acts as a central device for connecting several devices in network. It
broadcast all the signals to all computers in a network. It comes with 8,16,24,32
ports ect.
3. SWITCH :- It acts as a central device for connecting several devices in network.
It is an intelligent device that send the message to the recipient only. It comes with
8,16,24,32 ports ect.
4. REPEATER:- It is used to regenerates/amplify/restore the signal . It is required
after 100 meters in twisted pair cable and after 500 meters in coaxial cable.
5. ROUTER :- It is a networking device which chooses the best optimal path from
available pats to send the signals. It interconnects different networks .
6. GATEWAY :- This device is used to connect two dissimilar networks to resolve
their protocol differences.

NETWORKING TOPOLOGY:- It is a physical layout of computers/nodes in a


network.
Types of Topology:-
STAR TOPOLOGY:- When all the nodes are connected in a network through a central
device called HUB/SWTICH it is called star
topology.
Advantages:-
1. Easy to install
2. If one link fails the network can still function
Disadvantages:-
1. Everything depends on the hub. If HUB fails the whole network fails
BUS TOPOLOGY:- In this topology all the nodes are attached to a single backbone
cable.
Advantages:-
1. Easy to install
2. Minimal Cable
Disadvantages:-
1. Difficult reconnection
2. Difficult to find the problem

TREE TOPOLOGY:- In this topology all the nodes are attached to a single backbone
cable.

58
Advantages:-
1. It is scalable.
2. Easier fault identification and isolation
Disadvantages:-
1. Maintenance of the network may be an issue when the network spans a great area
2. if the backbone fails, the entire network is crippled.

MESH TOPOLOGY:- In this topology all the nodes are directly connected to all other
nodes in a network
Advantages:-
1. Avoid traffic since each link can carry its own data and none are
being shared Disadvantages:-
2. If one link breaks, the rest of the network is still functional.

Disadvantages:-
1. A lot of cables are needed
2. Too many cables means complex network

INTRODUCTION TO INTERNET:-
Internet means network of networks. It is a WAN type network that is spread in
whole world. It is a client server architecture network. It provides us services like
EMAIL, WEBSITES, FILE SHARING, ENTERTAINMENT SOURCE ETC.
URL:- (Uniform Resource Locator) This is the address of any resource on internet.
E.g :- https://abc.com/study/cs.pdf
WWW:- (World Wide Web) This is web of multimedia (Text, Pictures, Audio , Videos)
information i.e collections of websites or webpages stored in web servers.
EMAIL:- (Electronic Mail) :- It is service of Internet in which messages can be sent to
any person electronically over computer network. It requires email account.
CHAT:- - Online textual talk is called chatting.
VOIP :- (Voice Over Internet Protocol)- It is technology that allows you to make voice calls
using a Internet connection instead of a regular (or analog) phone line.
WEBSITE :- It is Collection of related web pages on a web server and are linked together.
E.g https://kvsangathan.nic.in/
WEBPAGE:- It is a HTML/Web document that is opened in web browser software. It
may contain multimedia information like Text, Pictures, Audio and Video etc.
STATIC WEBPAGE:- These are web pages that remain the same until someone changes it
manually

59
DYNAMIC WEBPAGE:- These are web pages that are changed automatically with time ,
place and preferences of users.
WEB BROWSER:- It is a software/application that is used to open website on a
client/User computer system. E.g Internet explorer, Google Chrome, Mozilla Firefox, opera,
safari etc.
WEB SERVER:- It is the software that is installed on server computer and it sends the
webpages to client computer requested through web browser. E.g Apache Tomcat, IIS
WEBSITE HOSTING:- It is the system where a WEB HOSTING provider stores and
maintains all files of website and applications on a server to make it accessible to end users
on internet.
ADD-ONS:- An add-on is a program utility or physical device that can be added to a system
to enhance its capabilities.
PLUG-INS:- It is a small add-on software used to enhance the functionality of a desktop
program or a web application.
COOKIES:- These are the small text files created by web server on clients computer
when user visit a website.
Multiple Choice Questions (MCQ)
1) Physical Layout of computers in a network is called _______________.
a) Network b) Topology c) ftp d) IP Address

2) A computer that facilitates the sharing of data, software and hardware resources on the
network is called_________.
a) Client b) Dump Terminal c) Printer d) Server

3) Which is the device that that unicast the data signal in the network rather than broadcast?
a) Repeaters b) Switch c) Hub d) Bridge

4) Mr Z of Class X is sending some media files on Mr Y’s mobile over Bluetooth, which type
of networks he formed by them:
a) LAN b) WAN c) MAN d) PAN

5) The network device that amplifies and restores the signal for long distance transmission?
a) Repeater b) Switch c) Hub d) Router

6) The collection of the hyperlinked documents on the internet is called ____________?


a) XML b) Email c) WWW d) Internet

7) The location of document on internet is called its _______________?


a) Email b) IP c) Protocol d) URL
8) Identify among the following the network device used to connect two dissimilar types of
networks.
a) Switch b) Hub c) Bridge d) Gateway
9) The Topology in which all the computers are connected to a main backbone cable is
called?
a) star b) bus c) mesh d) Tree

60
10) Internet is which type of network?
a) WAN b) PAN c) MAN d) LAN

11) Which device converts digital data to analog and vice versa?
a) Modem b) Hub c) Switch d) Router

12) Full form of VOIP is ?


a) VIDEO OVER INTERNET PROTOCOL b) VOICE OVER INFORMATION
PROTOCOL
c) VOICE OVER INTERNET PROTOCOL d) NONE OF THE ABOVE

13) The web page whose contents remain same until changed manually is called?
a) Static b) Dynamic c) Fix d) Still

14) which amongst the following is not an example of browser?


a) Chrome b) Firefox c) Avast d) edge

15) Electronic mail cannot be used for


a) Sending documents b) Sending attachments
c) Sending bulk data (say over 2GB) d) Sending messages

16) A ____________is a device that connects the organization’s network with the outside
world of the Internet. [CBSE Sample paper]
a) Hub b) Modem c) Gateway d) Repeater

17) Television cable network is an example of: [[CBSE Sample paper]


a) LAN b) WAN c) MAN d) Internet

18) Which protocol allows us to have voice calls over the internet?
a) HTTP b) VoIP c) Video Chat d) SMTP

19) An online activity that enables us to publish website or web application on the internet
a) Web server b) Web Browser c) Web Hosting d) None

20) Small text files created by website on clients computer for storing the information of
user is called:
a) Web Page b) Cookies c) Text File d) Server

ASSERTION AND REASONING based questions

Mark the correct choice as


(A) Both A and R are true and R is the correct explanation for A
(B) Both A and R are true and R is not the correct explanation for A
(C) A is True but R is False
(D) A is false but R is True

61
Q1 Assertion (A): Each website has a unique address called URL.
Reasoning (R): It is Uniform Resource Locator and a correct example of it is
http://mypage.htm/google.com

Q2 Assertion (A): - VoIP makes audio and video calls possible from any internet
connected device having a microphone and speakers.
Reasoning (R): - VoIP is possible if both caller and receiver have the right software
and hardware to speak to one another

Q3 Assertion(A): Incognito browsing opens up a version of the browser that will track
your activity
Reasoning(R): Incognito browsing is useful when entering sensitive data

Q4 Assertion (A): -The Internet is a collection of interconnected computer networks


linked by transmission medium such as copper wires, fiber-optic cables, wireless
connections etc.
Reasoning (R): - World wide web is a collection of interconnected documents.

Q5 Assertion (A): - MODEM stands for modulator-demodulator.


Reasoning (R): - It is a computer hardware device that converts data from a digital
format to analog and vice versa.
[CBSE Sample paper]

Q6 Assertion (A): - Repeater is device to regenerate a digital signal.


Reasoning (R): - It has to be installed when data is to be sent on long distance
through wired media to avoid loss of signal.

Q7 Assertion (A): - Cookies are plain text files.


Reasoning (R): - Cookies are not automatically created.

Q8 Assertion (A): - Dynamic webpages are those that are changed as per the location ,
time and preferences of user.
Reasoning (R): - Dynamic webpages are manually changed .

Q9 Assertion (A): - Internet is a client server architecture of network


Reasoning (R): - Clients provide the servers the required information and data.

Q10 Assertion (A): - There is a centralized control in case of Star topology.


Reasoning (R): - If Hub/Switch fails then whole network is failed.

62
MCQ ANSWERS

Q1 b Q6 c Q11 a Q16 c

Q2 d Q7 d Q12 c Q17 c

Q3 b Q8 d Q13 a Q18 b

Q4 d Q9 b Q14 c Q19 c

Q5 a Q10 a Q15 c Q20 b

ASSERTION REASONING ANSWER

Q1 a Q6 a

Q2 a Q7 c

Q3 b Q8 c

Q4 b Q9 c

Q5 a Q10 a

2 MARKS QUESTIONS (SOLVED)


Q1. Explain the terms Web page and Website.

Ans:- WEBPAGE:- It is a HTML/Web document that is opened in web browser


software. It may contain multimedia information like Text, Pictures, Audio and Video
etc.
WEBSITE :- It is Collection of related web pages on a web server and are linked together.
E.g https://kvsangathan.nic.in/

Q2. Explain any two types of networks.

Ans:- 1. LAN:- Such Networks are confined to a single building, office etc. E.g Network
within a School
2. MAN:- Such Networks are spread over a whole city. E.g network of all branches of
school in a Delhi , Cable TV Network

Q3. Mr. Y is confused between the terms web server and web hosting explain the basic
concepts of a web server and web hosting to MR. Y
Ans:- WEB SERVER:- It is the software that is installed on server computer and it
sends the webpages to client computer requested through web browser. E.g Apache Tomcat,
IIS

63
WEBSITE HOSTING:- It is the system where a WEB HOSTING provider stores and
maintains all files of website and applications on a server to make it accessible to end users
on internet.

Q4. Seema is unable to understand the concept of URL . Explain the term URL with
example.
Ans:- URL:- (Uniform Resource Locator) This is the address of any resource on internet.
E.g :- https://abc.com/study/cs.pdf

Q5. Differentiate between STAR and BUS topologies


Ans:-
STAR TOPOLOGY BUS TOPOLOGY
All the devices in the network are connected All the devices in this network are connected
by a central hub in the star topology. to a single cable- which acts as the backbone.
It requires more cables. It requires less cables.

Q6. Write full form of the following terms related to Computer Networks:
a. WAN (b) VOIP (c) WWW (d) SMTP
Ans: WAN : Wide Area Network
VOIP:- Voice Over Internet Protocol
WWW:- World Wide Web
SMTP:- Simple mail Transfer Protocol

Q7. Explain the terms Static and dynamic Web pages.


Ans:- STATIC WEBPAGE:- These are web pages that remain the same until someone
changes it manually
DYNAMIC WEBPAGE:- These are web pages that are changed automatically with time ,
place and preferences of users.
Q8. What is difference between hub and switch
HUB SWITCH
Hub broadcasts the data signal to all Switch unicast the data signal to the
devices on network recipient only
It functions in a physical layer It functions in the data link layer.

Q9. write any four advantages of networking.


Ans:- 1. Facilitate Communication through email, messages, video conferencing
2. Share hardware devices like a printer or scanner
3. Enable file sharing
4. Share softwares

Q10. Explain the term MODEM and GATEWAY.


Ans:- MODEM (Modulator Demodulator) :- MODEM is a device that Converts
analog signal to digital (known as modulation) and digital signal to analog (known as
demodulation)
64
GATEWAY :- This device is used to connect two dissimilar networks to resolve
their protocol differences.

Q11. Define the term web browser. Give some examples of it


Ans WEB BROWSER:- It is a software/application that is used to open website on a
client/User computer system. E.g Internet explorer, Google Chrome, Mozilla Firefox, opera,
safari etc.

Q12. What do you understand by term WWW. Name some applications of WWW.
Ans :- WWW:- (World Wide Web) This is web of multimedia (Text, Pictures, Audio ,
Videos) information i.e collections of websites or webpages stored in web servers.
Applications of WWW:- Online Shopping Websites, E-Banking etc

Q13. What happens to the Network with Star topology if the following happens
(i) One of the computers on the network fails?
(ii) The central hub or switch to which all computers are connected, fails?
Ans:- i) Entire network will not fail
ii) Entire network will get failed

Q14. Explain the terms add-ons and plug-ins.


Ans:- ADD-ONS:- An add-on is a program utility or physical device that can be added to a
system to enhance its capabilities.
PLUG-INS:- It is a small add-on software used to enhance the functionality of a desktop
program or a web application.

CASE STUDY QUESTIONS (SOLVED)


Q1. Prime Computer services Ltd. is an international educational organization. It is planning
to set up its India campus at Mumbai with its head office in Delhi. The Mumbai office
campus has four main buildings-ADMIN, ACCOUNTS, EXAMINATION and
RESULT. You as a network expert have to suggest the best network related solutions for
their problems raised in (i) to (v), keeping in mind the distances between the buildings and
other given parameters.
[CBSE Sample paper]

65
(i) Suggest the most appropriate location of the server inside the MUMBAI campus (out of
the four buildings) to get the best connectivity for maximum number of computers. Justify
your answer.
(ii) Suggest and draw cable layout to efficiently connect various buildings within the
MUMBAI campus for a wired connectivity.
(iii) Which networking device will you suggest to be procured by the company to
interconnect all the computers of various buildings of MUMBAI campus?
(iv) Company is planning to get its website designed which will allow students to see their
results after registering themselves on its server. Out of the static or dynamic, which type of
website will you suggest?
(v) Which of the following will you suggest to establish the online face to face
communication between the people in the ADMIN office of Mumbai campus and Delhi head
office?
(a) Cable TV (b) Email (c) Video conferencing (d) Text chat

Solution:

i) Server should be installed in Admin department as it has maximum number of computers.


ii) Star topology
EXAMINATIONV ACCOUNTSVMCA
MCADMIN DMIN

(iii) Hub/Switch
ADMIN RESULT
VMCA 66 SVMCA
(iv) Dynamic
(v) Video conferencing

Q2. XYZ Media house campus is in Delhi and has 4 blocks named Z1, Z2, Z3 and Z4. The
tables given below show the distance between different blocks and the number of computers
in each block. [CBSE
Sample paper]

The company is planning to form a network by joining these blocks.


(i) Out of the four blocks on campus, suggest the location of the server that will provide the
best connectivity. Explain your response.
(ii) For very fast and efficient connections between various blocks within the campus, suggest
a suitable topology and draw the same.
(iii) Suggest the placement of the following devices with justification
(a) Repeater (b) Hub/Switch
(iv) VoIP technology is to be used which allows one to make voice calls using a broadband
internet connection. Expand the term VoIP.
(v) The XYZ Media House intends to link its Mumbai and Delhi centers. Out of LAN, MAN,
or WAN, what kind of network will be created? Justify your answer.

Solution
i) Z2 as it has maximum number of computers.
ii) For very fast and efficient connections between various blocks within the campus suitable
topology: Star Topology 5

iii) Repeater: To be placed between Block Z2 to Z4 as distance between them is more than
100 meters. Hub/Switch: To be placed in each block as each block has many computers that
needs to be included to form a network.
67
iv) Voice Over Internet Protocol
v) WAN as distance between Delhi and Mumbai is more than 40kms

CASE STUDY QUESTION (UNSOLVED)

Q1. ABC Ltd has set up its new centre at Mangalore for its office and web-based activities. It
has 4 blocks of buildings as shown in the diagram below:

(a) Suggest a cable layout of connections between the blocks.


(b) Suggest the most suitable place (i.e. block) to house the server of this organization with a
suitable reason.
(c) Suggest the placement of the following devices with justification
(i) Repeater (ii) Hub/Switch
(d) If ABC Ltd make connectivity to its head office at Delhi . Then which type of
Network will be formed LAN/MAN/WAN/PAN

Q2 Aman Industries has set up its new center at Delhi for its office and web based activities.
The company compound has 4 buildings as shown in the diagram below:

(a) Suggest a cable layout of connections between the buildings.


(b) Suggest the most suitable place (i.e. building) to house the server of this organisation with
a suitable reason.
(c) Suggest the placement of the following devices with justification:
(i) Internet Connecting Device/Modem

68
(ii) Switch
(d) The organization is planning to link its sale counter situated in various parts of the same
city, which type of network out of LAN, MAN or WAN will be formed? Justify your answer.

Q3. East and West Public Ltd. has decided to network all its offices spread in five buildings.

The distances between buildings are given below:


(i) Suggest cable layout(s) for connecting the buildings.
(ii) Suggest the most suitable building to install the server of this organization with a
suitable reason, with justification.
(iii) Suggest the placement of the following devices with justification?
(a) Hub/Switch (b) Repeater
(iv) The company also has another office in the same city but at a distant location about
25-30 kms away. How can link be established with this building? (i.e. suggest the
transmission medium).

69
UNIT-4
SOCIETAL IMPACTS
The last few decades have witnessed a profound revolution in computing and
communications, and it is evident that technological advancements and the utilization of
information technology will continue to progress at a rapid pace. This transformation is driven by
not only the increased power of new information technologies but also the decreased cost of
communication, resulting from technological enhancements and heightened competition.
According to Moore's Law, microchip processing power doubles every 18 months. These
developments offer significant opportunities while also presenting formidable challenges.
Presently, innovations in information technology have wide-reaching effects on various aspects of
society. Policymakers are actively addressing issues related to economic productivity, intellectual
property rights, privacy protection, and the accessibility and affordability of information.
Decisions made today will have long-lasting consequences, necessitating careful consideration of
their social and economic impacts.

One of the most significant outcomes of this information technology progress is electronic
commerce over the Internet, a novel approach to conducting business. Despite its relatively recent
emergence, it has the potential to revolutionize economic activities and reshape the social
landscape. Electronic commerce already influences key sectors such as communications, finance,
and retail trade and has the potential to expand into domains like education and healthcare. It
involves the seamless integration of information and communication technology throughout the
entire electronic business value chain. In the subsequent sections, we will delve into the impacts
of information technology and electronic commerce on business models, commerce, market
structure, the workplace, the labor market, education, private life, and society as a whole.

DIGITAL FOOTPRINT
A digital footprint refers to the data left behind by users when they engage online. There are two
types of digital footprints: passive and active. A passive footprint is created when information is
collected from a user without their awareness. An active digital footprint, on the other hand, is
consciously shared by users, whether through social media sites or other websites. For instance, a
passive digital footprint might entail the storage of information about a user's online activities,
including their origins, the timing of these activities, and their IP address. This data can be analyzed
offline and accessed by administrators, offering insights into the actions performed on that
machine, even if the user's identity remains concealed. In contrast, an active digital footprint
involves users deliberately sharing information, such as their registered names or profiles when
they comment or participate in online forums and social media platforms. These active footprints
can provide substantial information about an individual, based on their online activities.

NET AND COMMUNICATION ETIQUETTES


1. Practice respect and courtesy.
2. Be conscious of how your comments may be interpreted.
3. Use humor and sarcasm cautiously.
4. Be mindful of your audience when sharing information.
5. Review friend requests and group invitations before accepting them.
6. Familiarize yourself with the rules of conduct and community standards.
7. Cultivate forgiveness and understanding in online interactions.

70
DATA PROTECTION
Data protection is a set of strategies and processes aimed at safeguarding the privacy, availability,
and integrity of data. It is sometimes referred to as data security or information privacy.
Establishing a robust data protection strategy is crucial for any organization that collects, handles,
or stores sensitive data.

Data Protection vs Data Privacy:


Data protection and data privacy, while closely related, are distinct concepts. Data privacy focuses
on determining who has access to data, while data protection involves implementing measures to
enforce those restrictions. Data privacy establishes the policies that guide data protection tools and
processes.

Data Protection Technologies and Practices:


To protect user data effectively, various storage and management options are available, including:
• Data loss prevention (DLP): A set of strategies and tools to prevent data theft, loss, or
accidental deletion, often including recovery options.
• Storage with built-in data protection: Modern storage solutions offer redundancy and
durability, ensuring data remains accessible and protected.
• Firewalls: These utilities monitor and filter network traffic, allowing authorized users
access to data.
• Authentication and authorization: Controls that verify credentials and apply user
privileges correctly, often part of identity and access management (IAM) and role-based
access controls (RBAC).
• Encryption: Utilizes algorithms to protect data by making it unreadable without the
correct encryption key, ensuring data remains secure.
• Endpoint protection: Guards network gateways, including ports, routers, and connected
devices, allowing for monitoring and traffic filtering.
• Data erasure: Deletes unnecessary data, reducing liability and complying with regulations
such as GDPR.

These practices and technologies are essential to maintaining the privacy and security of sensitive
data.

INTELLECTUAL PROPERTY RIGHTS (IPR)


Property:
The term "property" typically refers to a possession or, more precisely, something to which the
owner holds legal rights.

Intellectual Property:
Intellectual Property encompasses creations of the human intellect that are utilized in commerce.
These creations include:
• Inventions
• Literary and Artistic works
• Symbols
• Names, Images, and Designs
Intellectual property comprises innovative inventions created by individuals or groups, utilizing
their intellectual capacity for eventual use in commerce, and that is not already publicly available.
71
Examples of intellectual property include inventions related to products or processes, new designs,
literary or artistic works, and trademarks (such as words, symbols, or logos).

Intellectual Property (IP) is a term that encompasses various types of creations, including brands,
inventions, designs, or other forms of intellectual work for which individuals or businesses possess
legal rights. Virtually all businesses own some form of IP, which often represents a valuable
business asset. Common types of IP include:
• Copyright: Protects written or published works like books, songs, films, web content, and
artistic works.
• Patents: Safeguard commercial inventions, such as new products or processes.
• Designs: Protect various designs, including drawings and computer models.
• Trademarks: Safeguard signs, symbols, logos, words, or sounds that distinguish a
business's products and services from those of competitors. IP can be either registered or
unregistered.

Intellectual Property Rights (IPR) refers to the legal ownership rights associated with intangible
assets owned by individuals or companies, protecting them from unauthorized use without consent
or proper licensing. This category includes proprietary software, shareware, nagware, and branded
computer hardware. These rights cover various forms of intellectual work, such as registered
domain names, industrial designs, confidential information, inventions, program and database
rights, and literary works in physical or digital forms.

72
Copyright Laws:
Copyright is a legal concept established by most governments, granting the creators of original
work exclusive rights to that work, typically for a limited period.

Plagiarism:
Plagiarism involves stealing someone's intellectual work and presenting it as one's own without
providing proper citation or acknowledgment. It can take various forms, such as copying others'
work, presenting it as one's own, and involves dishonesty and deception.

To prevent plagiarism, one should:


• Use their own words and ideas.
• Always provide proper references and credit the sources of information.
• Give credit when using another person's ideas, opinions, written or spoken words, or
paraphrased content.

Licensing:
Software licensing refers to the legal right or privilege granted by a company for the use of their
software or application. For example, when purchasing proprietary software like Windows OS,
users must agree to a license agreement before installation.

Licensed software offers the following advantages:


1. Supports the further development of the program.
2. Provides customer support and assistance not available in pirated software.

Free and Open-Source Software (FOSS):


FOSS is software that can be classified as both free and open-source. Users are allowed to use,
modify, study, and distribute the software freely, with open access to the source code.

Free Software:
Free software, according to the Free Software Foundation, upholds four essential freedoms:
• The freedom to run the program for any purpose.
• The freedom to study and change the program.
• The freedom to redistribute copies.
• The freedom to distribute modified versions.

Open-Source Software:
Open-source software is released under a license that grants users the rights to use, study, change,
and distribute the software and its source code for any purpose. It is often developed
collaboratively in a public manner.

73
CYBERCRIME
Cybercrime, also known as computer-oriented crime, encompasses criminal activities involving
computers and networks. Computers may be either the tool used to commit a crime or the target
of the crime. It involves the use of computers for illicit activities such as fraud, identity theft, and
privacy breaches. In today's world, where computers are central to various sectors like commerce,
entertainment, and government, cybercrime has gained significant prominence. It poses threats to
both individuals and national security, as well as financial well-being.

Cybercriminal activities occur in a digital environment and can be categorized into two groups. In
one category, cybercrimes target computer networks or devices, involving threats like viruses and
denial-of-service attacks. The other category involves using computer networks to commit other
criminal activities, including cyberstalking, financial fraud, or identity theft.

Classification of Cybercrime:
1. Cyber Terrorism: This involves using computers and the internet to perform violent acts
that threaten human life. Cyberterrorism encompasses various activities aimed at instilling
fear through the use of cyberspace and computer resources.
2. Cyber Extortion: Cyber extortion occurs when hackers subject websites, email servers,
or computer systems to repeated denial-of-service attacks, demanding substantial sums of
money in exchange for halting these attacks and providing protection.
3. Cyber Warfare: Cyber warfare refers to the use of computers, online control systems, and
networks in a battle space or warfare context. It includes both offensive and defensive
operations, the threat of cyberattacks, espionage, and sabotage.
4. Internet Fraud: Internet fraud involves using deceit or fraudulent activities over the
internet to deceive victims, often with the aim of acquiring money or property. It
encompasses a range of illicit actions committed in the digital realm.
5. Cyber Stalking: Cyberstalking is a form of online harassment where victims are inundated
with a barrage of online messages and emails. Stalkers may use the internet to harass and
intimidate individuals, often combining online and offline stalking to maximize the victim's
distress.

Prevention of Cybercrime:
To prevent cybercrime, several measures should be taken:
1. Use Strong Passwords: Create and maintain strong and unique password combinations
for each account to prevent unauthorized access.
2. Use Trusted Antivirus Software: Employ reputable and advanced antivirus software to
protect your devices from various virus attacks.
3. Maintain Social Media Privacy: Limit access to your social media accounts to known
individuals and friends, and do not share sensitive information publicly.
4. Keep Software Updated: Regularly update your device's software to address security
vulnerabilities and maintain its security.

Hacking:
Hacking involves unauthorized access to computer systems, networks, or digital systems. Hackers
typically possess technical expertise in both hardware and software. Hacking can be used for
positive purposes, such as ethical hacking, in which white hat hackers explore vulnerabilities to
enhance a system's security. Ethical hackers report their findings to the system owner to help
protect against cyberattacks.
74
Phishing and Fraudulent Emails:
Phishing is an illicit activity where fake websites or emails that appear authentic are used to deceive
users into providing personal and sensitive information. Hackers often use email spoofing to create
a false sense of legitimacy.

Cyber Bullying:
Cyberbullying includes various forms of online harassment, involving insults, threats, and the
public sharing of personal information with the intent to ridicule or harm the victim. Cyberbullying
can have serious consequences for the victim.

Identity Theft:
Identity theft occurs when personal data, such as demographic details, email IDs, banking
credentials, and more, are stolen and misused for monetary gain or other illicit activities.

Indian Information Technology Act (IT Act):


The Information Technology Act, 2000 (IT Act) in India, amended in 2008, provides guidelines
for the protection of sensitive personal data and the rights of internet users. It establishes a legal
framework for electronic governance, recognizing electronic records and digital signatures. The
act outlines cybercrimes and their penalties and sets up the Cyber Appellate Tribunal to address
disputes arising from such crimes.

Cybercrime cells in police stations across many Indian states allow individuals to report
cybercrimes. The IT Act is essential to enable secure online transactions and protect individuals
from the misuse of their information.

Key Points on the Indian Information Technology Act (IT Act):


1. Enactment and Amendment: The Indian Information Technology Act (IT Act) was
enacted in the year 2000 and subsequently amended in 2008 to address the evolving
landscape of information technology and cybercrimes.
2. Protection of Personal Data: The IT Act provides guidelines and legal mechanisms for
the protection of sensitive personal data, particularly in the context of electronic
transactions and digital communication.
3. Rights of Internet Users: It recognizes and upholds the rights of internet users, ensuring
that individuals have legal safeguards while operating in the digital realm.
4. Legal Framework for Electronic Governance: The IT Act establishes a legal framework
for electronic governance, enabling the recognition of electronic records and digital
signatures as legally valid and enforceable.
5. Cybercrime Provisions: The act includes provisions that outline various cybercrimes and
prescribes penalties for those who engage in illegal activities in the digital domain.
6. Cyber Appellate Tribunal: To resolve disputes arising from cybercrimes and related
matters, the IT Act sets up the Cyber Appellate Tribunal, which plays a vital role in
adjudicating disputes in the cyber world.
7. Reporting Cybercrimes: Many Indian states have established cybercrime cells within
their police stations. These cells serve as dedicated units for individuals to report
cybercrimes, ensuring that law enforcement is equipped to handle digital offenses
effectively.

75
8. Secure Online Transactions: The IT Act plays a crucial role in facilitating secure online
transactions, ensuring that individuals can engage in electronic commerce with confidence
in the legal framework that governs it.
9. Protection from Information Misuse: The act is designed to protect individuals from the
misuse of their personal and sensitive information in the digital space, offering legal
recourse and protection against unauthorized use.
10. Adaptation to Changing Technology: The IT Act recognizes the dynamic nature of
technology and seeks to adapt and respond to the evolving landscape of information
technology and cyber threats, ensuring that legal provisions remain relevant and effective.

In summary, the Indian Information Technology Act (IT Act) is a comprehensive legal framework
designed to protect individuals' rights and data in the digital realm, address cybercrimes, and
provide a legal framework for electronic governance in India. It plays a crucial role in ensuring the
secure and responsible use of information technology and electronic communication.

E-Waste: Hazards and Management


E-waste encompasses a wide range of electronic and electrical appliances, including items like
computers, mobile phones, digital music players, refrigerators, washing machines, and televisions
(TVs), among various other household consumer products.

Hazards of E-Waste:
• Most electronic waste contains hazardous substances such as lead, beryllium, and mercury.
• Improper disposal of electronic gadgets increases the release of these toxic chemicals,
contaminating the soil and causing air and water pollution.
• The polluted water becomes unfit for drinking due to high levels of contamination.
• Inadequate e-waste recycling methods, such as open burning and acid baths, result in the
creation of hazardous and toxic compounds like dioxins, furans, and acids.
• Health implications of improper e-waste disposal include damage to the immune system,
skin diseases, multiple ailments, and various skin problems.

E-Waste Management:
Proper e-waste management involves the recycling and recovery of discarded materials, and it
includes the following steps:
1. Dismantling: This step involves the removal of components containing valuable materials
like copper, silver, gold, steel, and the safe removal of parts containing dangerous
substances such as mercury, lead, and beryllium.
2. Metal and Plastic Separation: Materials are sorted to separate metals from plastics.
3. Refurbishment and Reuse: Electronics that can be refurbished are prepared for reuse.
4. Recovery of Valuable Materials: Valuable materials are extracted from the e-waste.
5. Disposal of Hazardous Materials: Dangerous substances like mercury, lead, and
beryllium are properly disposed of in underground landfill sites.

Awareness of Health Concerns Related to Technology Use:


As computer technologies become increasingly integrated into our lives, they offer numerous
benefits, from educational opportunities and online shopping to global communication and remote
work capabilities. However, if these technologies are not used with care, they can lead to various
health issues, including:
1. Neck strain
76
2. Vision problems
3. Feelings of isolation
4. Sleep disorders
5. Increased stress
6. Decreased attention spans
7. Strained social relationships
8. Computer-related anxiety
9. Internet addiction
To prevent these problems, individuals should learn how to use technology in a way that does not
adversely affect their health. Some users may not even be aware of the health-related issues they
are experiencing due to technology use.

Case-Based Multiple Choice Questions (MCQs) on Societal Impacts


Q1. Aniruddha is studying the concepts of digital footprints. Help him to clarify the concepts of
digital footprints.
(i) Digital footprints are also known as _____________
a. Digital data
b. Plagiarism
c. Digital tattoos
d. Digital print

(ii) Digital footprints are stored ______________


a. Temporarily (for few days)
b. Permanently
c. for 7 days only
d. for 3 days

(iii) Whenever we surf the Internet using smartphones we leave a trail of data reflecting the
activities performed by us online, which is our _____________
a. Digital footprint
b. Digital activities
c. Online handprint
d. Internet activities

(iv) There are _________ kinds of Digital footprints.


a. 1
b. 2
c. 3
d. 4

(v) Which is the correct type(s) of digital footprint?


a. Active digital footprint
b. Passive digital footprint
c. Both a and b
d. None

Q2. Shobhit is eager to know the best way to behave on the internet. Help him to know the concepts
of net and communication etiquettes.
77
(i) Digital communication includes ________
a. Email
b. Texting
c. Instant messaging
d. All of the above

(ii) _______ is a person who deliberately sows discord on the Internet by starting quarrels or
upsetting people, by posting inflammatory or off-topic messages in an online community.
a. Netizen
b. Digital Citizen
c. Internet troll
d. None of the above

(iii) Online posting of rumors, giving threats online, posting the victim’s personal information,
comments aimed to publicly ridicule a victim is termed as __________
a. Cyber bullying
b. Cyber insult
c. Cybercrime
d. All of the above

(iv) Being a responsible digital citizen, we should ______


a. not use copyrighted materials
b. avoids cyber bullying
c. respect the privacy of others
d. All of the above

(v) Which of the following is Net Etiquette?


a. Be Ethical
b. Be Respectful
c. Be Responsible
d. All of the above

Q3. Namita has recently shifted to a new city and a new school. She does not know many people
in her new city and school. But among all the students, someone is posting negative, demeaning
comments on her social networking profile, school site’s forum, etc. She is also getting repeated
emails from unknown people. Every time she goes online, she finds someone chasing her online.
a) What is happening to Namita?
i. Namita has become a victim of cyberbullying and cyberstalking.
ii. Eavesdropping
iii. Scam
iv. Violation of IPR

b) What action should be taken by her to stop them?


i. Discuss with Parents
ii. Discuss in peer group
iii. Hide and get herself emotionally hurt
iv. She must immediately bring it to the notice of her parents and school authorities. And she must
report this cybercrime to local police with the help of her parents.
78
c) The act of fraudulently acquiring someone’s personal and private information, such as online
account names, login information, and passwords is called as __________.
i. Phishing
ii. Fraud
iii. Identity Theft
iv. Plagiarism

d) Namita needs to protect her personal information or data from unintentional and intentional
attacks and disclosure which is termed as __________.
i. Digital right
ii. Copyright
iii. Privacy
iv. Intellectual property

e) A set of moral principles that governs the behavior of a group or individual and regulates the
use of computers.
i. Copyright
ii. Computer ethics
iii. Property rights
iv. Privacy law

Answers:
Q1. Answer
(i) c. Digital tattoos
(ii) b. Permanently
(iii) a. Digital footprint
(iv) c. 3
(v) c. Both a and b
Q2. Answer
(i) d. All of the above
(ii) c. Internet troll
(iii) a. Cyber bullying
(iv) d. All of the above
(v) d. All of the above
Q3. Answer
(i) i. Namita has become a victim of cyberbullying and cyberstalking.
(ii) iv. She must immediately bring it to the notice of her parents and school authorities. And
she must report this cybercrime to local police with the help of her parents.
(iii) iii. Identity Theft
(iv) iii. Privacy
(v) ii. Computer ethics

Very Short Answer Type Questions (1 mark)


1. In which year did the Indian IT Act, 2000 get updated?
2. What is data privacy?
79
3. Which of the following is not a type of cybercrime?
a) Data theft
b) Forgery
c) Damage to data and systems
d) Installing antivirus for protection
Answers:
1. Answer: 2008
2. Answer: Data privacy refers to the protection of personal and sensitive information from
unauthorized access, use, or disclosure.
3. Answer: d) Installing antivirus for protection

Short Answer Type Questions (2 marks)


1. What is identity theft? How can we prevent identity theft?
2. Define e-waste. What are the various methods for effective e-waste management?
3. What do you mean by plagiarism? Provide 2 examples of acts that can be termed as
plagiarism.
4. Define digital property rights and explain.
5. State 2 measures for the protection of digital property rights.
6. Differentiate between shareware and proprietary software.
7. Explain what cybercrime is and provide an explanation of "information theft."
8. Provide 2 benefits of ICT on today's society.
9. State 2 benefits of e-waste recycling.
10. Differentiate between Free Software and Open-Source Software.

Answers:
1. Identity theft is a crime in which someone wrongfully acquires and uses another person's
personal information, such as their name, social security number, or financial data,
typically for fraudulent purposes.
To prevent identity theft, individuals should:
• Safeguard personal information.
• Use strong and unique passwords.
• Be cautious with sharing personal information online.
• Monitor financial statements and credit reports.

2. E-waste (electronic waste) refers to discarded electronic and electrical equipment.


Effective e-waste management involves:
• Collection of e-waste from consumers.
• Recycling to recover valuable materials.
• Safe disposal of hazardous components.
• Promoting reuse and refurbishment of electronics.

3. Plagiarism is the act of using someone else's work, ideas, or intellectual property without
proper attribution. Two examples of acts that can be considered plagiarism:
1. Copying and submitting a research paper without citing the original source.
2. Using images from the internet in a presentation without providing image credits.

4. Digital property rights refer to the legal rights and protections granted to individuals or
entities over their digital assets, including software, digital content, and intellectual
80
property. These rights ensure that creators have control over their work and can prevent
unauthorized use or distribution.

5. State 2 measures for the protection of digital property rights.


• Register intellectual property with relevant authorities.
• Use digital rights management (DRM) tools to protect digital content from
unauthorized copying or distribution.

6. Shareware is software that is distributed for free, often with limited features, and requires
payment for full functionality. Proprietary software is commercially licensed software that
does not provide access to the source code and has restrictions on distribution and
modification.
7. Cybercrime refers to criminal activities carried out in the digital domain. Information theft
involves stealing sensitive data, such as personal information, financial records, or
intellectual property, through unauthorized access to computer systems or networks.
8. (i) Improved communication and connectivity.
(ii) Enhanced access to information and educational resources.
9. (i) Reduction of environmental pollution from hazardous materials.
(ii) Recovery of valuable resources, such as metals, from electronic waste.
10. Free Software is software that allows users to use, modify, and distribute the software
freely, often with the requirement that any modified versions remain open and free. Open-
Source Software provides access to the source code of the software, allowing users to view,
modify, and distribute it, typically with the requirement that modifications are shared with
the community.

Long Answer Type Questions (3/4 marks)


1. Sumit received a laptop as a gift after achieving good marks in all subjects. His father wants
to make him aware of the health hazards associated with inappropriate and excessive laptop
usage. Help Sumit's father by listing the points he should discuss with Sumit.
2. Explain what cybercrime is, its types, and measures to avoid it.
3. Discuss the social and cultural changes induced by technology.
4. Define internet addiction and suggest methods to overcome it.
5. Provide 2 benefits of ICT on today's society.
6. With one major Asian country generating approximately 2 million tonnes of electronic
waste annually and only 1.5% of the total e-waste being recycled, suggest a method to
manage e-waste.
7. Explain Net Etiquettes and provide information on two such etiquettes.
8. Priyanka uses her internet connection to book a flight ticket, leaving a trail of web
activities. What is this type of activity called? What are the associated risks?

Answers:
1.
• Discuss the importance of maintaining proper posture while using the laptop to avoid
physical strain.
• Explain the risks of excessive screen time, such as eye strain, headaches, and disrupted
sleep patterns.
• Emphasize the need for regular breaks to stretch and rest the eyes.

81
• Talk about the potential negative impact on social interactions and outdoor activities due
to excessive laptop use.
• Stress the importance of cybersecurity and responsible online behavior.

2.
Cybercrime refers to criminal activities conducted in the digital realm. Types of cybercrime include
hacking, phishing, identity theft, cyberbullying, and more. To avoid cybercrime, individuals
should:
• Use strong and unique passwords.
• Be cautious about sharing personal information online.
• Keep software and antivirus programs up-to-date.
• Avoid suspicious websites and emails.
• Report any cybercrimes to law enforcement.

3.
• Technology has led to increased connectivity, changing the way people interact and
communicate.
• It has influenced the way information is accessed, leading to a more informed society.
• Cultural changes include shifts in traditions, art forms, and entertainment due to digital
media.
• It has also raised concerns about privacy and surveillance in society.

4.
Internet addiction is a compulsive dependency on the internet that interferes with daily life.
Methods to overcome it include:
• Setting time limits for online activities.
• Engaging in offline hobbies and social interactions.
• Seeking professional help if addiction is severe.

5.
• ICT (Information and Communication Technology) has improved communication and
connectivity, allowing people to stay connected globally.
• It has enhanced access to education, information, and services, bridging the digital divide.

6.
• Implement comprehensive e-waste recycling programs, with incentives for individuals and
businesses to recycle their electronic devices responsibly.
• Develop collection centers and partnerships with recycling facilities to ensure the proper
disposal and recycling of electronic waste.

7.
Net Etiquettes (Internet Etiquettes) are guidelines for polite and respectful online behavior. Two
such etiquettes are:
• Always use proper language and avoid offensive or hurtful comments in online discussions.
• Respect other people's privacy by not sharing their personal information without consent.

8.
82
This type of activity is called "digital footprint" or "online footprint." The associated risks include
potential data privacy issues and the collection of personal information by websites or third parties,
which can lead to targeted advertising and potential data breaches.

83
Scoring Tips for Examinations:
1. Understand the Syllabus: Familiarize yourself with the entire syllabus to know what to
expect in the exam.
2. Organize Your Study Material: Create a well-organized study plan with all relevant study
materials.
3. Time Management: Allocate specific time slots for each subject or topic. Stick to your
schedule to cover all areas.
4. Practice Regularly: Consistent practice helps improve your understanding and retention of
the material.
5. Previous Year Papers: Solve previous year question papers to get an idea of the exam
pattern.
6. Mock Tests: Take mock tests to simulate the exam environment and assess your progress.
7. Healthy Lifestyle: Maintain a healthy lifestyle with proper sleep, nutrition, and exercise to
stay mentally alert.
8. Effective Notes: Make concise notes while studying to facilitate quick revision.
9. Understanding Over Memorization: Focus on understanding concepts rather than rote
memorization.
10. Clarify Doubts: Seek help from teachers, peers, or online resources to clarify doubts.
11. Self-Assessment: Regularly evaluate your progress and adjust your study plan accordingly.
12. Study Groups: Join or form study groups for group discussions and sharing knowledge.
13. Manage Stress: Learn relaxation techniques to manage exam-related stress.
14. Positive Mindset: Stay positive and confident about your preparation.
15. Exam Instructions: Carefully read and understand the exam instructions and question
patterns.
16. Time Allocation: Distribute your time wisely among different sections of the exam.
17. Answer All Questions: Attempt all questions even if you're unsure; you might get partial
credit.
18. Key Points First: When writing essays or long answers, begin with key points to grab the
examiner's attention.
19. Revisions: Allocate time for multiple revisions before the exam.
20. Stay Calm: During the exam, stay calm, read questions carefully, and answer confidently.

Remember, success in exams is not just about how much you know but also how well you prepare
and manage your time effectively. Good luck with your exams!

84

You might also like