3. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 3 of 13
df=pd.DataFrame(t, index=[10,20,30,40,50,60])
print(df)
Output: -
rollno Name Age marks class
10 1 Krishna 15 70.4 11A
20 2 Pranshu 14 60.9 12B
30 3 Gurusha 14 80.3 11B
40 4 Arpit 15 87.5 12B
50 5 Rani 16 67.8 12B
60 6 Aurobindo 15 86.0 11B
1).Print (df. iloc [1])
2).Print(df[‘marks’].max ())
3).df. insert (loc=2, column=’fee’, values=[3200,3400,4500,3100,3200,4000])
4).df. drop (‘Age’, axis=1, inplace = True)
5).df. rename (columns={‘marks’:’Term1’}, inplace = True)
Q.23. click for codes to create table.
1). select * from HOTEL where Location = ‘London’;
2). select Hotel_Id, H_Name, Location, Room_Type, Price, Star from HOTEL where Price >
6000 order by Price;
3). select H_Name from HOTEL where H_Name like “%e”;
4). select count (distinct Room_type) from HOTEL;
5). select H_Name from HOTEL order by H_Name desc;
4. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 4 of 13
Q.24.
import pandas as pd
h= ['H','a','p','p','y']
s = pd.Series(data=h)
print(s[0:3])
Output: -
0 H
1 a
2 p
dtype: object
Q.25.(A). Erro: SQL is case sensitive language. In given command the starting with
uppercase and the continue with lower case cause the error.
Solution: select emp_name from emp where comm = NULL;
OR SELECT emp_name FROM emp WHERE comm = NULL;
In the solution, all the functions are in same case from starting to end except the table date
names.
(B). No, because WHERE clause specifies search conditions for the rows returned by the
Query and limits rows to a specific row-set. If a table has huge number of records and if
someone wants to get the particular records then using ‘where’ clause is useful. Whereas
GROUP BY clause summaries identical rows into a single/distinct group and returns a
single row with the summary for each group, by using appropriate Aggregate function in the
SELECT list, like COUNT(), SUM(), MIN(), MAX(), AVG(), etc.
Having clause is used to restrict the number of records returned by the Group by clause.
Q.26. The count (*) returns all rows whether column contains NULL value or not, while
count (<Column Name>) returns the number of rows except NULL valued row / rows.
E.g.: - >> create table school (St_name char (25), Class int (3), Attendance int (4));
5. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 5 of 13
>> select count (*) from school where Attendance < 45;
It will show all the name and classes which have attendance less than 45.
Q.27.
import pandas as pd
A=pd.Series([2,4,6], index = [0,1,2])
B=pd.Series([1,3,5], index = [1,2,3])
print(A)
print(B)
1).S = (A+B)
2).S = (A*B)
Q.28.
1).5.
2).Sun Cream 678
Beauty Cream 5400
Beauty Cream 1200
Q.29. (A).1). Substr (“Innovation”,3,4)
nova
2). ation
(B). 1). 3.
2).1.
6. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 6 of 13
Q.30.
import pandas as pd
stu = {'Admno':[1001,1002,1003,1004,1005],
'Firstname':['Amit','Rohit','Shyam','Manan','Raman'],
'Lastname':['Sehgal','Malik','Bhatia','Gupta','Bajaj'],
'Age':[18,17,18,16,18],
'Pretest':[87,89,90,79,922],
'Posttest':[67,78,84,69,70]}
d=pd.DataFrame(stu)
print(d)
1). d.loc[::-1].head()
2). g = {'Admno':1006, 'Firstname':'Sujal', 'Lastname':'Sharma', 'Age':17, 'Pretest':87,
'Posttest':89}
d = d.append(g,ignore_index=True)
print(d)
Q.31. VoIP stands for (Voice Over Internet Protocol) is the technology that converts your
voice into a digital signal, allowing you to make a call directly from a computer, VoIP phone, or
other data – driven devices. Examples of software / apps are: Skype, IMO, Instagram,
Facebook, etc.
Q.32.There is main health hazard that can occur due to excessive use of computer / smart
phone screes,
→ Physical health Effects:
1. Eyestrain,
2. Poor Posture,
3. Sleeping Problems,
4. Reduced Physical Activities.
7. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 7 of 13
→ Psychological Effects:
1. Isolation,
2. Depression,
3. Irritation,
4. Decrement in creativity thinking skills.
Q.33.
1. URL stands for Uniform Resource Locator,
2. It was invented with the development of www by Tim Berners – Lee.
3. A URL is a web address of a given unique resource on the web.
4. It is the mechanism used by browsers to retrieve any published resource on the web.
5. E.g.: - https://www.google.com . (Https://) – Protocol; (www.google.com) – Domain
name.
Q.34.
import pandas as pd
S1 = pd.Series(data=[2,3,1])
print(S1)
1).
0 8
1 27
2 1
dtype: int64
8. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 8 of 13
2).
0 6
1 9
2 3
dtype: int64
Q.35. (A). → For copyright: -
• It exists, without me doing anything to assert it, from the moment of creation.
• Unless explicitly assigned, or surrendered, it persists regardless of license chosen
for the software.
• It grants the creator very specific legal rights and remedies (although, these may
vary by jurisdiction).
• Most forms of copyright have a defined duration (usually life + 'n' years).
• In an open-source project, every contributor retains copyright in their own
contributions.
→For the License: -
• It is a legal document
• I have to explicitly choose, or create, the license. It does not apply automatically.
• It grants users of the software specific, and limited, rights.
• Unless stated in the License itself, or until it is revoked, it remains enforceable in
perpetuity.
(B). Intellectual property rights are the rights given to persons over the creations of
their minds. They usually give the creator an exclusive right over the use of his/her creation
for a certain period of time.
The protection of Intellectual Property Rights (IPR) is important for the economy and for
its further growth in areas such as research, innovation and employment. Effective IPR
enforcement is also essential to health and safety. ... For these reasons, IP rights are worth
protecting, both domestically and internationally.
9. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 9 of 13
Q.36. (A).import matplotlib.pyplot as plt
import numpy as np
plt.plot([1.0,2.0,3.0,4.0,5.0], [12,14,13,14.8,18.9])
plt.xlabel('Tests')
plt.ylabel('Marks Secured')
plt.show()
(B).import matplotlib. pyplot as pl
info = ['Gold', 'Silver', 'Bronze', 'Total']
Australia = [80,59,59,198]
pl.bar(info,Australia)
pl.title("AUSTRIALIA MEDAL PLOT")
pl.xlabel("Medals Won by Austraila")
pl.ylabel("Marks won")
pl.show()
*Questions for visually impaired:
(A). Data visualization is the graphical representation of information and data. By
using visual elements like charts, graphs, and maps, data visualization tools provide an
accessible way to see and understand trends, outliers, and patterns in data.
In the world of Big Data, data visualization tools and technologies are essential to analyze
massive amounts of information and make data-driven decisions.
Like matplotlib , Pandas, etc.
10. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 10 of 13
(B).1). Plot (): - The plot () function in pyplot module of matplotlib library is used to make
a 2D hexagonal binning plot of points x, y. Parameters: This method accept the following
parameters that are described below: x, y: These parameters are the horizontal and vertical
coordinates of the data points. x values are optional.
2). Show (): - The show () function in pyplot module of matplotlib library is used to display
all figures.
3). Savefig (): - Savefig () As the name suggests Savefig () method is used to save the figure
created after plotting data. The figure created can be saved to our local machines by using
this method.
Q.37. 1). select House, count(House)
-> from School
-> group by House
-> having count(House) >2;
2). select avg (Percentage) from School;
3). select min (Percentage) from School where Class = 10;
Q.38.(A).import pandas as pd
d = {'country':['Italy', 'Spain','Greece', 'France', 'Portugal'],
'population':[61,46,11,65,10],
'percent':[0.83,0.63,0.15,0.88,0.14]}
df1 = pd.DataFrame(d, index=['IT','ES','Gr','Fr','Po'])
print(df1)
Output: -
11. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 11 of 13
(B). 1).print(df1[df1.columns[0:2]])
2). print (df1[(df1[“population”]>40)])
3).df1.drop(df1.tail(2).index, inplace=True)
Q.39.(A). 1).select dayname(‘2000-07-05’);
2).select lcase(“e-mail-id”);
3).select length(“King”);
4).select substring (“King”,1,1);
5).select avg (marks) from class;
(B). 1).select substring (Itemname,1,3) from ITEM;
2).select monthname (Stockdate) from ITEM; //given
date is not correct format to use ‘monthname’ function. You have to change the format in
‘YYYY-MM-DD’ then you will able to get the correct output.
3).select sum (Price) from ITEM;
12. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 12 of 13
4).select avg (Price) from ITEM;
5).select round (Price,2) from ITEM;
Q.40. a).Star Topology.
b).Administrative Wing (W1), because at W1 all of the record will store and easy to
access in all conditions.
c). LAN, because it covers up to 10 kms’ of radius.
d).As per suggested layout separate repeaters need not to be installed as each
building or wing, will be having a hub that acts as repeater. One hub per wing is
enough.
e).School can use cloud-based applications for sharing any type of data, like: Google
drive, One Drive, AWS drive services, etc. to share their files and make it save for future
use.
*Questions for visually impaired:
(a). A network switch connects devices (such as computers, printers, wireless access points) in
a network to each other, and allows them to 'talk' by exchanging data packets. Switches
can be hardware devices that manage physical networks, as well as software-based virtual
devices.
(b). Bus Topology and Star Topology.
(c). A modulator-demodulator, or simply a modem, is a hardware device that converts data
from a digital format, intended for communication directly between devices with specialized
wiring, into one suitable for a transmission medium such as telephone lines or radio.
(d). A gateway is a network node used in telecommunications that connects two
networks with different transmission protocols together. Gateways serve as an entry and
13. Informatics Practices (New) Solution
CBSE – 2021 Compt., Improvement Examination
Page 13 of 13
exit point for a network as all data must pass through or communicate with the gateway prior
to being routed.
(e). Voice over Internet Protocol (VoIP), is a technology that allows you to make voice calls
using a broadband Internet connection instead of a regular (or analog) phone line.