6205solved Ip CL Xii 2020
6205solved Ip CL Xii 2020
CLASS – XII
SUBJECT: INFORMATICS PRACTICES (065)
PART A
SECTION – I
1 State whether True or False
Attempt : questions from questions 1 to 21
any 15
S1 S2
A 10 A 80
B 40 B 20
C 34 C 74
D 60 D 90
Write the command to find the sum of series S1 and S2
print(S1+S2)
6 Using Python Matplotlib can be used to count how many 1
values fall into each interval
a. line plot b. bar graph c. histogram
Page 1 of 11
7 To prevent unauthorized access to and / or from the network, a system 1
known as Firewall , can be implemented by hardware and / or
software.
19 Write the SQL command that will display the current system date 1
CURDATE()
20 SWITCH network device is known as an intelligent hub. 1
Page 2 of 11
PART A SECTION – II
22 (i) Explain dataframe. Can it be considered as 1D Array or 2D Array? 1
Dataframe is a 2-Dimensional Array with heterogeneous data usually represented in a
tabular format. It can be considered as 2D Array.
(ii) Explain Matplotlib. 1
Matplotlib is a Python 2D plotting library which produces publication quality
figures/charts in a variety of hard copy formats and interactive environments
across platforms
(iii) Give the output for following statement: 1
a = pd.DataFrame([1, 1, 1, np.nan], index=['a', 'b', 'c', 'd'],columns=['one'])
one
a 1.0
b 1.0
c 1.0
d NaN
(iv) Give the output for following statement: 1
import pandas as pd
data = [1,2,3,4,5]
df = pd.DataFrame(data)
print(df)
0
0 1
1 2
2 3
3 4
4 5
(v) Consider given data: 1
Marks
Term1 45
Term2 65
Term3 24
Term4 89
Write a program in Python Pandas to create the series named as M1.
Import pandas as pd
Marks=[45,65,24,89]
M1=pd.Series(Marks, index=["Term1", "Term2","Term3","Term4"])
print(" Marks")
print(M1)
Page 3 of 11
23 Write SQL commands and output for the following on table SPORTS:
StudentNo Class Name Game1 Grade1 Game2 Grade2
10 7 Sameer Cricket B Swimming A
11 8 Sujit Tennis A Skating C
12 7 Kamal Swimming B Football B
13 7 Veena Tennis C Tennis A
14 9 Archana Basketball A Cricket A
15 10 Arpit Cricket A Athletics C
(i) Display the names of the students who have grade ‘A’ in either Game1 1
or Game2 or both.
(ii) Display the games taken by the students whose name starts with ‘A’. 1
Give the output of the following SQL Statements
(iii) SELECT DISTINCT Class FROM SPORTS; 1
(iv) SELECT MAX(Class) FROM SPORTS; 1
(v) SELECT COUNT(*) FROM SPORTS GROUP BY Game1; 1
(i) Select name from SPORTS where Grade1=’A’ OR Grade2=’A’;
(ii) Select Game1,Game2 from SPORTS where Name LIKE ‘A%’;
(iii) 7 8 9 10
(iii) 10 (v) 2 2 1 1
PART – B
SECTION – I
24 Write two points of difference between series data structure and 2
DataFrame data structure?
A series is a one-dimensional object that can hold homogeneous data of
any type such as integers, floats and strings.It has only one axis.
Data mutable but size immutable
A dataframe is a two-dimensional object that can hold hetrogeneous data
types. Individual columns of a dataframe can act as a separate series
object.. Data and size mutable
25 What is meant by data aggregation in Pandas? 2
Aggregation is the process of turning the values of a dataset (or a subset of
it) into one single value or, we can say, data aggregation is a multi-value
function which requires multiple values and returns a
single value as a result. There are a number of aggregations possible in
Pandas like count(), sum(), min(),max(), median(), quartile() etc.
df.reindex([2,1, 0,4,3])
df.reindex(columns=['name','runsscored','age'])
df1.rename(index={0:'zero',1:'one'})
df1.rename(columns={“Marks1”:'A',”Marks2”:'B'})
Page 4 of 11
27 Write the name of any four types of plots and four methods offered by 2
matplotlib.pyplot
Matplotlib offers several types of plots:- Line Graph, Bar graph Histogram,
Scatter Plot, Area Plot Pie Chart
Various methods used with pyplot:- plot() show() title() xlabel() ylabel()
explode() bar() hist() box plot() scatter()
28 Giving suitable example of each explain following methods: 2
read_csv() (ii) to_csv()
To read from CSV file and create dataframe and write dataframe in CSV file
respectively. df= pd.read_csv(“ABC.CSV”)
df.to_csv(“TRY.CSV”)
import pandas as pd
data = {'Day':[1,2,3,4,5,6],
"Visitors":[1000,700,6000,1000,400,350],
'Bounce_Rate':[25,30,23,27,23,34]}
df = pd.DataFrame(data)
print (df.T)
df.at[7,"Visitors"]=1500
df.iat[3,2]=37
print(df)
print (df.ndim)
print (df.shape)
OR
Give the output for the following code.
import pandas as pd
data = [{'a': 1, 'b': 2},{'a': 5, 'b': 10, 'c': 20}]
#With two column indices, values same as dictionary key
df1 = pd.DataFrame(data, index=['first', 'second'],columns=['a', 'b'])
#With two column indices with one index with other name
df2 = pd.DataFrame(data, index=['first', 'second'], columns=['a', 'b1'])
print(df1)
print(df2)
Page 5 of 11
0 1 2 3 4 5
Day 1 2 3 4 5 6
Visitors 1000 700 6000 1000 400 350
Bounce_Rate 25 30 23 27 23 34
2
(7, 3)
OR
a b
first 1 2
second 5 10
a b1
first 1 NaN
second 5 NaN
30 Write the code in pandas to create the following dataframes : 3
df1 df2
mark1 mark2 mark1 mark2
0 10 1 50 0 30 20
1 40 451 1 20 25
2 15 302 2 20 30
3 40 703 3 50 30
Also write the commands to do the following operations on the dataframes
given above :
(ii) To subtract df2 from df1
(ii) To change index label of df1 from 0 to zero and from 1 to one
print(df1-df2)
df1.rename(index={0:'zero',1:'one'})
31 The function returns its argument with a modified shape, 2
whereas the method modifies the array itself.
(i) reshape,resize
(ii) resize,reshape
(iii) reshape2,resize
(iv) all of the Mentioned
reshape,resize
Page 6 of 11
32 Write a Python program to display a bar chart of the popularity of 2
programming Languages
Data:
Programming languages: Java, Python, PHP, JavaScript, C#, C++
Popularity: 22.2, 17.6, 8.8, 8, 7.7, 6.7
import matplotlib.pyplot as plt
proglang = ['Java', 'Python', 'PHP', 'JavaScript', 'C#', 'C++']
popularity = [22.2, 17.6, 8.8, 8, 7.7, 6.7]
plt.bar( proglang, popularity, color='blue')
plt.xlabel("Languages")
plt.ylabel("Popularity")
plt.title("Popularity of Programming Language\nWorldwide, Oct 2017
compared to a year ago")
# Turn on the grid
plt.minorticks_on()
plt.grid(which='major', linestyle='-', linewidth='0.5', color='red')
# Customize the minor grid
plt.grid(which='minor', linestyle=':', linewidth='0.5', color='black')
plt.show()
PART B
SECTION – II
33 Giving suitable example of each explain the use of following functions in 4
MySQL :
(i) MOD() (ii) INSTR() (vii) DATE() (viii) SIGN()
To find remainder MOD(7,2) will give output 1
To find location INSTR(“CORPORATE FLOOR”,”OR”) 2
To extract date part DATE(“2020-12-15 11:15:16”) 2020-12-15
To check a number is negative positive or zero SIGN(-45) -1
Page 7 of 11
Single row functions perform on individual rows or records and returns the
answer either as integer or string. For example, ucase(),mid(), length()
and trim() etc. On the other hand, multiple row functions perform on a
range of values and always return the result as a numeric value or
number. For example, Aggregate functions like sum(), count(), max(),
min() & avg() etc.
37 Compare Having clause and Order by clause? 1
Having clause is used with group by clause in MySQL. It is
used to provide condition based on grouped data. On the other hand, order
by clause is an independent clause used to arrange records of a table in
either ascending or descending order on the basis of one or more columns.
39 Reena created a table named student, she wants to see those students whose name 1
ending with ‘p’ She wrote a query-
SELECT * FROM student WHERE name=”p%”;
Help Reena to run the query by removing the errors from the query and rewriting it.
Select * from student where name like “%p”;
40 Sanjeev is not able to reduce the salary of employee. Which constraint has he used 1
while creating table?
Check constraint CHECK SAL>50000
PART B
SECTION – III
Page 8 of 11
41 (i) Mention any one point of similarity between shareware and freeware 1
software.
Similarity- Source code is not available in both.
OR
Define the term network topology?
Pattern of interconnecting nodes in a network. Eg. STAR, RING,BUS
topology
(ii) 2
Expand the terms: (i) SMTP (ii) DNS
(i) Simple Mail Transfer Protocol (ii) Domain Name System/Service
(iii)
The IIBM has to set up its new branch at Manipur for its office and web based 2
activities. It has four wings of buildings having number of computers shown in
the table:
Number of Computers in various blocks:
Wing X 50
Wing Z 130
Wing Y 40
Wing U 15
(i) Suggest the most suitable place (i.e. Wing) to house the server of this
organization with a suitable justification.
(ii) Suggest the placement (i.e. Wing) of the Hub/Switch with justification.
(i) Wing Z because maximum number of computers
(ii) Hub/Switch should be placed in Each Wing to connect computers in
that wing
42(i) Leaking your company data to the outside network without prior permission 1
of senior authority is a crime true or false.
(i) True
(ii) False
(ii) What types of data are stolen by cyber-criminals in most of the cases? 1
(i) Data that will pay once sold
(ii) Data that has no value
(iii) Data like username and passwords only
(iv) Data that is old
(iii) Write the appropriate usage of social networks. 1
OR
What are the different way in which authentication of a person can be
performed?.
Page 9 of 11
A social networking service (also known as social networking site, or SNS
or social media) is an online platform which people use to build social
networks or social relationships with other people who share similar
personal or career interests, activities, backgrounds or real- life
connections
OR
Password, User ID, Biometric etc.
(iv) Reena has recently shifted to a new city and new college. She does not 2
know many people in her new city and college. But all of a sudden,
someone starts posting negative, demeaning comments on her social
networking profile, college site’s forum, etc. She is also getting repeated
mails from unknown people. Every time she goes online, she finds
someone chasing her online.
(i) What is happening to Reena?
(ii) What action should she take to stop them?
OR
Write any two relevant methods of e-waste management?
(i) Reena has become a victim of cyber bullying and cyber stalking.
(ii) She must immediately bring it to the notice of her parents and college
authorities and report this cyber crime to local police with the help of her
parents.
OR
Recycle, Resale, Use environment friendly devices etc.
43 Write commands in SQL for (i) to (iii) and output for (iv) and (v). 5
Table : Store
+---------+----------------+----------------+--------+---------+------------+---------+---------
| StoreId | Name | Location | City | NoOfEmp |DateOpen |SalesAmt
+---------+----------------+----------------+--------+---------+------------+----------+------+
| S101 | Planet Fashion | Bandra | Mumbai | 7 | 2015-10-16 | 40000
| S102 | Vogue | Karol Bagh | Delhi | 8 | 2015-07-14 |12000
| S103 | Trends | Powai | Mumbai | 10 | 2015-06-24 |30000
| S104 | SuperFashion | Thane | Mumbai | 11 | 2015-02-06 | 45000
| S105 | Annabelle | South Extn. | Delhi | 8 | 2015-04-09 |60000
| S106 | Rage | Defence Colony | Delhi | 5 | 2015-03-01 |20000
+---------+----------------+----------------+--------+---------+------------+----------+-----+
(i) To display names of stores along with SalesAmount of those stores that
have ‘u’ as second charater and ‘fashion’ anywhere in their store names.
(ii) To display Stores names, Location and DateOfOpen of stores that
were opened before 1st March, 2015.
(iii) To display the City and the number of stores located in that City, only if
number of stores is more than 2.
(iv) Select Min(DateOpen) from Store;
(v) Select Count(Distinct City) As “City Count” From Store;
Page 10 of 11
(i) Select Name,SaleAmt from Store where Name like “_u%Fashion%”;
Select Name,SaleAmt from Store where Name like “_u” and name like
“% Fashion%”;
Page 11 of 11