SAMPLE PAPER-2
TIME: - 3 Hours MAX. MARKS – 70
General Instructions:
All questions are compulsory.
The examination paper contains five sections, from Section A to Section E.
Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
Section C consists of 4 questions (29 to 32). Each question carries 3 Marks.
Section D consists of 2 questions (33 to 34). Each question carries 4 Marks.
Section E consists of 3 questions (35 to 37). Each question carries 5 Marks.
There is no overall choice. However, internal choices have been provided in some questions. Attempt only
one of the choices in such questions.
All programming questions are to be answered using Python Language
Section-A (21 x 1 = 21 Marks)
1. State whether the following statement is True or False:
The tail() function in Pandas is used to display the first few rows of a Series or Data Frame.
2. What will be the result of the following SQL Query?
SELECT LENGTH (‘IP Exam 2025’);
(A) 11 (B) 12
(C) 13 (D) 10ss
3. A student, Rohan, finds that his classmate has been posting embarrassing photos and spreading
false rumors about him on a social media group. This has caused Rohan significant distress.
Which type of cybercrime does this situation represent?
(A)Phishing (B) Hacking
(C) Cyberbullying (D) Plagiarism
4. Which of the following Python statements is used to read data from a CSV file named
‘[Link]’ into a Pandas DataFrame df?
(A) df = pd.read_csv(‘[Link]’) (B) df = pd.load_csv(‘[Link]’)
(C) df = pd.import_csv(‘[Link]’) (D) df = pd.open_csv(‘[Link]’)
5. Which network device operates at the network layer to connect different networks and
forward packets between them based on their destination IP addresses?
(A)Hub (B) Switch
(C) Repeater (D) Router
6. What is the purpose of the UCASE() function in SQL?
(A)It converts a string to all lowercase letters.
(B) It capitalizes the first letter of a string.
(C) It removes extra spaces from a string.
(D) It converts a string to all uppercase letters.
7. A technology company has developed a unique logo and brand name to distinguish
its products from competitors. Which type of Intellectual Property Right should it use
to protect its logo and brand name?
(A)Patent (B) Copyright
(C) Trademark (D) FOSS
8. Which of the following statements is true about a Pandas Series?
(A)It is a two-dimensional data structure.
(B) It can store data of multiple different types.
(C) It is a one-dimensional labeled array.
(D) Its size cannot be changed once created.
9. In the context of relational databases, what does the term ‘degree’ refer to?
(A)The number of rows in a table.
(B) The number of tables in a database.
(C) The number of columns in a table.
(D) The number of primary keys in a table.
10. Which of the following network topologies connects all devices to a central node, such as a
switch or a hub?
(A)Bus Topology (B) Star Topology
(C) Ring Topology (D) Mesh Topology
11. Which of the following SQL functions is used to find the average value in a numeric column?
(A)SUM() (B) COUNT()
(C) AVG() (D) MIN()
12. When performing a mathematical operation like addition between two Pandas Series
with non-aligned indices, what happens to the indices that do not overlap?
(A) An error is raised.
(B) The operation is only performed on common indices.
(C) The result contains NaN for non-overlapping indices.
(D) The indices of the second Series are ignored.
13. Leaving a trail of data about yourself online through activities like social media posts,
browsing history, and online shopping is known as creating a:
(A) Digital Copyright (B) Digital Footprint
(C) Cyber Profile (D) E-waste trail
[Link] SQL clause is used to filter the results of a query based on a specified condition?
(A)ORDER BY (B) GROUP BY
(C) HAVING (D) WHERE
[Link] of the following Python commands correctly selects the row at integer position 0
and the column at integer position 1 of a DataFrame df?
(A) [Link][0, 1] (B) [Link][1, 0]
(C) [Link][1, 0] (D) [Link][0, 1]
[Link] is the primary function of a web browser?
(A)To host a website on a server.
(B) To send and receive emails.
(C) To retrieve and display content from the World Wide Web.
(D)To create and edit web pages.
17. What is the use of the TRIM() function in SQL?
(A)It removes only leading spaces from a string.
(B)It removes only trailing spaces from a string.
(C)It removes both leading and trailing spaces from a string.
(D) It converts a string to title case.
18. Given a Python dictionary D = {‘a’: 10, ‘b’: 20}, which command creates a Pandas Series
from it? (Assume pandas is imported as pd)
(A) [Link].from_dict(D) (B) [Link](D)
(C) [Link] (D) (D) pd.create_series(D)
[Link] of the following plots is most suitable for visualizing the frequency distribution of
a continuous variable?
(A) Line Plot (B) Bar Graph
(C) Histogram (D) Scatter Plot
Direction: For questions 20 and 21, two statements are given: one labeled Assertion (A) and the
other labeled Reason (R). Choose the correct option.
(A) Both A and R are true and R is the correct explanation for A
(B) Both A and R are true and R is not the correct explanation for A
(C) A is True but R is False
(D) A is false but R is True
20. Assertion (A): Matplotlib is a powerful library for data visualization in Python.
Reason (R): Matplotlib is a built-in part of the Pandas library and cannot be used without first
creating a DataFrame.
21. Assertion (A): The ALTER TABLE command in SQL is a Data Definition Language
(DDL) command. Reason (R): DDL commands are used to define and manage the structure
of database objects, such as tables.
Section-B (7X2 = 14 Marks)
[Link] are some factors that have contributed to the rise of cybercrimes?
[Link] is the purpose of ORDER BY clause in SQL? Explain with the help of suitable example.
[Link] observe the following code: import pandas as pd
One={‘P’:5000,‘Q’:8000,‘R’:12000,‘S’: 18000}
Two={‘A’:13000, ‘B’:14000, ‘C’:12000}
totSales={1:One, 2:Two} df=[Link](totSales)
print(df)
Answer the following:
(i) List the index of the DataFrame df
(ii)List the column names of DataFrame df.
[Link] some benefits of networking. Name any two components required for networking.
Or
Give an example of each static web page and dynamic web page.
26. The Python code written below has syntactical errors. Rewrite the correct code and
underline the corrections made.
Import pandas as pd
Emp = {‘a’ : 10000, ‘b’ : 15000,‘c’ : 12000}
Sr = [Link](Emp)
Print(sr)
27. A character expression name contains ‘try yourself’. Write a command to pick the following
set of characters from it.
(i) First 3 characters
(ii)From 3rd to 7th character
28. Complete the given Python code to get the required output as: 16
import as np
data = [1, 4, 9, 16]
series_data = np. (data)
print(series_data[ ])
Section-C (4X3 = 12 Marks)
[Link] the table EXAM given below. Write the queries for (i) to (iii).
Table : EXAM
S. No. Name Stip-end Subject Average Division
1 Karan 400 English 68 Ist
2 Aman 680 Mathematics 72 Ist
3 Javed 500 Accounts 67 Ist
4 Bishakh 200 Informatics 55 IInd
5 Sugandha 400 History 35 IIIrd
6 Suparna 550 Geography 45 IIIrd
(i) To list the names of those students, who have obtained division as Ist in ascending order of
Name.
(ii) To count the number of students, who have either Accounts or Informatics as Subject.
(iii) To display a report listing Name, Subject and annual Stipend received assuming that the
Stipend column has monthly stipend
Or
Reena is working with functions of MySQL.
Explain her following
(i) What is the purpose of NOW( ) function?
(ii)How many parameters does it accept?
(iii)What is the general format of its return type?
[Link] a DataFrame df as shown below
A B C
0 21 12 69
1 45 45 84
2 23 86 70
3 17 33 78
What will be the result of the following code statements?
(i) df[‘D’] = [Link]
(ii) df[‘D’] = [23, 41, 32]
(iii) df[‘D’] = [23, 41, 32, 9]
[Link] the output of following commands.
(i) mysql>SELECT TRUNCATE (200.91,1);
(ii)mysql>SELECT LEFT (‘Swati’, 4);
(iii)mysql>SELECT LENGTH(“Information”);
[Link] has recently shifted to a new college and hostel. He does not know many people in
his
new college and hostel. But all of a sudden, someone is posting negative, demeaning
comments
on his social networking profile etc.
He is also getting repeated mails from unknown people. Every time he goes online, he finds
someone chasing him online.
(i)What is this happening to Rahul?
(ii)What immediate action should he take to handle it?
(iii)Is there any law in India to handle such issues? Discuss briefly.
Or
What is software licensing? Name two types of software licensing with an example of each.
Section-D (2X4 = 8 Marks)
[Link]. Ankit is working in an organisation as data analyst. He uses Python Pandas and
Matplotlib for the same. He got a dataset of the passengers for the year 2010 to 2012 for
January, March and December. His manager wants certain information from him, but he is
facing some problems.
Help him by answering few questions given below:
Year Month Passengers
0 2010 Jan 25
1 2010 Mar 50
2 2012 Jan 35
3 2010 Dec 55
4 2012 Dec 65
(i)What will be the output of the following statements?
(a)[Link]( )
(b)[Link]=[“AirIndia”, “Indi go”, “Spicejet”, “Jet”, “Emirates”]
(ii)Write the code to get the following output:
Month Passengers
0 Jan 25
2 Jan 35
(iii)Predict the output of print (df[1 : 3])
or (Option for part (iii) only)
Suppose a DataFrame df contains information about student having columns rollno, name,
class and section. Write the code to transpose DataFrame.
34. Tejasvi Sethi, a car dealer has stored the details of all cars in her showroom in a table
CARMARKET. The table CARMARKET has attributes CARCODE which is a primary key,
CARNAME, COMPANY COLOR, COST (in lakh) of the car and DOM which is the
Date
of Manufacture of the car.
Table : CARMARKET
CARC-ODE CARNAME COMPANY COLOR COST DOM
C01 BALENO SUZUKI BLUE 5.90 2019-11-07
C02 INDIGO TATA SILVER 12.90 2020-10-15
C03 GLC MERCEDES WHITE 62.38 2020-01-20
C04 A6 AUDI RED 58.55 2018-12-29
C05 INNOVA TOYOTA BLACK 32.82 2017-11-10
C06 WAGON-R SUZUKI WHITE 12.11 2016-11-11
C07 BREZZA SUZUKI GOLDEN 9.80 2016-10-03
Help her by writing answers of the following questions based on the given table.
(i) Display the carname along with the charges rounded off to 1 digit after decimal place.
(ii) Display the carname, name of the company in lower case of all cars whose year (of dom)
is 2020.
(iii) Display the number of cars manufactured each year.
(iv) Display the carname, color and position of the character ‘E’ in the color of all the cars.
Section-E (3X5 = 15 Marks)
[Link] Valley Public School has 4 buildings in its campus. Distance between the buildings
and the number of computers in each is given below
Building Number of
Computers
A 150
B 10
C 25
D 3
Building Distance
A-B 10 m
A-C 1250 m
A-D 25 m
B-C 30 m
B-D 2000 m
(i) Which building is best suitable for placement of server?
(ii) If building A to D is to be connected, which device will be required for strong signals?
(iii) Which building would need a switch/hub?
(iv) Which topology would you suggest for connecting computers in each building?
(v) Suggest and draw cable layout to efficiently connect various buildings within the
school campus for a wired connectivity.
36. Write down the syntax format of the following functions, with one example of each.
(i) LCASE(str)
(ii) UCASE(str)
(iii) RIGHT(str,n)
(iv)POWER(m,n)
(v) RTRIM(str)
or
Consider the table DOCTOR given below. Write commands in SQL for (i) to (iv) and
answer the question for (v).
Table : DOCTOR
ID DOCName Department DOJ Gender Salary
1 Amit Kumar Orthopaedics 1993-02-12 M 35000
2 Anita Hans Paediatrics 1998-10-16 F 30000
3 Sunita Maini Gynaecology 1991-08-23 F 40000
4 Joe Thomas Surgery 1994-10-20 M 55000
5 Gurpreet Kaur Paediatrics 1999-11-24 F 52000
6 Anandini Burman Oncology 1994-03-16 F 31000
7 Siddharth Dang Surgery 1995-09-08 M 47000
8 Rama Mukherjee Oncology 2000-06-27 F 54500
(i) Display the names and salaries of doctors in descending order of salaries.
(ii) Display names of each department along with total salary being given to doctors of
that department.
(iii) Display the number of doctors in each department.
(iv) To display all the female doctors from the given data.
(v) Identify the primary key from the table DOCTOR.
37. A bar graph is used to show individual figures at a specific time or to compare different
items. Similarly, a bar graph which is showing the marks of different subjects. You have to
write the code that will represent the given graph.
Write a Python code to create a line graph for the data given below based on Games apps
rated by the users. Games = [“Subway Surfer”, “Temple Run”, “CandyCrush”, “Bottle
Shot”, “Runner Best”]
Rating= [4.2, 4.8, 5.0, 3.8, 4.1]