0% found this document useful (0 votes)
27 views52 pages

SSM Xii Informatics Practices

Uploaded by

pheonix136798
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)
27 views52 pages

SSM Xii Informatics Practices

Uploaded by

pheonix136798
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/ 52

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

KENDRIYA VIDYALAYA SANGATHAN LUCKNOW REGION

बोर्ड कक्षाओं के वलए पूरक अध्ययन सामग्री


SUPPLEMENTARY STUDY MATERIAL FOR BOARD
CLASSES
कक्षा/CLASS : XII

विषय/SUBJECT: इन्फामेविक्स प्रैक्टिसेज/INFORMATICS PRACTICES

CHIEF MENTOR
Smt. Sona Seth, Deputy Commissioner, KVS Regional Office Lucknow
MENTOR
Sh. Anup Kumar Awasthi, Assistant Commissioner, KVS Regional Office Lucknow
Smt. Archana Jaiswal, Assistant Commissioner, KVS Regional Office Lucknow
Sh. Vijay Kumar, Assistant Commissioner, KVS Regional Office Lucknow

COORDINATOR
Sh. Samrat Kohli, Vice-Principal, PM SHRI KV OEF No. 1 Kanpur
CONTENT DEVELOPMENT TEAM
Sh. Sunil Kumar Verma, PGT (Comp. Sc.), PM SHRI KV Armapur No. 1 Kanpur
Sh. Paritosh Srivastava, PGT (Comp. Sc.), PM SHRI KV AMC 1st Shift
Sh. Keshar Singh, PGT (Comp. Sc.), KV BHEL Jagdishpur
Sh. Nripendra Kumar, PGT (Comp. Sc.), KV No. 3 Chakeri Kanpur
Sh. Dharmendra Kumar Tripathi, PGT (Comp. Sc.), KV IIT Kanpur
Sh. Vivek Kumar Gupta, PGT (Comp. Sc.), PM SHRI KV MCF Lalganj Raebareli
Ms. Divya Agrawal, PGT (Comp. Sc.), PM SHRI KV Gomtinagar 2nd Shift Lucknow
IMPROVEMENT & COMPILATION
Sh. Ashok Kumar, PGT (Comp. Sc.), PM SHRI KV No. 2 Armapur Kanpur
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

2
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Index
Sl. No. Unit Name Chapter Name Marks in Page No
CBSE
1 Data Handling using Python Series 05 4-6
Pandas and data
Visualization
2 Data Handling using Python Dataframe 10 7-10
Pandas and data
Visualization
3 Data Handling using Data Visualization 05 11-14
Pandas and data
Visualization
4 Database Queries using Database Concept and 10 15-27
SQL MySQL simple Queries
5 Database Queries using MySQL Functions 10 28-36
SQL
6 Introduction to Computer Networking and 10 37-41
Computer Network web
7 Societal Impacts Societal Impacts 10 42-49

TOTAL 60

3
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Unit-1: Data Handling using Pandas and data Visualization


Name of Chapter: Pandas Series [MARKS IN CBSE-05]
Gist of the topic:

Pandas:

• It is a package useful for data analysis and manipulation.

• Pandas provide an easy way to create, manipulate and wrangle the data.

• Pandas provide powerful and easy-to-use data structures, as well as the means to quickly perform operations on
these structures.

Data scientists use Pandas for its following advantages:


• Easily handles missing data.

• It uses Series for one-dimensional data structure and DataFrame

for multi-dimensional data structure.

• It provides an efficient way to slice the data.

• It provides a flexible way to merge, concatenate or reshape the data.

Data Structure in Pandas


A data structure is a way to arrange the data in such a way that so it can be accessed quickly and we can perform
various operation on this data like- retrieval, deletion, modification etc.

Pandas deals with 3 data structure

1. Series

2. Data Frame

Series-Series is a one-dimensional array like structure with homogeneous data, which can be used to handle and
manipulate data. What makes it special is its index attribute, which has incredible functionality and is heavily
mutable.

It has two parts

1. Data part (An array of actual data)

2. Associated index with data (associated array of indexes or data labels)

4
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

5
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Common Mistakes committed by students while writing the answer:

Wrong Version Right Version


1. Import Pandas as pd : import pandas as pd
2. pd.series() : pd.Series()
3. pd.dataframe() : pd.DataFrame()
4. s1.Head() : s1.head()
5. s2.Tail() : s2.tail()

QUESTIONS BASED ON PANDAS SERIES


Questions Solutions

Q.1- Given the following Series1 import pandas as pd


A 100 Series1=pd.Series([100,200,300,400,500],index=['A','B','C','D',
B 200 'E'])
C 300 Series2=Series1*
D 400 2 print(Series1)
E 500 print(Series2)
OUTPUT
Write the command to create above Series
and then double the value in series and store
in another series named Series2

Q.2- State whether True or False a. A series object is size mutable. (False)
a. A series object is size mutable. b. A Dataframe object is value mutable (True)
b. A Dataframe object is value mutable

Q.3- Consider a given Series , Series1: import pandas as pd


200 700 Series1=pd.Series(700,index=range(200,205))
201 700 print(Series1)
202 700 OUTPUT
203 700
204 700
Write a program in Python Pandas to create the
series and display it.

Q.4- Consider the following Series object, import pandas as pd


s IP 95 s=pd.Series([95,89,92,95],index=['IP','Physics','Chemistry','Ma
Physics 89 th']) print(s.index[0])
Chemistry 92 s=s+10 print(s)
Math 95
i. Write the Python syntax which will ANSWER:
display only IP. i) series_object.index[index number]
ii. Write the Python syntax to increase marks ii) series_object=series_object+10
of all subjects by 10. OUTPUT:

6
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

UNIT-1: Data Handling Using Pandas with Data Visualization


CHAPTER-2:-DATAFRAME [MARKS IN CBSE-10]

DATA FRAMES
DataFrame is a Data Structure
It is two dimensional (tabular) heterogeneous data labeled array.
It has two indices or two axes : a row index (axis=0) and a column index (axis=1)
The row index is known as index and the column index is called the column name.
The indices can be of any data type.
It is both value mutable and size mutable.
We can perform arithmetic operations on rows and columns.

Creating DataFrame
1.Creating a DataFrame from dictionary of Series.
DataFrames are two dimensional representation of series.
smarks=pd.Series({'Neha':80,'Maya':90,'Reena':70})
sage=pd.Series({'Neha':25,'Maya':30,'Reena':29})
dict={'Marks':smarks,'Age':sage}
df3=pd.DataFrame(dict)

2.Creating a DataFrame from list of dictionaries


student=[{'Neha':50,'Manu':40},{'Neha':60,'Maya':45}]
df4=pd.DataFrame(student,index=['term1','term2'])
print(df4)
NaN is automatically added in missing places.

Selecting or Accessing Data


Selecting / Accessing a column
Syntax :
<dataframe object>[<column name>] Or <dataframe object>.<column
name>
In the dot notation make sure not to put any quotation marks around the
column name.
print(df5.BS)
or
print(df5['BS'])
Selecting / Accessing multiple columns
Syntax :
<dataframe object>[[<column name>,<column name>,…….]]
Columns appear in the order of column names given in
the list inside square brackets.
print(df5[['BS','IP']])

7
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Selecting / Accessing a subset from a DataFrame using Row/Column names


Syntax:
<dataframe object>.loc[<start row>:<end row>,<start column>:<end column>]
To access a row: <dataframe object>.loc[<row label>, : ]

To access multiple rows: <dataframe object>.loc[<start row>:<end row> , : ]


Python will return all rows falling between start row and end row; along with start row and end row.
print(df5.loc['Ammu':'Manu', : ])

Assigning / Modifying Data Values in DataFrame


To change or add a column
<dataframe object>[<column name>]=<new value>
If the given column name does not exist in dataframe then a new column with the name is added.
df5['ENG']=60
print(df5)

Deleting Row/ Columns in DataFrame


We can use drop() also to delete a column. By default axis=0.
<dataframe object> = <dataframeobject>.drop([</rowname/columnname or index>],axis=0/1)
df5=df5.drop([‘ECO’], axis =1)
df5=df5.drop(columns=['ECO','IP'])

Renaming index / column labels


rename() renames the existing index or column labels in a dataframe/series. The old and new
index/column labels are to be provided in the form of a dictionary where keys are the old indexes/row
labels and the values are the new names for the same.
Syntax:
<DF>.rename({old_Value:new_value}, axis=0/1,inplace=True)

Solved Questions
Q1. What is the purpose of index attribute in dataframe:
(a) Fetch the dimension of the given dataframe (b) Fetch the size of the given dataframe
(c) Fetch both index and column names of the given dataframe (d) Fetch the index’s name in the dataframe
Ans: (d)
Q2. What is the purpose of ndim attribute in dataframe:
(a) Fetch the dimension of the given dataframe (b) Fetch the size of the given dataframe
(c) Fetch both index and column names of the given dataframe
(d) Fetch the data type values of the items in the dataframe Ans: (a)

Q3. What is the purpose of size attribute in dataframe:


(a) Fetch the dimension of the given dataframe (b) Fetch the size of the given dataframe
(c) Fetch both index and column names of the given dataframe

8
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

(d) Fetch the data type values of the items in the dataframe Ans : (b)

Q4. What is the purpose of axes attribute in dataframe:


(a) Fetch the dimension of the given dataframe (b) Fetch the size of the given dataframe
(c) Fetch both index and column names of the given dataframe (d) Fetch the index’s name in the dataframe
Ans : (c)

Q5. From the 6th display the 3rd, 4th and 5th columns from 6th to 9th rows of a dataframe DF, you can write ______.
(a) DF.loc[6:9,3:5] (b) DF.loc[6:10,3:6] (c) DF.iloc[6:10,3:6] (d) DF.iloc[6:9,3:5] Ans: (c)

Q6. To change the 5th column’s value at 3rd row as 35 in dataframe DF you can write ____.
(a) DF.loc[4,6]=35 (b) DF[3,5]=35 (c) Df.iat[4,6]=35 (d) Df.iat[3,5]=35 Ans: (d)

Q7. Which among the following options can be used to create a DataFrame in Pandas?
(a) A scalar value (b) An ndarray (c) A python (d) All of these Ans: (d)

Q8. What is the output of the following code:


import pandas as pd
resultDict={'Mohit':pd.Series([76,98,54], index=['Physics','Chemistry', 'Maths']),\
'Priya':pd.Series([65,87,43],index=['Physics','Chemistry', 'Maths']),\
'Deep':pd.Series([60,75,83],index=['Physics','Chemistry', 'Maths'])}
resultDF=pd.DataFrame(resultDict)
print(resultDF.T)
Ans:
Physics Chemistry Maths
Mohit 76 98 54
Priya 65 87 43
Deep 60 75 83

Q9. Choose correct syntax Selecting/Accessing a Column


(a) <DataFrame object>[column name] (b) <DataFrame object>.<column name>
(c) Both (a) and (b) (d) None of these Ans: (c)
Q10. What is the output of the following code:
import pandas as pd
SData={"name":['Taran','Vinay','Vinita','Rishabh','Ravi','Manoj'],\
'Accounts':[54,76,98,54,76,87],'English':[89,87,54,89,43,67],\
'Bst':[65,67,87,56,87,54], 'IP':[98,76,98,56,87,99]}
Sno=['Sno1','Sno2','Sno3','Sno4','Sno5','Sno6']
df=pd.DataFrame(SData,index=Sno)
print("To access range of columns from range of rows")
print(df.loc['Sno2':'Sno5','Accounts':'IP'])
Ans:
Accounts English Bst IP
Sno2 76 87 67 76
Sno3 98 54 87 98

9
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Sno4 54 89 56 56
Sno5 76 43 87 87
Q11. Write the purpose of loc
(a) loc is label-based, which means that you have to specify rows and columns based on their row and column labels.
(b) loc is integer position-based, so you have to specify rows and columns by their integer position values (0-based
integer position).
(c) Option (a) is correct
(d) Both (a) and (c)
Ans: (d)

Q12. >>> df.loc['Fri', :]


What is the purpose of above code
(a) To get all columns
(b) To set all columns
(c) To get all rows
(d) To set all rows
Ans: (a)

Q13. >>> df.loc[['Thu', 'Fri'], 'Temperature']


What is the purpose of above code:
(a) To get Thu, Fri columns and Temperature row
(b) To get Thu, Fri rows and Temperature column
(c) Both (a) and (b) are wrong statements
(d) None of these
Ans: (b)

Q14. Who is the main author of Pandas?


(a) Dennis M. Ritchie (b) Guido van Rossum (c) James Gosling (d) Wes McKinney Ans: (d)

10
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

UNIT-1: Data Handling Using Pandas with Data Visualization


CHAPTER-3:-DATA VISUALIZATION [MARKS IN CBSE-05]

NEED OF DATA VISUALIZATION

• Quick Action and Result


• Identifying patterns and easy errors finding.
• Understanding at a glance
• Comparative analysis the Trends and
Definition of Data Visualization-
Data visualization means graphical or pictorial representation of the data using some pictorial tools like
graph, chart, etc. Visualization helps to effectively communicate information to users.

Introduction of Matplotlib –
Matplotlib is used to create charts in few lines of code. It is the most popular and a multi-
platform data visualization library built on NumPy arrays.

Understanding Pyplot-
The pyplot module of Matplotlib library can be imported in the Python program to plot graphs.
import matplotlib.pyplot as plt

Where plt is name given to pyplot object. You can give any valid identifier/name.
Similarly Use of Numpy and Pandas-
import Numpy as np and
import Pandas as pd
Here plt, np and pd are interfaces objects used during program development.
o plt.show() – It display current object or chart made using interactive windows. Chart
Attributes:-
o Adding Labels – Labels can be display on following axis-
 x –axis
 y- axis
o Title – It display the title of the chart
o Legends – It display types of patterns/ colour for different parts of the charts.

Charts and its types: -


Pyplot’s plot ( ) function is used to generate line chart for given values for x-axis and y-axis. Data for X and
Y axis may be list, series, column of DataFrame.
<pyplotobj>.plot([X-Value,]<Y-Value>)

X-Value : Dataset for X-Axis. Default value is [0..N-1], if not given values for X-Axis.
(Dataset may be 1-D Array, List, Series or Column of DataFrame.)

Y-Value : Dataset for Y-Axis. Number of values for X-Axis and Y-Axis should be equal.

11
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

#1.creating simplest line chart using List of


values:-
import matplotlib.pyplot as plt
xdata=[1,2,3,4,5]
ydata=[2,6,4,8,3]
plt.plot(xdata,ydata)
plt.show()

Bar Graph –
It is plot using a rectangular bars shapes along with x axis – horizontally and y axis – vertically.

#1. Creating simple bar graph using Lists


import matplotlib.pyplot as plt
x=[2016,2017,2018,2019,2020]
y=[55,46,30,50,40]
plt.bar(x,y)
plt.show()

Histogram-

A histogram is graphical visualization of the distribution of numerical Data in terms of frequency count. It
represents frequencies as bars based on non-overlapping ranges called bins.
Bins can be considered as consecutive, non-overlapping intervals of ranges. If can be a number or range with
lower and upper limit.
Using hist() function we can plot and customize histogram like bins or ranges, histogram types and orientation etc.
Example-
# 1.Hitogram with 5 bins for age of students
import matplotlib.pyplot as plt
data=[2,4,5,6,2,6,8,10,12,12,11,
10,4,3,2,5,7,9,11,12,13,14,
15,14,10,9,7,9]
plt.hist(data,bins=5)
plt.show()

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

12
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Required Functions to plot/customize the graph


1. Plt.plot(x,y ) – To plot line chart
2. Plt.bar(x,y ) – To plot bar chart
3. Plt.barh(x,y ) – To plot horizontal bar chart
4. Plt.hist( x, bins) - To plot histogram
5. Plt.title( ‘Title’)- To give title of the chart
6. Plt.xlabel(‘x axis label’) – To give the label of x-axis
7. Plt.ylabel(‘y axis label’) – To give the label of y-axis
8. Plt.show( ) – To display the graph
9. Plt.legend( )- To provide legend of graph
10.Plt.savefig(‘path’ ) – To save the graph

Multiple Choice Questions (Very short Question Answers) –

Q. 1 Matplotlib is a

i. Library, ii. Module, iii. Function iv. Keyword Ans i.


Library

Hint - It is library of Python and use it we use command iimport matplotlib

Q.2 The first sequence given in the bar() function represents the
i. y-axis, ii. z-axis, iii. x-axis iv. Can’t determine

Ans iii. x-axis

Hint – By default bar are aligned along with x-axis

Q.3 To draw a line graph which function is used


i. line, ii. plot, iii. bar & iv. pie Ans. ii. plot

Q.4 Sachin has created the graph shows the sales of Maruti and hundai. Even he has written the legend
function but still legend are not visible on the canvas. Find out what sachin has to write to make the
legend visible on the canvas
i. legend(True), ii. label, iii. xlabel & iv. ylabel Ans. label

13
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Descriptive Question.
1. Mr. Sharma is working in a game development industry and he was comparing the given chart on
the basis of the rating of the various games available on the play store.

He is trying to write a code to plot the graph. Help Mr. Sharma to fill in the blanks of the code and get
the desired output.
import #Statement 1

Games=["Subway Surfer","Temple Run","Candy Crush","Bottle Shot","Runner


Best"]

Rating=[4.2,4.8,5.0,3.8,4.1]
plt. (Games,Rating) #Statement 2
plt.xlabel("Games")

plt. ("Rating") #Statement 3

plt. #Statement 4

i. Choose the right code from the following for statement 1.

ii. Identify the name of the function that should be used in statement 2 to plot the above graph.

iii. Choose the correct option for the statement 3.

iv. Choose the right function/method from the following for the statement 4.

v. In case Mr. Sharma wants to change the above plot to the any other shape, which statement, should he change.

Common Mistakes Committed By students.

1. Not using show function to plot a chart.


2. Not using save figure function.
3. Use and concept of bins.

14
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

UNIT-2: Database Query using SQL


Name of Chapter: Revision of database concepts and SQL commands covered in class XI

[MARKS IN CBSE-10]

1-Introduction to database concepts and its need.

The database system is an excellent computer-based record-keeping system. A collection of data, commonly
called a database, contains information about a particular enterprise. It maintains any information that may be
necessary to the decision-making process involved in the management of that organization.

Need/Advantages of Database

Let us consider some of the benefits provided by a database system and see how a database system overcomes the
above-mentioned problems:-

 Reduces database data redundancy to a great extent


 The database can control data inconsistency to a great extent
 The database facilitates sharing of data.
 Database enforce standards.
 The database can ensure data security.
 Integrity can be maintained through databases.
2- Database Management System

A Database Management System (DBMS) is a software system that is designed to manage and organize data in a
structured manner. It allows users to create, modify, and query a database, as well as manage the security and
access controls for that database.

DBMS provides an environment to store and retrieve the data in convenient and efficient manner.
Examples:- MySQL,Oracle Database,MongoDB,IBM Db2 DBMS,Amazon RDS,PostgreSQL

3-Relational data model

15
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

The relational model uses a collection of tables to represent both data and the relationships among those data.
Each table has multiple columns, and each column has a unique name. Tables are also known as relations.

4-Domain:-In database management, a domain is a set of values that can be stored in a column of a database table.

Table/Relation - Student

ROLL_NO NAME ADDRESS PHONE AGE


1 RAM DELHI 9455123451 18
2 RAMESH GURGAON 9652431543 18
3 SUJIT ROHTAK 9156253131 20
4 SURESH DELHI 18

5- Tuple: Each row in the relation is known as a tuple. It contains 4 tuples

16
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

6-Attribute: Attributes are the properties that define an entity. e.g.; ROLL_NO, NAME, ADDRESS

7- Degree and Cardinality

Degree: The number of attributes in the relation is known as the degree of the relation. The STUDENT relation
defined above has degree 4

Cardinality: The number of tuples in a relation is known as Cardinality. The STUDENT relation defined above
has cardinality 5.

8-Candidate key: A candidate key in a database management system (DBMS) is a unique identifier for a record
within a table that can be chosen as the primary key. It possesses the essential characteristics required for a
primary key: uniqueness and minimal redundancy. While multiple candidate keys may exist within a table

9-Primary key: The PRIMARY KEY constraint uniquely identifies each record in a table.

Primary keys must contain UNIQUE values, and cannot contain NULL values.

A table can have only ONE primary key; and in the table, this primary key can consist of single or multiple
columns (fields).

10-Alternate key: An alternate key in a Database Management System (DBMS) serves as a candidate key that is
not selected as the

primary key. Its primary purpose is to provide an alternative unique identifier for a record within a table

ALTERNATE KEY = CANDIDATE KEY – PRIMARY KEY

11-Data Definition Language

12-DML: DML is an abbreviation for Data Manipulation Language. Represents a collection of programming
languages explicitly used to make changes to the database such as: create, read, update and delete data.

Examples of DML commands :- INSERT, SELECT, UPDATE, and DELETE

13-Introduction to MySQL

MySQL is a very popular open-source relational database management system (RDBMS).

What is MySQL?

 MySQL is a relational database management system


 MySQL is open-source
 MySQL is free
 MySQL is ideal for both small and large applications
 MySQL is very fast, reliable, scalable, and easy to use
 MySQL is cross-platform
 MySQL was first released in 1995

17
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

14-Creating a database using MySQL

The CREATE DATABASE statement is used to create a new SQL database.

Syntax:-

CREATE DATABASE databasename;

eg- CREATE DATABASE testDB;

15-Data Types:-The data type of a column defines what value the column can hold: integer, character, money, date

and time, binary, and so on.

Important data types

CHAR(size)-A FIXED length string (can contain letters, numbers, and special characters). The size parameter
specifies the column length in characters - can be from 0 to 255. Default is 1

VARCHAR(size)-A VARIABLE length string (can contain letters, numbers, and special characters). The size
parameter specifies the maximum column length in characters - can be from 0 to 65535 INT(size):-A medium
integer. Signed range is from -2147483648 to 2147483647. Unsigned range is from 0 to 4294967295. The size
parameter specifies the maximum display width (which is 255)

INTEGER(size)- Equal to INT(size)

DATE - A date. Format: YYYY-MM-DD. The supported range is from '1000-01-01' to '9999-12-31'

16-CREATE TABLE-The CREATE TABLE statement is used to create a new table in a database.

Syntax

CREATE TABLE table_name (

column1 datatype,

column2 datatype,

column3 datatype,

....

);

The column parameters specify the names of the columns of the table.

The datatype parameter specifies the type of data the column can hold (e.g. varchar, integer, date, etc.).
Example:-

18
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

CREATE TABLE Persons (PersonID int, LastName varchar(255), FirstName varchar(255), Address
varchar(255), City varchar(255));

17-DROP-The DROP TABLE statement is used to drop an existing table in a database.

Syntax:- DROP TABLE table_name;

Example:-DROP TABLE Persons;

18-ALTER Data Query: The ALTER TABLE statement is used to modify an existing table in a database.

a) To Add Column in existing table-

Syntax:- ALTEER TABLE table_name ADD COLUMN column_name datatype(size);

Example:-ALTER TABLE Persons ADD column address varchar(20);

b) To remove the column from table

Syntax:- ALTEER TABLE table_name DROP COLUMN column_name;

Example:-ALTER TABLE Persons DROP column address;

NULL value: The value which is not known or unavailable is called a NULL value. It is represented by blank
space.

By default, a column can hold NULL values.

NOT NULL: The NOT NULL constraint enforces a column to NOT accept NULL values.This enforces a field
to always contain a value, which means that you cannot insert a new record, or update a record without adding a
value to this field.

CREATE TABLE Persons (ID int NOT NULL, LastName varchar(255) NOT NULL,

FirstName varchar(255) NOT NULL);

It is not possible to test for NULL values with comparison operators, such as =, <, or < >.

We will have to use the IS NULL and IS NOT NULL operators instead.

IS NULL Syntax

SELECT column_names

FROM table_name

WHERE column_name IS NULL;

IS NOT NULL Syntax

19
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

SELECT column_names

FROM table_name

WHERE column_name IS NOT NULL;

20
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

31-INSERT

The INSERT INTO statement is used to insert new records in a table.

INSERT INTO Syntax

INSERT INTO table_name

VALUES (value1, value2, value3, ...);

32-DELETE

The SQL DELETE Statement

The DELETE statement is used to delete existing records in a table.

DELETE Syntax

DELETE FROM table_name WHERE condition;

33-UPDATE

The UPDATE statement is used to modify the existing records in a table.

UPDATE Syntax

UPDATE table_name

SET column1 = value1, column2 = value2, …

WHERE condition;

21
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Some General questions and answers


Q No QUESTIONS Marks
1 The purpose of WHERE clause in a SQL statement is to: 1
(A) Create a table
(B) Filter rows based on a specific condition
(C) Specify the columns to be displayed
(D )Sort the result based on a column
2 Identify the SQL command used to delete a relation (table) from a relational database. 1
(A) DROP TABLE
(B) REMOVE TABLE
(C) DELETE TABLE
(D) ERASE TABLE
3 Which of the following cannot work with SELECT clause. 1
(A) FROM
(B) WHERE
(C) ISERT INTO
(D) GROUP BY
4 A Table can have __________ 1
(a) Many primary keys and many unique keys.
(b) One primary key and one unique key
(c) One primary key and many unique keys.
(d) Many primary keys and one unique key.
5 Which of the following statements will delete all rows in a table namely mytable without deleting 1
the table’s structure.
(a) DELETE FROM mytable;’

(b) DELETE TABLE mytable;


(c) DROP TABLE mytable;
(d) None of these.

6 Which of the following SQL queries is used to retrieve rows from the"customers" table where 1
the "email"column contains NULL values?
(A) SELECT * FROM customers WHERE email=NULL;
(B) SELECT *FROM customers WHERE email IS NOT NULL;
(C)SELECT * FROM customers WHERE IS NULL (email);
(D) SELECT * FROM customers WHER Eemail IS NULL;
7 Which of the following query will drop a column from a table ? 1
(a) DELETE COLUMN column_name;
(b) DROP COLUMN column_name;
(c) ALTER TABLE table_name DROP COLUMN column_name;
(d) None of these
8 Which of the following is/are the DDL Statement ? 1
(a) Create (b) Drop (c) Alter (d) All of these
9 Which of the following types of table constraints will prevent the entry of duplicate rows? 1
(a) Unique (b) Distinct (c) Primary Key (d) Null
10 Consider the following SQL Statement. What type of statement is this ? 1
INSERT INTO instructor VALUES (10211, ‘SHREYA’ , ‘BIOLOGY’, 69000);
(a) Procedure (b) DML (c) DCL (d) DDL
11 With reference to SQL, identify the invalid data type. 1
(A) Date

22
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

(B) Integer
(C) Varchar
(D) Month
12 Which of the following requirement can be implemented using a CHECK constraint? 1
(a) Student must be greater than 18 years old.
(b) Student must be form a BRICS Country (Brazil, Russia, India, China)
(c) Student’s roll number must exist in another table(say, namely Eligible)
(d) None of these
13 The statement in SQL which allows to change the definition of a table is 1
(a) Alter (b) Update (c) Create (d) select
14 Key to represent relationship between tables is called 1
(a)Primary key (b) Secondary Key (c) Foreign Key (d) None of these
15 It is better to use files than a DBMS when there are 1
(a)Stringent real-time requirements.
(b) Multiple users wish to access the data.
(c) Complex relationships among data.
(d) All of the above.
16 Which of the following is a valid SQL type? 1
(a) CHARACTER (b) NUMERIC (c) FLOAT (d) All of the above
17 The RDBMS terminology for a row is 1
(a)tuple (b) relation (c) attribute (d) degree.
18 State whether the following statement is True or False : 1
In MYSQL, you can write multiple statements in a single line.
19 State whether the following statement is True or False : 1
In MYSQL, PRIMARY KEY and UNIQUE KEY both are the same.
Q-20 and Q-21 are Assertion (A) and Reason (R) Type questions. Choose the correct option as: 1

(A) Both Assertion (A) and Reason (R) are true, and Reason (R) is the correct explanation of
Assertion (A)
(B) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of
Assertion (A)
(C) Assertion (A) is True, but Reason (R) is False
(D) Assertion (A) is False, but Reason (R) is True
20 Assertion (A) : There is a difference between a field being empty or storing NULL value in a 1
field.

Reason (R) : The NULL value is a legal way of signifying that no value exists in the field.
21 Assertion (A): In SQL, INSERT INTO is a Data Definition Language (DDL) Command. 1
Reason (R): DDL commands are used to create, modify, or remove database structures, such as
tables.
22 What is NULL ? How it is different from Zero ? How are NULL values treated by aggregate 2
functions?
23 Rewrite the following SQL statement after correcting the error(s). Underline the corrections 2
made.
INSERT IN STUDENT(RNO, MARKS) VALUEC5, 78.5);
24 Differentiate between alternate key and candidate key 2

25 Name two categories into which SQL commands may be categorized. Also, give one example
of SQL commands in each category.

23
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

26 Define the term Primary Key in a database. Explain how it is different from a Candidate Key. 2

27 Amit, a salesman in an Outlet, created a table TRANSACTIONS an Amount is one of the 2


column of this Table. To find the details of customer whose transaction amount is more than
800, he wrote the following MySQL query, which did not give the desired result:
SELECT * FROM TRANSACTIONS WHERE Amount > “800”;
Help Amit to run the query by removing the errors from the query and write the correct query.
28 Write MySQL command to open an existing database. 2
29 Mr. William wants to remove all the rows from INVENTORY table to release the storage 2
space, but he does not want to remove the structure of the table. What MySQL statement should
be used?
30 Mr. lames created a table CLIENT with 2 rows and 4 columns. He added 2 more rows to it and 2
deleted one column. What is the Cardinality and Degree of the Table CLIENT?
31 2+1
(A) Write an SQL statement to create a table named STUDENTS, with the following
specifications:

(B) Write SQL Query to insert the following data in the Students Table

1, Supriya, Singh, 2010-08-18, 75.5


32 Write MySQL statements for the following: 3
A. To use a database named Pets.
B. To see all the tables inside the database.

C. To see the structure of the table named horse


33 What are DDL, DML, and DCL? 3

34 Write SQL queries on the basis of following table.


Relation : Student

Name Class Fee Gender DOB

Rahul XII 1200 M 2005-02-01

Mehul XII 1200 M 2004-12-11

Manisha XI 1050 F 2006-10-12

Sujoy XI 1050 M NULL

Sonakshi XII 1200 F 2005-09-19

24
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Suman X 950 F 2008-06-16

i. Increase salary of all employees by 1000.


ii. Decrease value of EmpID of male employees by 10.
iii. Department of ‘Mahesh’ should be updated as ‘HR’.
iv. Name should be updated as ‘Manish Saini’ and salary as 50000 for employee id
603.
v. ‘Finance’ department should be updated as ‘Fin’.
35 Write SQL queries on the basis of following table. 5
Relation : Student

Name Class Fee Gender DOB

Rahul XII 1200 M 2005-02-01

Mehul XII 1200 M 2004-12-11

Manisha XI 1050 F 2006-10-12

Sujoy XI 1050 M NULL

Sonakshi XII 1200 F 2005-09-19

Suman X 950 F 2008-06-16

i. Display all records from table student.


ii. List names of all students from table student.
iii. List name and class of all students from table student.
iv. List all students studying in class XII.
v. List names of male students.
36 Consider the following tables GAMES. Write SQL commands for the statements (a) to (e): 5
GCode GameName Number PrizeMoney ScheduleDate

101 Garom Board 2 5000 2007-01-23

102 Badminton 2 12000 2008-12-12

103 Table Tennis 4 8000 2007-02-14

105 Chess 2 9000 2008-01-01

108 Lawn Tennis 4 25000 2007-03-19

(a) To display the name of all Games.


(b) To display details of those games which are having PrizeMoney more than 7000.
(c) To display the unique game names.

25
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

(d) To display gcode and prize money of those Prize money is less than 10000.
(e) To Display the all Record those prizeMoney in 4000,5000,9000,10000,15000.
37 5

ANSWERS
Q ANSWERS Marks
No

1 (B) Filter rows based on a specific condition 1

2 (A) DROP TABLE 1

3 (C) ISERT INTO 1

4 (c) One primary key and many unique keys. 1

5 (a) DELETE FROM mytable; 1

6 (D) SELECT * FROM customers WHERE email IS NULL; 1

7 (c) ALTER TABLE table_name DROP COLUMN column_name; 1

8 (d) All of these 1

9 (a) Unique 1

10 (b) DML 1

11 (D) Month 1

12 (a) Student must be greater than 18 years old. 1

26
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

13 (a) Alter 1

14 (c) Foreign Key 1

15 (d) All of the above. 1

16 (d) All of the above 1

17 (a)tuple 1

18 True 1

19 False 1

20 (A) Both Assertion (A) and Reason (R) are true, and Reason (R) is the correct 1
explanation of Assertion (A)
21 (C) Assertion (A) is True, but Reason (R) is False 1

22 Null is a Specifier / Constraint represents that the actual value is absent for the 2
particular column. Null is different from zero because zero is a Numeric Value that can
be used in Arithmetic / Logical operations but NULL can not be used like this. None of
the aggregate functions takes NULL into consideration. NULL is simply
Ignored by all the aggregate functions excepts COUNT(*).
2 marks for correct answer with example

23 INSERT INTO STUDENT (RNO, MARKS) VALUES (5, 78.5); 2

24 The attribute or a combination of attributes that have unique values for each record 2
known as candidate key whereas a candidate key that is not the primary key is
known as an alternate key.

25 The two categories of SQL commands are as follow: 2


(i) DDL DDL stands for Data Definition Language. The DDL commands are
used to Create, Modify or Destroy the structure of the database objects,
E.g., CREATE TABLE, ALTER TABLE are of this category.

(ii) DML DML stands for Data Manipulation Language. The DML commands are
used to insert, display, delete or change data in tables,
E.g.,
SELECT, INSERT, UPDATE, DELETE, etc., commands are of this category.

26 Primary Key : A set of attributes that can uniquely identify each row in a table 2
(relation). It must contain unique values and cannot be null.
How it differs from Candidate Key
There can be multiple Candidate Keys in a table (relation), but only one of them is
selected as Primary Key.
(1 mark for correct definition)
(1 mark for correct difference)
27 Correct query is SELECT * FROM TRANSACTIONS WHERE Amount > 800; 2

27
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

28 The command to open an existing database is as follows: 2


USE database_name;

29 DELETE FROM INVENTORY 2

30 Cardinality = 4 2
Degree = 3
Cardinality are the number of rows and degree is number of the columns in a table.
31 (A) 2+1
CREATE TABLE STUDENTS (
StudentID NUMERIC PRIMARY KEY,
FirstName VARCHAR(20),
LastName VARCHAR(10),
DateOfBirth DATE,
Percentage FLOAT(10,2));
(2 mark for correct creation of Table)

(B)
INSERT INTO STUDENTS (StudentID, FirstName, LastName, DateOfBirth,
Percentage) VALUES (1, 'Supriya', 'Singh', '2010-08-18', 75.5);
(1 Mark for correct insert Query)
32 A. USE Pets; 3
B. SHOW TABLES;

C. DESCRIBE horse;
33 Data Definition Language (DDL) is responsible for all database schemas and
describes how data should be stored in the database. DDL includes commands
such as CreateTABLE and ALTER TABLE.

Data Manipulative Language (DML) is concerned with data operations and


manipulations. DML commands include Insert, Select, and so on.

Data Control Languages (DCL) are associated with permits and grants. In short,
these define the authorization to access any part of the database.
34 i. update emp set salary=salary+1000;
ii. update emp set empid=empid-10 where gender=’M’;
iii. update emp set department=’HR’ where empname=’Mahesh’;
iv. update emp set empname=’Manish Saini’, salary=50000 where empid=603;
v. update emp set department=’Fin’ where department=’Finance’;
35 i. Select * from student; 5
ii. Select name from student;
iii. Select name,class from student;
iv. Select * from student where class=’XII’;
v. Select name from student where gender=’M’;
36 (a) SELECT GameName FROM GAMES;
(b) SELECT * FROM GAMES WHERE PrizeMoney > 7000;.
(c) SELECT DISTINCT(GameName) FROM GAMES;

28
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

(d) SELECT GCODE, PRIZEMONEY FROM GAMES WHWRE Prizemoney is


less than 10000.
(e) SELECT * FROM GAMES WHERE prizeMoney
in(4000,5000,9000,10000,15000)
37 i. INSERT INTO EXAM VALUES(6,'Aarav','CS',65); 5
ii. UPDATE EXAM SET subject= "Informatics Practices" where subject = "IP";
iii. DELETE FROM EXAM WHERE marks <40;
iv. ALTER TABLE EXAM ADD COLUMN Grade varchar(2);
v. Select * from exam where subject="Computer Science";
(1 mark for each correct query)
Common mistakes committed by the students while writing the answers
1) While writing answers sometimes students forget to write column name in
ORDER BY clause.
Ex. SELECT * FROM STUDENT OREDER BY DESC

2) Students do not write actual names of columns which are in tables. It causes
error like unknown column…..
3) Some students write answers of MySQL query using Pandas, Series or DataFrame
concept.
4) They write degree in place of cardinality and vice-versa.
5) While writing degree of a table students count column level as a record.
6) The students forgot to enclose string and date within single or double quotes
while writing insert command.
7) Students forget to write semicolon at the end of the query.

29
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Name of Unit: Database Query using SQL


Name of Chapter: MySQL [MARKS IN CBSE-10]

Topic: MySQL Functions


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 (*).

MySQL Function: It is a special type of predefined command set that performs some operation and returns a single value.

Parameter or Arguments: The values that are provided to functions.

Types of MySQL Function: Functions can be divided into two categories:

Single row(or Scalar) Functions Multiple (or Aggregate or Group ) Functions

Work on each individual row of a table and return result Work on multiple rows together of a table and return a summary result for a
for each row. group of rows.

example : POWER (),UCASE (),DATE ()etc. example sum(),avg(),min(),max(),count() etc.

Can be used with SELECT clause, WHERE clause or any Commonly used with Group by clause. It may be used without Group by clause
other clause where individual row is concerned. too, where grouping is concerned against a particular column.

1. Single row(or Scalar) Functions


A. Math(or Numeric) functions

Function Description Examples Output

POWER(x,y) Calculates x to the power y. SELECT POW(3,4); 81

or ( xy) . x,y may be of +ve or –ve SELECT POWER(3,4); 81

POW(x,y) POWER,POW both are acceptable for same output

Rounds off Number N to D number of Decimal places. SELECT ROUND(345.3547,2); 345.35

ROUND(N,D) If D=0, it rounds off the number to nearest integer. SELECT ROUND(345.3857,2); 345.39

N,D may be of +ve or -ve

MOD(A,B) Returns the remainder after dividing number A by Number B SELECT MOD(45,7); 3

30
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

More POW(x,y) Examples

Common mistakes
MySQL QUERY X Y Output Remarks
committed by students

SELECT POW(3,4); 3 4 81 3 x 3 x 3 x 3 = 81

SELECT POW(-5,3); -5 3 -125 Misinterpreting results when x or y -5 x -5 x -5 = -125


is –ve.
SELECT POW(2,-2); 2 -2 0.25 2-2 means 1/22 i.e. 1/4

SELECT POW(25,0.5); Misinterpreting results when x or y


25 0.5 5 250.5 means √25 i.e. 5
is float.

SELECT POW(235,0); Misinterpreting results when x or y 0


235 0 1 for this cases (235) is 1
is 0 or 1.

SELECT POW(0,-1); Failing to consider what happens -1


0 i.e. 1/0 (e.g., division
0 -1 Error with invalid inputs
by zero).

More ROUND(N,D) Examples

Students’
MySQL QUERY N D Output Common Remarks
mistakes

SELECT ROUND(345.3547,2); 345.3547 2 345.35 Mistake: ROUND(N,D)


Students might
SELECT ROUND(345.3857,2); 345.3857 2 345.39 not understand Rounding to a specific decimal place (D):
how the
SELECT ROUND(345.3547,0); 345.3547 0 345 function rounds If D is positive, the number N will be rounded to
numbers, that many decimal places. + means Direction
SELECT ROUND(345.5547); 345.5547 346
especially
If D is 0, the number will be rounded to the
when it comes
SELECT ROUND(345.5547,-2); 345.5547 -2 300 nearest integer.
to the midpoint
rule (e.g.,
If D is negative, the rounding will happen before
rounding .5). the decimal point, effectively rounding to a specific
number of digits left of the decimal.(Nearest Decade
rounding off). – means  Direction
SELECT ROUND(3645.5547,-3); 3645.5547 -3 4000
Rounding behaviour:

Round Half-Up: If the digit immediately after the


rounding point is 5 or higher, it rounds up.

31
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Common
mistakes
Function Description Examples Output Remarks
committed
by students

If the string is
already in upper
case/mixed case. Converts string
Converts string into
They into upper case,
upper case. Both the
UCASE (string)/ UPPER Select misinterprets to Whether the
functions work the KENDRIYA string is
(string) same, only the name is ucase(‘KendDriya’); change it to
upper/lower or
different. lower/reverse mixed case
cases of .
respective mixed
case.

If the string is
already in lower
case/mixed case. Converts string
They into lower case,
Converts string into
LCASE (string)/ LOWER Select misinterprets to Whether the
lower case. Both the
kendriya string is
(string) functions work the lcase(‘KendDriya’); change it to
upper/lower or
same, only the name is upper/reverse mixed case
different. cases of .
respective mixed
case.

In MySQL
Returns a substring of Misinterprets
indexing starts
MID (string,pos,n)/ size n starting from indexing like
from 1. Here n
SUBSTRING(string,pos,n)/ specified position(pos) Select mid(‘Kendra python starts
Ndra V is total no of
of the string. All three Vidya’,3,6); from 0. And
functions work the characters to be
SUBSTR (string,pos,n)
same, only the name is extracted from
n is stop position.
different. the given string.

Returns the no of Misinterprets


Select Here len() will
LENGTH (string) character in the 8 with len() of
length(‘KenDriya’); show error.
specified string. python.

Returns N no of Misinterpreting It will return


LEFT (string, N) characters from the left KenD results when N is blank string if N
Select left(‘KenDriya’,4);
side of the string. –ve or 0. is –ve or 0.

2nd argument is
Returns N no of
Select mandatory
RIGHT (string, N) characters from the riya
right(‘KenDriya’,4); otherwise will
right side of the string.
give error.

Returns the position of


Misinterprets
the 1st occurrence of In MySQL
Select instr(‘KenDrnDr’, ’ indexing like
INSTR (string, substring) the substring in the 3 indexing starts
nDr’); python starts
given string. Returns 0 from 1.
from 0.
if not found.

Select Misinterprets
LTRIM () Returns the given KenDra Leading means
leading and
string after removing ltrim(‘ KenDra ’); from start. And
trailing white

32
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

leading white space spaces trailing means


characters. interchangeably. from end.

Returns the given


Select
string after removing
RTRIM () KenDra
trailing white space
rtrim(‘ KenDra ’);
characters.

Returns the given


string after removing Select
TRIM () both leading & trailing KenDra
white space trim(‘ KenDra ’);
characters.

33
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

B. Date Functions
Common
mistakes
Function Description Examples Output Remarks
committed
by students

It returns current system It returns


Misinterpret to
Date and Time. system
NOW () Select now(); 2025-01-07 11:17:29 current date &
date &
time.
yyyy-mm-dd hh:mm:ss time.

It returns the date part


DATE (‘yyyy-mm-
from the given date/time Select date(now()); 2025-01-07
dd’)
expression.

MONTH (‘yyyy-mm-dd’)

Or It returns the month part


in numeric form from the
Select month(‘2025-01-07’); 1
MONTH (‘yyyy-mm-dd given date/time
hh:mm:ss’) expression.

MONTHNAME (‘yyyy-
mm-dd’)
It returns the month Select
Or name from the specified January
date/time expression. monthname(‘2025-01-07’); Misinterpret
MONTHNAME (‘yyyy- date format in
mm-dd hh:mm:ss’) the form of
It will
‘2025-Jan-07’
YEAR (‘yyyy-mm-dd’) return null.
It returns the year in or
Select
Or numeric form from
2025 ’07-01-2025’
specified date/time
YEAR (‘yyyy-mm-dd year(‘2025-01-07’);
expression.
hh:mm:ss’)

DAY (‘yyyy-mm-dd’)
It returns the day in
Select
Or numeric form from
7
specified date/time
DAY (‘yyyy-mm-dd day(‘2025-01-07’);
expression.
hh:mm:ss’)

DAYNAME (‘yyyy-mm-
dd’)
It returns the day name Select
Or from the specified Tuesday
date/time expression. dayname(‘2025-01-07’);
DAYNAME (‘yyyy-mm-
dd hh:mm:ss’)

34
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

2. Multiple (or Aggregate or Group) Functions


To realize Aggregate function use the following table Dept:

DID DNAME E_QTY CITY Amt

T01 NVS 21 Jaipur 130

T02 KVS 21 Lucknow 205

T03 EMRS NULL NULL 7

T04 CBSE 9 Lucknow NULL

Common mistakes
Function Description Examples Output committed by Remarks
students

MAX (Distinct) Select max(distinct E_QTY) from


21
It returns maximum Dept;
Or
value from non-empty
values in a given
MAX (All)
column/expression. Select max(E_QTY) from Dept; 21
Excludes
empty values.
MIN (Distinct) It returns minimum Select min(distinct E_QTY) from
9
value from non-empty Dept;
Or
values in a given
column/expression. Select min(E_QTY) from Dept; 9 Misinterpreting the
MIN (All)
result including empty
values.
Select avg(distinct E_QTY) from (21+29+13)/3
Avg (Distinct) It returns average of 15.0
Dept;
non-empty values in a =21
Or
given
For count(distinct CITY)
column/expression. Select avg(E_QTY) from Dept; 17.0 Excludes
Avg (All) Most of the time
empty values.
students answers city
Sum (Distinct) Select sum(distinct E_QTY) from name in place of
It returns sum of non- 30 counting distinct cities.
Dept;
Or empty values in a given
column/expression.
Select sum(E_QTY) from Dept; 51
Sum (All)
Excludes
Select count(distinct E_QTY) from
2 empty values.
count (Distinct) It returns numeric count Dept;
for non-empty values in
Or Select count(distinct CITY) from
a given 2
Dept;
count (All) column/expression
Select count(E_QTY) from Dept; 3

COUNT(*)
It counts the number of
counts all
rows in a given Confusing COUNT(*)
rows, including
COUNT ( * ) column/expression Select count(*) from Dept; 4 with
those with
including NULL & COUNT(column_name):
NULL values in
duplicate values.
any column.

35
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

i.

Students of CBSE Class 12 Informatics Practices often make several common mistakes in the MySQL functions chapter during board examinations.
Here are some of these mistakes along with suggestions:
1. Misuse of Aggregate Functions (SUM, AVG, COUNT, MAX, MIN)
 Mistake: Using aggregate functions without a GROUP BY clause when grouping is required.
 Solution: Ensure to use the GROUP BY clause when you need to apply aggregate functions on grouped data.
SELECT DNAME, SUM(Amt)
FROM Dept
GROUP BY DNAME;
2. Misunderstanding of WHERE vs HAVING Clause
 Mistake: Using HAVING instead of WHERE for filtering rows before aggregation.
 Solution: Use WHERE to filter rows before applying aggregate functions, and HAVING to filter the results of aggregate functions.
SELECT DNAME, SUM(Amt) FROM Dept
WHERE Amt > 100
GROUP BY DNAME
HAVING SUM(Amt) > 200;
3. When the question is to write a query, then students committed mistakes like they forget to use select command with above functions.
They are confusing with SUBSTR(),INSTR() functions.
Solved Question Answer
Q1. In column ‘Margin’ contains the data set (2.00, 2.00, NULL, 4.00, NULL, 3.00, 3.00).What will be the output after the execution of
the given query? SELECT AVG(Margin) from SHOP;
(a) 2.80 (b) 2 (c) 2.0 (d) error Ans: (a) 2.80
Q2. Help Gargi in predicting the output of the following SQL command.
select INSTR('Informatics Practices','for')-LENGTH('Informatics');
(a) -8 (b) 8 (c) 7 (d) -7 Ans: (a) -8
Q3. To find the cardinality of the database table, student, we can use
a)select count( ) from student; b)Select count( * ) from student;
c)Select count(student) from student; d)Select count(rows) from student; Ans: b)Select count( * ) from student;
Q4. Match the following SQL functions/clauses with their descriptions:

36
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

SQL Function Description (A) P-2 Q-4 R-3 S-1


P Max() 1 Find the position of a substring in a string (B) P-2 Q-4 R-1 S-3
Q Substring() 2 Returns the maximum value in a column (C) P-4 Q-3 R-2 S-1
R Instr() 3 Sorts the data based on a column (D) P-4 Q-2 R-1 S-3
S Order by 4 Extracts a portion of a string Ans: (B) P-2 Q-4 R-1 S-3
Q5. Write the output of the SQL command: SELECT ROUND(25.532,-1);
(a) 25 (b) 30 (c) 20 (d) 25.5 Ans: (b) 30
Q6. Consider the string “Database Management System”. Write queries for the following:
i. Extract and Display “Manage” from the string.
ii. Display the position of the first occurrence of “base” in the given string.
Solution: For both the above queries use select clause first.
For 1st query then you can see substring “Manage” starts from position 10, and its size is 6 characters which is to be extracted. Hence
the resultant query would be: i. Select substr(“Database Management System”,10,6 ) ;
For 2nd Query position of the first occurrence of “base” substring can be evaluated by instr(A,B). Hence the resultant query would be:
ii. Select instr(“Database Management System”, “base” ) ;
Q7. Write suitable SQL queries for the following.
(a) To display the first 3 characters, extracted from the extreme right position of the given string ‘Mahabharat’.
(b) To display a substring ‘funny’ from a given string ‘English is a funny language’.
Suolution: (a) select right('Mahabharat',3); (b) select substr('English is a funny language',14,5);
Q8. Consider the following table: Table: ITEM
SNO ITEMNAME TYPE PRICE Write SQL queries for the following:

1 Chaises Living 11500 i. Display all the records in descending order of price.
ii. Display the type and total number of items of each type.
2 Accent Chairs Living 31000 iii. Display the average price of each type.

3 Baker Racks Kitchen 25000 Solution:

i. select * from Item order by price desc;


4 Sofa Living 7000
ii. select type, count(*) from item group by type;
5 Nightstand Bedroom 10000
iii. select type, avg(price) from item group by type;

Q9. Gargi, Who works as a database designer, has developed a database. This database includes a table Stock whose
column(attribute) names are mentioned below:
PID: Shows the unique code for each product
PNAME : Indicates the product Name
Category: Indicates the product category such as Input,Output or Network
Qty: Indicates the quantity of product
Price: Indicates the price of product

(a) Write SQL query to display product name in lowercase. (b) Write SQL query to display the highest price among the product.
(c) Write SQL query to display the number of characters in each product name.
(d) Write SQL query to display the product code and price sorted by price in descending order.
Solution: (a) select lower(Pname) from stock; (b) select max(price) from stock;
(c) select pname,length(pname) from stock; (d) select pid,price from stock order by price desc;
Q10. Dr Divya has created a database for a hospital’s pharmacy. The database includes a table name medicine whose column(
attribute) names are mentioned below:
MID: Shows the unique code for each medicine
Med_Name: Shows the name of medicine
Supp_city: specifies the city where the supplier is located
Stock: indicates the quantity of the medicine available
Del_date: specifies the date when the medicine was delivered.

Write the output of the following SQL queries. Solution:


(a) select length(med_name)-length(supp_city) from medicine (a) (c)
where stock >100;

37
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

(b) select Med_name from medicine where month(del_date)=6; length(med_name) - med_name


length(supp_city)
(c) select med_name from medicine where stock between 120
and 200 order by med_name desc; Insulin
6
(d) Select min(stock) from medicine; Cough syrup
4
1

(b ) (d)
Med_name min(stock)

PARACETAMOL 50

Q11. Write suitable SQL query for the following :


(i) To display the name of the month of the current date.
(ii) To remove spaces from the beginning and end of the string ‘Panorama’;
(iii) To display the name of the day For example , Friday or Sunday from your date of birth, dob
(iv) To display the starting position of your first name(fname) from your whole name(name)
(v) To compute the remainder of division between two numbers n1 and n2
Solution: (i) select monthname(now()); (ii) select trim(' Panorama '); (iii) select dayname('1985-09-10');
(iv) select instr('dinesh kumar sharma','dinesh'); or select instr(name,fname); (v) select mod(12,5); or select mod(n1,n2);

Q12. Consider a table salesman with the following data:


Solution:
(i) Select SName,round(Bonus,0) from salesman;
(ii) Select instr(SName, 'ta') from salesman;
(iii) Select mid(SName,2,4) from salesman;
Or
Select substring(SName,2,4) from salesman;
(iv) Select monthname(Dateofjoin) from salesman;
(v) Select dayname(Dateofjoin) from salesman;

Questions for Practice

Q1.

Q2. Write appropriate SQL queries for the


following:

I. Display Total Number of students appeared


class-wise.

II. Display name of all students in UPPER


Case who belongs to Raman house.

III. Display Name of Students along with their


corresponding Class & result.

38
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Q3. Sumit has created a database for a Library. The database


includes a table named Library whose column (attribute)
names are mentioned below:

B_Id: Shows the unique code for each book.

B_Name: Specifies the book title

B_Author: Specifies the author of the book.

B_Qty: Indicates the quantity of books available in the


library.

B_Date: Specifies the date of book published.

I. Write SQL query for display the number of characters in book name.

II. Write SQL query for display the books published in the month of October

III. Write SQL query for displaying the book name with quantity,having the quantity available between 30 to 50

IV. Write SQL query for display the name of latest books published.

UNIT-3: Introduction to Computer Networks


[Total Marks in CBSE:10]

What is Network? A group of two or more similar things or people interconnected with each
other is called network
Computer Network: A computer network is an interconnection among two or more
computers to share data and resources.
Type of Network: Based on the geographical area covered and data transfer rate, computer
networks are broadly categorised as –
 LAN (Local Area Network)
 MAN (Metropolitan Area Network)
 WAN (Wide Area Network)
 PAN (Personal Area Network)
Local Area Network (LAN): Local Area Network (LAN) is a network that connects digital
devices placed at a limited distance of upto 1 km.
Metropolitan Area Network (MAN): Metropolitan Area Network (MAN) is an extended form
of LAN which covers a larger geographical area like a city or a town.
Wide Area Network (WAN) :Wide Area Network (WAN) connects computers and
other LANs and MANs, which are spread across different geographical locations of a country
or in different countries or continents.

Ethernet: The protocol or the set of rules that decide functioning of a LAN is called
Ethernet.

39
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Networking Device: The hardware used in networking known as networking devices. These
are-
 Repeater: A repeater is an electronic device that receives a weak signal and
regenerates it.
 MODEM: Modem (MOdulator DEMolulator) refers to any such device used for
conversion between analog signals and digital bits.
 Hub: A hub is a network device used to connect multiple devices to form a network or
to connect segment(s) of LAN.
 Switch: A switch is a networking device that filters network traffic while connecting
multiple computers or communicating devices.
 Router: A router is a network device that can receive the data, analyse it and
transmit to other networks.
 Gateway: A gateway is a device that connects the organisation’s network with the
outside world of the Internet.

Network Topology: The physical organisation of computers, cables and other peripherals in
a network is called its topology. Common network topologies are
 Bus Topology
 Star Topology
 Tree Topology
 Mesh Topology
Bus Topology: In bus topology, each communicating device connects to a common central
transmission medium, known as bus.
Star Topology: In star topology, each communicating device is connected to a central node,
which is a networking device like a hub or a switch, through separate cables.
Tree Topology: In tree topology, multiple star and bus topologies are connected to a central
cable, also called the backbone of the network.
Mesh Topology: In mesh topology, each communicating device is connected with every
other device in the network.

Internet: The Internet is the largest WAN that connects millions of computers across the
globe.
Use of Internet: Some of the services provided through the Internet are information
sharing, communication, data transfer, social networking, e-commerce, etc.
Uniform Resource Locator (URL): A Uniform Resource Locator (URL) is a standard naming
convention used for accessing resources over the Internet.
Electronic mail (email): Electronic mail is a means of sending and receiving message(s)
through the Internet.
Chat: Chatting is communicating in real time using text message(s).
VoIP: Voice over Internet Protocol (VoIP) allows you to have voice calls over digital networks.
Website: A website is a collection of related web pages.
Webpage: A web page is a document that is viewed in a web browser such as Google
Chrome, Mozilla Firefox, Opera, Internet Explorer, etc. It can be static or dynamic.
Static Web Page: A static web page is one whose content does not change for requests
made by different people.

40
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Dynamic Web Page: A dynamic web page is one in which the content of the web page
displayed is different for different users.
Web Hosting: Web hosting is a service that allows you to post the website created locally so
that it is available for all internet users across the globe.
Web Server: A web server is a program or a computer that provides services to other
programs or computers called clients.
Web Browser: A browser is a software application that helps us to view the web page(s) over
the internet. Examples: Google Chrome, Mozilla Firefox, Opera, Internet Explorer, etc.
Web Browser Settings: Every browser has got certain settings that define the manner in
which the browser will behave. These settings may be with respect to privacy, search engine
preferences, download options,auto signature, autofill and autocomplete feature and much
more.
Add-ons and plug-ins: Add-ons and plug-ins are the tools that help to extend and modify
the functionality of the browser.
Cookies: A cookie is a text file containing a string of information which stores browsing
information on the hard disk of your computer.
Important Things to Remember:
1. Placement of Server- where numbers of computers are maximum.
2. Placement of switch/hub – Each block
3. Placement of Repeater- Between the blocks where distance is more than 70 Mtrs.
4. For cable layout/ topology- Try to make either star or bus only.
5. For network security Firewall to be installed.
6. Face to face communication- Video conferencing.
7. For voice call using internet- VoIP
8. Cable should be used in – i) LAN- Eathernet, ii) Co-axial iii) WAN-Fiber optics

Common Mistakes done by students:


1. Mostly confused between type of network and type of topologies
2. In cable layout, they connect all the blocks whereas in LAN they should use
either start or bus topology only.

Solved Questions:
1. Fill in the blanks:
a) To transmit data for sharing on a network, it has to be divided into smaller chunks called
______________________.
Ans: Packets
b) The set of rules that decide the functioning of a network is called _______. Ans: Protocols
c) A LAN can be extended up to a distance of __________ km. Ans: 1km.
d) The ___________________ connects a local area network to the internet. Ans: Gateway
e) The _____________ topology is of hierarchical nature. Ans: Tree
f) ____________________ is a standard naming convention used for accessing resources over
the Internet. Ans: URI(Uniform Resource Identifier)
g) ______________ is a collection of related web pages. Ans: Website
h) A _____________ is a computer that provides services to other programs or computers.
Ans: Server

41
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

2. MS Global Media Corp campus in Delhi has 4 blocks named A, B, C and D. The tables
given below show the distance between different blocks and the number of computers in
each block.

Distance between the various blocks is as follows: Number of computers

Block A 35
Block B 15
Block C 26
Block D 49

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. Justify 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. The Organization intends to link its Mumbai and Delhi centers. What type of
network will be created? Justify your answer.
v. Company allows its employees to make voice calls using a broadband internet
connection. Which Protocol is being used for this facility?
Ans:

i) Block A
Justification: It has maximum number of computers

ii) Start Topology


iii) Repeater: Between Block A and Block D, as distance is more than 70 mtrs.
Hub/Switch: In Each block, as it is required to connect computers together.
iv) WAN (Wide Area Network)
v) VoIP

42
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Unsolved Questions

1. Which device is used to regenerate the signals over long distance data transmission:
i. Switch ii. Modem iii. Repeater iv. None of the above
2. which protocol allow us to have voice calls over the internet?
i. HTTP ii. VoIP iii. Video Chat iv. SMTP
3. A computer network created by connecting the computers of your school’s computer lab is an example of
a. LAN b. MAN c. WAN d.PAN
3. Expand the following:
a) ARPANET b) ISP c) URL
4. Name the device for the following:
a) It stands for Modulator Demodulator b) It regenerates the signals.
5. Differentiate between:
a) MAN and WAN b) Website and web page
c) Router and Gateway d) Bus and Star topology
e) Static and Dynamic web pages f) Bus and Star topology

5. The Great Brain Organization has set up its new branch at Srinagar for its office and web based
activities. It has 4 Wings of buildings as shown in diagram:

Center to center distance between various blocks:

Wing X to Wing Z 50 m

Wing Z to Wing Y 70 m

Wing Y to Wing X 125 m

Wing Y to Wing U 80 m

Wing X to Wing U 175 m

Wing Z to Wing U 90 m

Number of Computers

Wing X 50

Wing Z 30

Wing Y 150

Wing U 15

(i) Suggest a cable layout of connections between the wings.


(ii) Suggest the most suitable topology of connections between the wings.
(iii) Suggest the most suitable place(i.e. Wing) to house the server of this organization with a
suitable reason, with justification.
(iv) Suggest the placement of following devices with justification:
a) Repeater

43
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

b) Hub/Switch
(v) The organization is planning to link its head office situated in Delhi with the offices at
Srinagar. Suggest an economic way to connect it; the company is ready to compromise on
the speed of connectivity. Justify your answer.

UNIT 4 : SOCIETAL IMPACTS


[TOTAL MARKS IN CBSE-10]

DIGITAL FOOTPRINT

A digital footprint – refers to the trail of data you leave while using the internet. It includes websites
you visit, emails you send, and information you submit online. A digital footprint can be used to track a
person’s online activities and devices.

Internet users create their digital footprint either actively or passively. A passive footprint is made
when information is collected from the user without the person knowing this is happening. An active
digital footprint is where the user has deliberately shared information about themselves either by using
social media sites or by using websites

Digital footprint examples

Online shopping
● Making purchases from e-commerce websites
Online banking
● Using a mobile banking app
Social media
● Using social media on your computer or devices

44
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

● Sharing information, data, and photos with your connections


Reading the news
● Subscribing to an online news source
Health and fitness
● Using fitness trackers
● Using apps to receive healthcare
NETIQUETTE It is the abbreviation of Internet etiquette or network etiquette, refers to online manners
while using internet or working online. While online you should be courteous, truthful and respectful of
others. It includes proper manners for sending e-mail, conversing online, and so on.
Some basic rules of netiquette are:

● Be respectful
● Think about who can see what you have shared.
● Read first, then ask
● Pay attention to grammar and punctuation
● Respect the privacy of others
● Do not give out personal information

DATA PROTECTION
Data protection is a set of strategies and processes you can use to secure the privacy, availability, and
integrity of your data. It is sometimes also called data security or information privacy. A data protection
strategy is vital for any organization that collects, handles, or stores sensitive data.
Data Privacy v/s Data Protection
For data privacy, users can often control how much of their data is shared and with whom. For data
protection, it is up to the companies handling data to ensure that it remains private. Data privacy is
focused on defining who has access to data while data protection focuses on applying those restrictions.
How we can protect our personal data online

● Through Encrypt our Data


● Keep Passwords Private
● Don't Overshare on Social Networking Sites
● Use Security Software
● Avoid Phishing Emails
● Be Wise About Wi-Fi
● Be Alert to Impersonators
● Safely Dispose of Personal Information

INTELLECTUAL PROPERTY RIGHTS (IPR)

45
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Intellectual Property (IP) – is a property created by a person or group of persons using their own intellect
for ultimate use in commerce and which is already not available in the public domain. Examples of
Intellectual Property :- an invention relating to a product or any process, a new design, a literary or
artistic work and a trademark (a word, a symbol and / or a logo, etc.)

Intellectual Property Right (IPR) is the statutory right granted by the Government, to the owner(s) of the
intellectual property or applicant(s) of an intellectual property (IP) to exclude others from exploiting the
IP commercially for a given period of time, in lieu of the discloser of his/her IP in an IPR application.

Copyright laws protect intellectual property


Copyright- It is a legal concept, enacted by most governments giving creator of original work exclusive
rights to it, usually for a limited period.
Copyright infringement – When someone uses a copyrighted material without permission, it is called
Copyright infringement.
Patent – A patent is a grant of exclusive right to the inventor by the government. Patent give the holder a
right to exclude others from making, selling, using or importing a particular product or service, in
exchange for full public disclosure of their invention.
Trademark – A Trademark is a word, phrase, symbol, sound, colour and/or design that identifies and
distinguishes the products from those of others.

PLAGIARISM

Plagiarism It is stealing someone’s intellectual work and representing it as your own work without citing
the source of information.
Any of the following acts would be termed as Plagiarism:
● Using some other author’s work without giving credit to the author
● Using someone else’s work in incorrect form than intended originally by the author or creator.
● Modifying /lifting someone’s production such as music composition etc. without attributing it to
the creator of the work.
● Giving incorrect source of information.

LICENSING AND COPYRIGHT

Licenses are the permissions given to use a product or someone’s creation by the copyright holder.
Copyright is a legal term to describe the rights of the creator of an original creative work such as a
literary work, an artistic work, a design, song, movie or software etc.

FREE AND OPEN-SOURCE SOFTWARE (FOSS)

OSS refers to Open Source Software, which refers to software whose source code is available to
customers and it can be modified and redistributed without any limitation. Free and open-source software

46
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

(FOSS) is software that can be classified as both free software and open-source software. That is, anyone
is freely licensed to use, copy, study, and change the software in any way, and the source code is openly
shared so that people are encouraged to voluntarily improve the design of the software.

CYBER CRIME

Any criminal or illegal activity through an electric channel or through any computer network is
considered as cyber crime.
Eg: Cyber harassment and stalking, distribution of child pornography,types of spoofing, credit card fraud
,. etc

CYBER LAW
It is the law governing cyberspace which includes freedom of expression, access to and usage of internet
and online privacy.
The issues addressed by cyber law include cybercrime, e-commerce, IPR and Data protection.

HACKING:
It is an act of unauthorised access to a computer, computer network or any digital system.
Hackers usually are technical expertise of hardware and software.
● Hacking when done with a positive intent is called as Ethical hacking or White hat.
● Hacking when done with a negative intent is called as Unethical hacking or Black hat.

PHISHING:
t is an unlawful activity where fake websites or emails appear as original or authentic .This sites when
clicked by the user will collect sensitive and personal details like usernames, password, credit card
details etc.

CYBER BULLYING:
It is the use of technology to harass , threaten or humiliate a target .
Example: sharing of embarrassing photos or videos, posting false information, sending mean text., etc.

OVERVIEW OF INDIAN IT ACT:


The Government of India’s – Information Technology Act, 2000 (also known as IT Act) , amended in
2008, provides guidelines to the user on the processing , storage and transmission of sensitive information

E-waste - HAZARDS AND MANAGEMENT:


Various forms of electric and electronic equipment which no longer satisfy their original purpose are
termed as Ewaste. This includes Desktop, Laptop, Projectors, Mobiles,etc
● HAZARDS:It consists of mixtures of various hazardous organic and inorganic materials which
when mixed with water/soil may create threat to the environment.
● MANAGEMENT: Sell back, gift/donate, reuse the parts ,giveaway to a certified e-waste recycler

ABOUT HEALTH CONCERNS RELATED TO THE USE OF TECHNOLOGY:


There are positive as well as negative impact on health due to the use of these technologies.
● POSITIVE IMPACT
▪ Various health apps and gadgets are available to monitor and alert

47
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

▪ Online medical records can be maintained


● NEGATIVE IMPACT
▪ One may come across various health issues like eye strain, muscle problems, sleep issues,etc
▪ Anti social behaviour, isolation, emotional issues, etc.

CASE STUDY BASED QUESTIONS


1. After practicals, Atharv left the computer laboratory but forgot to sign off from his email account.
Later, his classmate Revaan started using the same computer. He is now logged in as Atharv. He sends
inflammatory email messages to few of his classmates using Atharv’s email account. Revaan’s activity
is an example of which of the following cyber crime?
a) Hacking
b) Identity theft
c) Cyber bullying
d) Plagiarism

2. Rishika found a crumpled paper under her desk. She picked it up and opened it. It contained some text
which was struck off thrice. But she could still figure out easily that the struck off text was the email ID
and password of Garvit, her classmate. What is ethically correct for Rishika to do?
a) Inform Garvit so that he may change his password.
b) Give the password of Garvit’s email ID to all other classmates.
c) Use Garvit’s password to access his account.

3. Suhana is down with fever. So, she decided not to go to school tomorrow. Next day, in the evening she
called up her classmate, Shaurya and enquired about the computer class. She also requested him to
explain the concept. Shaurya said, “Mam taught us how to use tuples in python”. Further, he generously
said, “Give me some time, I will email you the material which will help you to understand tuples in
python”.
Shaurya quickly downloaded a 2-minute clip from the Internet explaining the concept of tuples in python.
Using video editor, he added the text “Prepared by Shaurya” in the downloaded video clip. Then, he
emailed the modified video clip to Suhana. This act of Shaurya is an example of
a) Fair use
b) Hacking
c) Copyright infringement
d) Cyber crime

4. After a fight with your friend, you did the following activities. Which of these activities is not an
example of cyber bullying?

a) You sent an email to your friend with a message saying that “I am sorry”.
b) You sent a threatening message to your friend saying “Do not try to call or talk to me”.
c) You created an embarrassing picture of your friend and uploaded on your account on a social
networking site.

5. You are planning to go on a vacation to Kashmir. You surfed the internet for the following:
i) Weather conditions
ii) Availabilty of air tickets and fares
iii) Places to visit
iv) Best hotel deals

48
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

Which of the above mentioned acts might have left a digital footprint?

a) i and ii
b) i, ii and iii
c) i, ii and iv
d) all of these

6. Naveen received an email warning him of closure of his bank accounts if he did not update his
banking information as soon as possible. He clicked the link in the email and entered his banking
information. Next he got to know that he was duped.

i) This is an example of __________ .


a. Online Fraud
b. Identity Theft
c. Phishing
d. Plagarism

ii) Someone steals Naveen’s personal information to commit theft or fraud, it is called ____________
a. Online Fraud
b. Identity Theft
c. Phishing
d. Plagarism

iii) Naveen receiving an Unsolicited commercial emails is known as __________


a. Spam
b. Malware
c. Virus
d. worms

iv) Naveen’s Online personal account, personal website are the examples of?
a. Digital wallet
b. Digital property
c. Digital certificate
d. Digital signature

v) Sending mean texts, posting false information about a person online, or sharing embarrassing photos
or videos to harass, threaten or humiliate a target person, is called ____________
a. Eavesdropping
b. cyberbullying
c. Spamming
d. Phishing

7. Prathyush has to prepare a project on “Cyber Jaagrookta Diwas”.He decides to get information from
the Internet. He downloads three web pages (webpage1, webpage 2, webpage 3) containing information
on the given topic.
1. He read a paragraph from webpage 1 and rephrased it in his own words. He finally
pasted the rephrased paragraph in his project. And he put a citation about the website he
visited and its web address also.

49
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

2. He downloaded three images of from webpage 2. He made a collage for his project
using these images.
3. He also downloaded an icon from web page 3 and pasted it on the front page of
his project report.

(i) Step1 is an act of……………


(a) Plagiarism
(b) copyright infringement
(c) Intellectual Property right
(d) None of the above

(ii) Step 2 is an act of _______.


(a) plagiarism
(b) copyright infringement
(c) Intellectual Property right
(d) Digital Footprints

(iii) Step 3 is an act of ________.


(a) Plagiarism
(b) Paraphrasing
(c) copyright infringement
(d) Intellectual Property right

(iv) ______is a small piece of data sent from a website and stored in a user’s web browser while a user is
browsing a website.
(a) Hyperlinks
(b) Web pages
(c) Browsers
(d) Cookies

(v) The process of getting web pages, images and files from a web server to local computer is called
(a) FTP
(b) Uploading
(c) Downloading
(d) Remote access

8. What are intellectual property rights (IPR), and why are they important in the digital world?
Ans. Intellectual Property Rights (IPR) These are legal rights that protect the creations of the human
intellect. The nature of these works can be artistic, literary or technical etc.
Importance in the digital world These rights help prevent the unauthorized use or reproduction of
digital content and ensure that creators are fairly compensated and incentivized for their original work.

9. Mention two health concerns associated with excessive use of Digital Devices.
Ans. Two health concerns due to excessive use of Digital Devices:
a) Eye strain and vision problems.
b) Musculoskeletal issues like neck and back pain.

50
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

10. Ayesha's family is replacing their old computer with a new one. They decide to throw the old
computer in a nearby empty field/plot.
I. Explain any one potential environmental hazard associated with improper e-waste disposal.
II. Suggest one responsible way to Ayesha's family for proper disposal of their old computer.
III. Describe the importance of recycling in e-waste management.
Ans. I. E-waste can release harmful substances like lead and mercury into the environment.
II. They can donate or sell it to a certified e-waste recycling center.
III. Recycling e-waste helps conserve natural resources and reduces pollution.

11. Richa, recently started using her social media account. Within a few days, she befriends many people
she knows and some that she does not know. After some time, she starts getting negative comments on
her posts. She also finds that her pictures are being shared online without her permission. Based on the
given information, answer the questions given below. i. Identify the type of cybercrime she is a victim of.
ii. Under which act, she can lodge a complaint to the relevant authorities?
iii. Suggest her any two precautionary measures which she should take in future while being online to
avoid any such situations.
Ans. i. She is a victim of Cyber Bullying.
ii. Information Technology Act, 2000 (also known as IT Act).
iii. a. Need to be careful while befriending unknown people on the internet.
b. Never share personal credentials like username and password with others.

12. Differentiate between the active digital footprint and passive digital footprints.
Ans. Active Digital Footprints: Active digital footprints include data that we intentionally submit online.
This would include emails we write, or responses or posts we make on different websites or mobile Apps,
etc.
Passive Digital Footprints: The digital data trail we leave online unintentionally is called passive digital
footprints. This includes the data generated when we visit a website, use a mobile App, browse Internet,
etc.

Some common mistakes students make when writing answers:


 Inadequate Understanding of Key Concepts
 Students may memorize definitions without understanding the underlying concepts, leading
to confusion when questions are framed in unfamiliar ways.
 Repeating the same points in multiple ways instead of covering the breadth of the topic.
 Lack of a clear structure in the answers, such as failing to categorize impacts into social,
economic, and environmental domains.
 Not using bullet points, subheadings, or diagrams where necessary.
 Writing lengthy paragraphs without focusing on clarity and conciseness.
 Instead of analyzing the options, students may rely on guessing, which leads to a lower
success rate, especially when distractors are close to the correct answer.
 Certain topics, like cyber ethics, intellectual property rights, and open-source vs
proprietary software, have overlapping ideas that can confuse students.
 Students may skim through questions and options, missing key terms like not, always, best,
or except, which change the meaning of the question.

51
MLL MATERIAL, CLASS XII INFORMATICS PRACTICES, KVS RO LUCKNOW

 Failing to include real-life examples (e.g., famous cases of data breaches, impactful
cyberbullying incidents, or well-known e-waste recycling initiatives).
 Questions that use case studies, examples, or hypothetical scenarios require analytical
thinking, which some students may struggle with.

52

You might also like