/**/ Python & MySQL: January 2021

Wednesday, January 27, 2021

CLASS XII - NEW IP SAMPLE PAPER (SET - 2) - 2020-21

 CLASS XII

IP SAMPLE PAPER (065) (SET - 2)

SESSION - 2020-21

Max Marks: 70                                                                                                           Time: 3 Hrs.

General Instructions:

  1. This question paper contains two parts A and B. Each part is compulsory.
  2. Both Part A and Part B have choices.
  3. Part-A has 2 sections:
    1. Section – I is short answer questions, to be answered in one word or one line.
    2. Section – II has two case studies questions. Each case study has 4 case-based subparts. An examinee is to attempt any 4 out of the 5 subparts.
  4. Part – B is Descriptive Paper.
  5. Part – B has three sections:
    1. Section – I is short questions of 2 marks each in which two questions have internal options.
    2. Section – II is long answer questions of 3 marks each is which two questions have internal options.
    3. Section – III is very long questions of 5 marks each in which one question has internal option.

Part – A

Section – I

Attempt any 15 questions from 1 to 21


1

State whether True or False:

  1. Copyright is the right of the creator of creative/artistic work.
  2. Digital footprints is save ot make all one posts public on social media.

Ans

  1. True
  2. False

2

Fill in the blanks:

A ________ is a summarization tool for discrete or continuous data.

  1. Quartile
  2. Histogram
  3. Mean
  4. Median

 

Ans

Histogram

3

Write the output of the following SQL command.

SELECT MONTHNAME(‘2021-02-03’)

 

Ans

February

4

Which of the following is not a descriptive statics function?

  1. Count()
  2. Add()
  3. Sum()
  4. Max()

 

Ans

Add()


5

Given the following Series A1 and A2:

                 A1                                                                                A2

A             10

B             15

C             50

D             70

 

A             90

B             40

C             78

D             92

 

 

 

 

 

 



Write the command to find the sum of Series A1 and A2

 

1

Ans

print(A1 + A2)

6

Which argument must be set with plotting functions for legend() to display the legends?

  1. Data
  2. Label
  3. Name
  4. Sequence

Ans

Label

7

Unauthorized monitoring of other people’s communications is called _____________.

Ans

Eavesdropping

8

In a DataFrame, Axis = 0 represents the __________ elements.

Ans

Row

9

Which portion of the URL below records the directory or folder of the desired resource?

http://www.somestore.com/firstfloor/shoes.htm

  1. http
  2. firstfloor
  3. shoes.htm
  4. www.somestore.com

Ans

Firstfloor

10

The first page that you normally view at a web site is its:

  1. Home page
  2. Master page
  3. First Page
  4. Banner page

Ans

Home page

11

For Web pages where the information is changed frequently, for example, stock prices, weather information which out of the following options would you advise?

  1. Static web page
  2. Dynamic web page

Justify your answer.

Ans

Dynamic web page

12

Which of the following is not an aggregate function?

  1. Avg
  2. Sum
  3. With
  4. Min

Ans

With


13

Any fraudulent business practice that extracts money from an unsuspecting, ignorant person is called a _____________.

 

Ans

Scam

14

___________ is a popular data-science library of Python.

 

Ans

Pandas

15

Which amongst the following is not an example of browser?

  1. Firefo
  2. Avast
  3. Edge
  4. Chrome

Ans

Avast

16

Website store the browsing activity through _________.

 

Ans

Cookies

17

According to a survey, one of the major Asian country generates approximately about 2 million tones of electronic waste per year. Only 1.5% of the total e-waste gets recycled. Suggest a method to manage e-waste.

Ans

Buy environmentally friendly electronic

Donate used electronics to social programs

Reuse, refurbish electronics

Recycling e-waste

Any other for the correct answer to considered

18

To sort the rows of the result table, the __________ clause is specified.

 

Ans

ORDER BY

19

Write the SQL command that will display the current time and date.

 

Ans

SELECT NOW();

 

20

The address of location of the document on the world wide web is called its ________.

 

Ans

URL

 

21

The original code written by programmers for a software is known as ____________.

 

Ans

Source code


 

Section – II

Both the case study based questions (22 & 23) are compulsory. Attempt

any four sub parts from each question. Each sub question carries 1 mark.

22. Consider the following DataFrame df and answer any four questions from (i) to (v).

 

City

 

Maxtemp

 

Mintemp

 

Rainfall

 

Delhi

40

32

24.1

Bengaluru

31

25

36.2

Chennai

35

27

40.8

Mumbai

29

21

35.2

Kolkata

39

23

41.8

 

 

(i)Write down the command that will give the following output.

City                 Mumbai

Maxtemp         40

Mintemp          32

Rainfall            41.8

dtype: object

 

  1. print(df.max()
  2. print(df.max())
  3. print(df.max(axis=1))
  4. print(df.max, axis=1)

 

b. print(df.max())

(ii) Write down the command that will give the following output.

City                     DelhiBengaluruChennaiMumbaiKolkata

Maxtemp                                      174

Mintemp                                       128

Rainfall                                          178.1

dtype: object

 

  1. print(df.sum())
  2. print(df.sum(axis=1))
  3. print(df.add())
  4. print(df.sum()

print(df.sum())

(iii)

Which of the following command will display the column labels of the DataFrame?

  1. print(df.columns())
  2. print(df.column())
  3. print(df.columns)
  4. print(df.column)

Ans

c. print(df.columns

(iv)

Which of the following statements will give the exact number of values in each column of the dataframe?

  1. print(df.count())
  2. print(df.count(0))
  3. print(df.count)
  4. print(df.count(axis=’index’))

 

Choose the correct option:

  1. both (1) and (2)
  2. only (2)
  3. (1), (2) and (3)
  4. (1), (2) and (4)
  5.  

Ans

a. both (1) and (2)

(v)

Add a new column, the values of Moderate [55.6,45.8,33.7,67.2,65.3], to DataFrame. Identify the correct command.

  1. df.column = [55.6,45.8,33.7,67.2,65.3]
  2. df[‘Moderate’] = [55.6,45.8,33.7,67.2,65.3]
  3. df([‘Moderate] = [55.6,45.8,33.7,67.2,65.3])
  4. df.[‘Moderate] = [55.6,45.8,33.7,67.2,65.3]

 

Ans

b. df[‘Moderate] = [55.6,45.8,33.7,67.2,65.3]


23

Consider the table STUDENT given below:

RollNo

Name

Class

DOB

Gender

City

Marks

1

Anand

XI

6/6/97

M

Agra

430

2

Chetan

XII

7/5/94

M

Mumbai

460

3

Geet

XI

6/5/97

F

Agra

470

4

Preeti

XII

8/8/95

F

Mumbai

492

5

Saniyal

XII

8/10/95

M

Delhi

360

6

Maakhiy

XI

12/12/94

F

Dubai

256

7

Neha

X

8/12/95

F

Moscow

324

8

Nishant

X

12/6/95

M

Moscow

429

 

 

(i)

Write the command that will give the output:

Name

Anand

Chetan

Geet

Preeti

Ans

SELECT NAME FORM STUDENT WHERE CITY = ‘AGRA’ OR CITY = ‘MUMBAI’;

                                                                OR

SELECT NAME FROM STUDENT WHERE CITY IN(‘AGRA’, ‘MUMBAI’);

 

(ii)

Display the output of the following command?

SELECT * FROM STUDENT WHERE GENDER = ‘F’ ORDER BY MARKS;

Ans

 

RollNo

Name

Class

DOB

Gender

City

Marks

6

Maakhiy

XI

12/12/94

F

Dubai

256

7

Neha

X

8/12/95

F

Moscow

324

3

Geet

XI

6/5/97

F

Agra

470

4

Preeti

XII

8/8/95

F

Mumbai

492

 

 

(iii)

Prachi has given the following command to obtain the highest marks

 

SELECT MAX(MARKS) FROM STUDENT WHERE GROUP BY CLASS;

 

But she is not getting the desired result. Help her by writing the correct command.

Ans

SELECT CLASS,  MAX(MARKS) FROM STUDENT GROUP BY CLASS;

 

(iv)

State the command to display the average marks scored by students of each gender who are in class XI?

  1. SELECT GENDER, AVG(MARKS) FROM STUDENT WHERE CLASS =’XI’ GROUP BY GENDER;
  2. SELECT GENDER, AVG(MARKS) FROM STUDENT GROUP BY GENDER WHERE CLASS = ‘XI’;
  3. SELECT GENDER, AVG(MARKS) GROUP BY GENDER FROM STUDENT HAVING CLASS = ‘XI’;
  4. SELECT GENDER, AVG(MARKS) FROM STUDENT GROUP BY GENDER HAVING CLASS – ‘XI’;

 

Choose the correct option:

  1. Both (ii) and (iii)
  2. Both (ii) and (iv)
  3. Both (i) and (iii)
  4. Only (iii)

Ans

Both (ii) and (iv) – option b correct

(v)

Help Ritesh to write the command to display the name of the youngest student?

1

Ans

SELECT NAME, MAX(DOB) FROM STUDENT;

 


 

Part – B

Section – I

 

24

Write the output of the following code:

 

import numpy as np

array1 = np.array( [10,12,14,16,18,20,22] )

array2 = np.array( [10, 12, 15, 16, 12,20,12] )

a = (np.where(array1 = = array2))

print(array1[a])

2

Ans

[10, 12, 16, 20]

 


25

State any two differences between single row functions and multiple row functions.

OR

What is the difference between order by and group by clause when used along with the select statement? Explain with example

2

Ans

Differences between single row functions and multiple row function:

(i)                 Single row functions work on one row only whereas multiple row functions group rows.

(ii)               Single row functions return one output per row whereas multiple row functions return only one output for a specified group of rows.

 

OR

The order by clause is used to show the contents of a table/relation in a sorted manner with respect to the column mentioned after the order by clause. The contents of the column can be arranged in ascending or descending order.

 

The group by clause is used to group rows in a given column and then apply an aggregate function eg. Max(), min() etc. on the entire group.

26

Write a query to remove both leading and trailing x characters from string ‘xxxxBar Onexxxxx’

 

2

Ans

SELECT TRIM(BOTH ‘X’ FROM ‘XXXXBAR ONE XXXX’) ;

 

 

27

Consider the following Series object, S-amt

 

Table

350

Chair

200

Sofa

800

Stool

150

(i)                  Write the command which will display the name of the furniture having rent>250.

(ii)                Write the command to name of the series as Furniture.

 

2

Ans

(i) print (S_amt [S_amt > 250])

(ii) S_amt.name = ‘Furniture’

 

 

 

28

Shanya khanna is using a table Employee. It has the following columns:

                  Admno, Name, Agg, Stream

[Column Agg contains Aggregate marks]

She wants to display highest Agg obtained in each Stream.

She wrote the following statement:

SELECT STREAM, MAX(AGG) FROM EMPLOYEE ;

But she did not get the desired result. Rewrite the above query with necessary changes to help her get the desired output.

2

Ans

SELECT STREAM, MAX(AGG) FROM EMPLOYEE GROUP BY STREAM ;

 

29

Consider the following SQL string: “Preoccupied”

 

Write the commands to display:

  1. “occupied”
  2. “cup”

 

                                           OR

Considering the same string “Preoccupied”

Write the SQL command to display:

 

  1. The position of the substring ‘cup’ in the string “Preoccupied”
  2. The first 4 letters of the string

2

Ans

(a) SELECT SUBSTR(“PREOCCUPIED”, 4) ;

                     OR

SELECT SUBSTRING(“PREOCCUPIED”, 4) ;

                     OR

SELECT MID(“PREOCCUPIED”, 4) ;

                     OR

SELECT RIGHT(“PREOCCUPIED”, 8) ;

 

(b) SELECT SUBSTR(“PREOCCUPIED”, 6, 3) ;

OR

SELECT SUBSTRING (“PREOCCUPIED”, 6, 3) ;

OR

SELECT MID(“PREOCCUPIED”, 6, 3 );

 

OR

 

  1. SELECT INSTR (‘PREOCCUPIED’, ‘CUP’) ;
  2. SELECT LEFT (‘PREOCCUPIED’, 4) ;

 

 

30

Consider the following DataFrame, sales

 

Name

Product

Target

Sales

zoneA

Purv

Oven

56000

58000

zoneB

Paschim

AC

70000

68000

zoneC

Kendriya

AC

75000

78000

zoneD

Dakshin

Oven

60000

61000

 

Write commands to:

  1. Add new column ‘Percentage’ to the Dataframe.
  2. Add a new row with values ( Uttar, AC, 72000, 74000)

 

2

Ans

  1. sales[‘Percentage’] =[55.6, 72.5, 85.3, 55.6]
  2. sales.loc[zone] = [‘Uttar’, ‘AC’, 72000, 74000]

 

 

31

Expend the following terms related to Computer Networks:

  1. IRC
  2. SMTP
  3. BCC
  4. VoIP

 

 

2

Ans

  1. Internet Relay Chat
  2. Simple Mail Transfer Protocol
  3. Blind Carbon Copy
  4. Voice over Internet Protocol

 

32

List any two health hazards related to excessive use of Technology.

 

2

Ans

The continuous use of devices like Smartphoes, computer desktop, laptops, head phones etc. cause a lot of health hazards if not addressed. These are:

  1. Impact on bones and joints: wrong posture or long hours of sitting in an uncomfortable position can cause muscle or bone injury.
  2. Impact on hearing: using headphones or earphones for a prolonged time and on high volume can cause hearing problems and in severe cases hearing impairments.
  3. Impact on eyes: This is the most common form of health hazard as prolonged hours of screen time can lead to extreme strain in the eyes.
  4. Sleep problem: Bright light from computer devices block a hormone called melatonin which us sleep. Thus we can experience sleep disorders leading to short sleep cycles.

 

 

33

Nivedita has recently shifted to new city and new school. She does not know many people in her new city and school. But all of a sudden, someone is posting negative, demeaning comments on her social networking profile, school site’s forum etc.

She is also getting repeated mails from unknown people. Every time she goes online, she finds someone chasing her online.

  1. What is this happening to Nivedita?
  2. What action should she taken to stop them?

 

2

Ans

  1. Nivedita has become a victim of cyber bullying and cyber stalking.
  2. She must immediately bring it into the notice of her parents and school authorities. And she must report this cyber crime to local police with the help of her parents.

 

 

 

Section – II

 

34

Consider two objects x and y. x is a list whereas y is a Series. Both have values 20, 40, 90, 110.

What will be the output of the following two statements considering that the above objects have been created already.

  1. print (x * 2)
  2. print (y * 2)

 

3

Ans

  1. will give the output as

[20, 40, 90, 110, 20, 40, 90, 110]

 

  1. 0           40

1           80

2          180

3          220

 

 

35

Describe the following security issue and suggest a way of protecting against it.

  1. Pharming
  2. Phishing
  3. Spyware

 

OR

What do you understand by Net Etiquettes? Explain any two such etiquettes.

 

 

3

Ans

 

Security Issue

Description of Security Issue

Method of Protection

Pharming

It is actually a code installed on the hard drive of a user’s computer or on actual web server ; code redirects user to a bogus/fake website without user knowing.

Use filter to authenticate website

User should be alert and look for pharming clues which indicate being directed to a bogus site.

Phishing

In phishing, creator sends legitimate-looking (fake) email in the hope of gaining personal/financial information ; fake email replicates a well known company e.g., a bank.

ISPs can filter/block out phishing emails.

User should be aware of opening links in emails.

Spyware

It is a type of software that gathers information by monitoring key presses on a user’s keyboard or activity and relays the information back to person who sent the spyware

Use down boxes.

User should be alert and look for clues when using their computers.

 

OR

Net Ettiquets refers to the proper manners and behavior we need to exhibit while being online.

These include:

  1. No copyright violation: we should not use copyrighted materials without the permission of the creator or owner. We should give proper credit to owner/creators of open source content when using them.
  2. Avoid cyber bulling: Avoid any insulting, degrading or intimidating online behavior like repeated posting of rumours, giving threats online, posting the victim’s personal information, or comment aimed to publicly ridicule a victim.

 

Or any other relevant answer.

 

 

36. Write a code to plot the speed of a passenger train as shown in the figure given below:    3



                                                                        OR


Draw the following bar graph representing the number of students in each class.




Ans

import matplotlib.pyplot as plt

import numpy as np

x = np.arange(1, 5)

plt.plot( x, x* 1.5, label = ‘Normal’)

plt.plot( x, x* 3.0, label = ‘Fast’)

plt.plot( x, x/3.0, label = ‘Slow’)

plt.legend()

plt.show()

 

OR

 

import matplotlib.pyplot as plt

Classes = [‘VII’, ‘VIII’, ‘IX’, ‘X’]

Students = [40, 45, 35, 44]

plt.bar(Classes, Students)

plt.show()

 

37

 

Consider the following table ‘GAMES’.

Table : GAMES

GCode

GameName

Type

Number

PrizeMoney

ScheduleDate

101

Carrom Board

Indoor

2

5000

23-Jan-2004

102

Badminton

Outdoor

2

12000

12-Dec-2003

103

Table Tennis

Indoor

4

8000

14-Feb-2004

105

Chess

Indoor

2

9000

01-Jan-2004

108

Lawn Tennis

Outdoor

4

25000

10-Mar-2004

 

Write SQL commands to:

  1. To display the name of all GAMES with their GCodes.
  2. To display the content of the GAMES table in ascending order of ScheduleDate.
  3. To display sum of PrizeMoney for each type of GAMES.

 

3

Ans

  1. SELECT GAMENAME, GCODE FROM GAMES ;
  2. SELECT *  FROM GAMES ORDER BY SCHEDULEDATE ;
  3. SELECT SUM(PRIZEMONEY), TYPE FROM GAMES GROUP BY TYPE ;

 

 

 

 

Section – III

 

38

Write a program in Python Pandas to create the following DataFrame batsman from a Dictionary:

B_No

Name

Score1

Score2

Score3

1

Sachin Tendulkar

90

80

75

2

MS Dhoni

70

85

95

3

Rishabh Pant

65

56

78

4

Hardik Pandya

55

78

67

 

Perform the following operations on the DataFrame:

  1. Add all the scores of a batsman and assign to column “Total”.
  2. Display the highest score in Score1, Score2 and Score3 of the DataFrame.
  3. Display the DataFrame.

 

5

Ans

import pandas as pd

d1 = {B_No’ : [‘Sachin Tendulkar’, ‘MS Dhoni’, ‘Rishabh Pant’, Hardik Pandya’],

          ‘Score1’ : [90, 70, 65, 55],

           ‘Score2’ : [80, 85, 56, 78],

            ‘Score3’ : [75, 95, 78, 67] }

 

df = pd. DataFrame(d1)

print(df)

df[‘Total’] = df[‘Score1] + df[‘Score2’] + df[‘Score3]

 

print (“Maximum Scores are:”, max(df[‘Score1’], max(df[‘Score2’, max(df[‘Score3] ) )

 

 

39

Write the SQL functions which will perform the following operations:

  1. To display the name of the month of the current date.
  2. To remove spaces from the beginning and end of a string.  “                Panorama     “.
  3. To display the name of the day eg. Friday or Saturday from your date of birth, dob.
  4. To display the starting position of your first name(fname) from your whole name(name).
  5. To compute the remainder of division between two numbers, n1 and n2.

OR

 

In a Database Company, there are two tables given below:

                                 Table:SALES                                                                            Table: LOCATION

SALESMANID

NAME

SALES

LOCATION

 

LOCATIONID

LOCATIONNAME

S1

ANITA SINGH ARORA

250000

102

101

Delhi

S2

Y P SINGH

1300000

101

102

Mumbai

S3

TINA JAISWAL

1400000

103

103

Kolkata

S4

GURDEEP SINGH

1250000

102

104

Chennai

S5

SIMI FAIZAL

1450000

103

 

 

Write SQL queries for the following:

  1. To dispay SalesmanID, names of salesman, LocationID with corresponding location names.
  2. To display names of salesman, sales and corresponding location names who have achieved Sales more than 1300000.
  3. To display names of those salesman who have ‘SINGH’ in their names.
  4. Identify Primary key in the table SALES. Give reason for your choice.
  5. Write SQL command to change the LocationID to 104 of the Salesman with ID as S3 in the table ‘SALES’.

 

Ans:

  1. SELECT MONTHNAME(DATE(NOW())
  2. TRIM (“          Panaroma         “)
  3. DAYNAME(DATE(DOB))
  4. INSTR(NAME, FNAME)
  5. MOD(N1,N2)

 

OR

  1. SELECT SALESMANID, NAME, LOCATIONID, LOCATIONNAME FROM SALES S, LOCATION L WHERE S.LOCATIONID = L.LOCATIONID ;
  2. SELECT NAME, SALES, LOCATIONNAME FROM SALES S, LOCATION L WHERE S. LOCATIONID = L.LOCATIONID AND SALES >1300000 ;
  3. SELECT NAME FROM SALES WHERE NAME LIKE ‘%SINGH%’ ;
  4. Primary key : SALESMANID

Reason: It uniquely identifies all Rows in the table and does not contain empty/zero or null values.

  1. UPDATE SALES SET LOCATIONID = 104 WHERE SALESMANID = ‘S3’ ;

 

40. A company in Mega Enterprises has 4 wings of buildings as shown in the diagram:              5


Center to center distances between various Buildings:

W3 to W1 – 50 m

W1 to W2 – 60 m

W2 to W4 – 25 m

W4 to W3 – 170 m

W3 to W2 – 125 m

W1 to W4 – 90 m

Number of computers in each of the wings:

W1 – 150

W2 – 15

W3 – 15

W4 – 25

Computers in each wing are networked but wings are not networked. The company has now decided to connect the wings also.

i.                     Suggest a most suitable cable layout for the above connections.

ii.                   Suggest the most appropriate topology of the connection between the wings.

iii.                  The company wants internet accessibility I all the wings. Suggest a suitable technology.

iv.                 Suggest the placement of the following devices with justification if the company wants minimized network traffic

a.       Repeater

b.      Hub/Switch

v.                   The company is planning to link its head office situated in New Delhi with the office in hilly areas. Suggest a way to connect it economically.




Ans

i.                    Most suitable layout according the distance is:



 

 

 

 

 

 

 

 

 


ii.                  Star Topology

iii.                Broadband

iv.                 a. Not required, Repeaters may be skipped as per above layout (because distance is less than 100 m)

b.  In every wings

 

v.  Radio Waves

 

 

 

 

 




 

5


CLASS XI HALF YEARLY QP WTH MS 2024

  Half Yearly Examination: 2024-25 Informatics Practices (065) Class- XI       Time Allowed: 3hrs                                     ...