KnowledgeBoat Logo
OPEN IN APP

Sample 2025

Solved 2025 Sample Question Paper CBSE Class 12 Informatics Practices (065)

Class 12 - CBSE Informatics Practices Solved Question Papers



Section A (1 Mark Each)

Question 1

State whether the following statement is True or False:

Slicing can be used to extract a specific portion from a Pandas Series.

Answer

True

Reason — Slicing can be used to extract a specific portion from a Pandas Series by specifying the start, stop, and step values. The syntax is Series[start:stop:step].

For example,

import pandas as pd
data = pd.Series([5, 10, 15, 20, 25, 30, 35])
sliced_data = data[1:5:1]
print(sliced_data)
Output
1    10
2    15
3    20
4    25
dtype: int64

Question 2

The purpose of WHERE clause in a SQL statement is to:

  1. Create a table
  2. Filter rows based on a specific condition
  3. Specify the columns to be displayed
  4. Sort the result based on a column

Answer

Filter rows based on a specific condition

Reason — The purpose of the WHERE clause in a SQL statement is to select only those rows that meet a specific condition.

Question 3

Identify the networking device responsible for routing data packets based on their destination addresses.

  1. Modem
  2. Hub
  3. Repeater
  4. Router

Answer

Router

Reason — A Router is a networking device responsible for directing data packets to their correct destination by analyzing their destination addresses.

Question 4

Identify the SQL command used to delete a relation (table) from a relational database.

  1. DROP TABLE
  2. REMOVE TABLE
  3. DELETE TABLE
  4. ERASE TABLE

Answer

DROP TABLE

Reason — The DROP TABLE command in SQL is used to delete an entire relation (table) from a relational database, removing its structure and all data permanently.

Question 5

e-waste refers to:

  1. Software that has become obsolete
  2. Data that has been deleted from a storage device
  3. Viruses that infect computers
  4. Electronic devices that are no longer in use

Answer

Electronic devices that are no longer in use

Reason — E-waste, or electronic waste, refers to discarded electronic or electrical devices and components. This includes items like computers, mobile phones, televisions, refrigerators, and other electronic appliances that are no longer in use or have reached the end of their life cycle.

Question 6

Which of the following Python statements can be used to select a column column_name from a DataFrame df ?

  1. df.getcolumn('column_name')
  2. df['column_name']
  3. df.select('column_name')
  4. df(column_name)

Answer

df['column_name']

Reason — The statement df['column_name'] is used to select a column named column_name from a DataFrame df in Python.

Question 7

By default, the plot() function of Matplotlib draws a ............... plot.

  1. histogram
  2. column
  3. bar
  4. line

Answer

line

Reason — By default, the plot() function of Matplotlib draws a line plot, which connects data points with lines.

Question 8

State whether the following statement is True or False:

In SQL, the HAVING clause is used to apply filter on groups formed by the GROUP BY clause.

Answer

True

Reason — The HAVING clause applies conditions to groups after data is grouped using the GROUP BY clause in SQL queries.

Question 9

Which of the following Python statements is used to import data from a CSV file into a Pandas DataFrame (Note: pd is an alias for pandas)?

  1. pd.open_csv('filename.csv')
  2. pd.read_csv('filename.csv')
  3. pd.load_csv('filename.csv')
  4. pd.import_csv('filename.csv')

Answer

pd.read_csv('filename.csv')

Reason — The statement pd.read_csv('filename.csv') is used to import data from a CSV file into a Pandas DataFrame. The read_csv function reads the contents of the specified CSV file and converts it into a structured DataFrame format.

Question 10

What is plagiarism ?

  1. Using copyrighted material without giving proper acknowledgement to the source
  2. Downloading illegal software.
  3. Spreading misinformation online.
  4. Hacking into computer systems.

Answer

Using copyrighted material without giving proper acknowledgement to the source

Reason — Plagiarism is stealing someone else's intellectual work, such as an idea, literary work or academic work etc., and representing it as our own work without giving credit to creator or without citing the source of information.

Question 11

Fill in the Blank

The COUNT(*) function provides the total number of ............... within a relation (table) in a relational database.

  1. Columns
  2. Unique values
  3. Not-null values
  4. Rows

Answer

Rows

Reason — The COUNT(*) function provides the total number of rows within a relation (table) in a relational database. It counts all rows, including duplicates and NULL values.

Question 12

In which of the network topologies do all devices connect to a central point, such as a switch or hub?

  1. Star
  2. Bus
  3. Tree
  4. Mesh

Answer

Star

Reason — Star topology consists of a central node to which all other nodes are connected by a single path.

Question 13

In a Pandas DataFrame, if the tail() function is used without specifying the optional argument indicating the number of rows to display, what is the default number of rows displayed, considering the DataFrame has 10 entries ?

  1. 0
  2. 1
  3. 4
  4. 5

Answer

5

Reason — In a Pandas DataFrame, if the tail() function is used without specifying an optional argument, it displays the last 5 rows by default.

Question 14

Identify the type of cybercrime that involves sending fraudulent emails to deceive individuals into revealing sensitive information.

  1. Hacking
  2. Phishing
  3. Cyberbullying
  4. Cyberstalking

Answer

Phishing

Reason — Phishing is the act of illegally acquiring personal and sensitive information such as, online banking details, credit card details, and other login details, of an individual by sending malicious e-mails or by creating web pages that can collect this information as they appear to come from very famous organizations.

Question 15

While creating a Series using a dictionary, the keys of the dictionary become:

  1. Values of the Series
  2. Indices of the Series
  3. Data type of the Series
  4. Name of the Series

Answer

Indices of the Series

Reason — While creating a Series using a dictionary, the keys of the dictionary become the indices of the Series. The values in the dictionary correspond to the data in the Series.

Question 16

Match the following SQL functions/clauses with their descriptions:

 SQL Function Description
P.MAX()1.Find the position of a substring in a string.
Q.SUBSTRING()2.Returns the maximum value in a column.
R.INSTR()3.Sorts the data based on a column.
S.ORDER BY4.Extracts a portion of a string.
  1. P-2, Q-4, R-3, S-1
  2. P-2, Q-4, R-1, S-3
  3. P-4, Q-3, R-2, S-1
  4. P-4, Q-2, R-1, S-3

Answer

P-2, Q-4, R-1, S-3

Reason

  1. The MAX() function is used to return the maximum value from a specified column in a database table.

  2. The SUBSTRING() function extracts a portion of a string based on specified starting position and length.

  3. The INSTR() function returns the position of a substring within a string.

  4. The ORDER BY clause is used to sort the result set based on one or more columns in ascending or descending order.

Question 17

Fill in the Blank

Boolean indexing in Pandas DataFrame can be used for ...............

  1. Creating a new DataFrame
  2. Sorting data based on index labels
  3. Joining data using labels
  4. Filtering data based on condition

Answer

Filtering data based on condition

Reason — Boolean indexing in Pandas DataFrame allows for the selection of rows based on a condition that evaluates to True or False.

Question 18

Which Matplotlib plot is best suited to represent changes in data over time?

  1. Bar plot
  2. Histogram
  3. Line plot
  4. Histogram & Bar plot

Answer

Line plot

Reason — A line plot shows changes over time by connecting data points, called "markers," with straight line segments. A line chart, or line graph, is a type of chart that displays continuous information effectively.

Question 19

Which type of network covers a small geographical area like a single office, building, or school campus?

  1. PAN
  2. MAN
  3. LAN
  4. WAN

Answer

LAN

Reason — LAN (Local Area Network) covers a small geographical area like a home, office, or school. It typically covers an area of up to 10 kilometers.

Question 20

Assertion (A): We can add a new column in an existing DataFrame.

Reason (R): DataFrames are size mutable.

  1. Both A and R are true, and R is the correct explanation of A.
  2. Both A and R are true, and R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Answer

Both A and R are true, and R is the correct explanation of A.

Explanation
We can add a new column to an existing DataFrame using the .at or .loc methods. A DataFrame is a two-dimensional data structure that is size-mutable. This means that we can add or drop elements in an existing DataFrame object without needing to create a new DataFrame internally.

Question 21

Assertion (A): In SQL, INSERT INTO is a Data Definition Language (DDL) Command.

Reason (R): DDL commands are used to create, modify, or remove database structures, such as tables.

  1. Both A and R are true, and R is the correct explanation of A.
  2. Both A and R are true, and R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Answer

A is false but R is true.

Explanation
In SQL, INSERT INTO is a Data Manipulation Language (DML) Command. Data definition language (DDL) commands in SQL are used to define a database, including creating, altering, and dropping tables.

Section B (2 Marks Each)

Question 22(A)

What is a Series in Python Pandas? Also, give a suitable example to support your answer.

Answer

In Python Pandas, a Series is a one-dimensional array containing a sequence of values of any data type (such as integers, strings, floats, lists, etc.). It is similar to a column in a spreadsheet. Each element in a Series has a unique label or index, making it easy to access individual values. By default, a Series has numeric labels starting from zero.

An example of a series containing the names of students is given below:

Index  Value  
0      Adhya  
1      Samrat  
2      Rohit  
3      Dinesh

Question 22(B)

What does the term 'library' signify in Python? Mention one use for each of the following libraries:

  • Pandas
  • Matplotlib

Answer

The Python library is an extensive collection of functions and modules that provides functionalities for specific tasks.

Uses of libraries:

  • Pandas — Used for data analysis.

  • Matplotlib — Used for data visualization, helping create plots.

Question 23

What are intellectual property rights (IPR), and why are they important in the digital world?

Answer

Intellectual property rights are the rights of the owner of information to decide how much information is to be exchanged, shared or distributed. Also it gives the owner a right to decide the price for doing so.

Importance of IPR in the digital world :

In the digital world, where content can be easily copied and shared, IPR helps ensure creators are paid fairly for their work and encourages them to create more.

Question 24

Consider the string: "Database Management System". Write suitable SQL queries for the following:

I. To extract and display "Manage" from the string.

II. Display the position of the first occurrence of "base" in the given string.

Answer

I. SELECT SUBSTRING('Database Management System', 10, 6);

II. SELECT INSTR('Database Management System', 'base');

Question 25(A)

What is Internet and how does it differ from World Wide Web (WWW)?

Answer

The Internet is a vast network of interconnected computer networks facilitating global communication and data exchange. The World Wide Web (WWW), on the other hand, is a system of interlinked hypertext documents accessed via the Internet.

Question 25(B)

Explain the concept of browser cookies and mention one advantage of using them.

Answer

Cookies are small text files stored on a user's computer, created and used by websites to remember basic information about the user and personalising their experience.

Cookies improve user experience by remembering preferences, like user's preferred language and other settings.

Question 26

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

Answer

A primary key is a set of one or more attributes/fields that can uniquely identify tuples/rows within the relation (table). It must contain unique values and cannot be null.

A candidate key, on the other hand, refers to all the attributes in a relation that are candidates or are capable of becoming a primary key. A table can have multiple candidate keys, but only one of them is chosen as the primary key.

Question 27

Mention two health concerns associated with excessive use of Digital Devices.

Answer

The two health concerns associated with excessive use of digital devices are as follows:

  1. Impact on Hearing — Listening to loud music for over 15 minutes can cause hearing damage. Using headphones for long periods increases bacteria in the ears by over 700 times.

  2. Impact on Bones and Joints — Technology affects posture due to prolonged sitting and repetitive movements, leading to muscle and joint strain. Repetitive Strain Injuries (RSIs) affect muscles, nerves, tendons, ligaments, and joints.

Question 28(A)

Sneha is writing a Python program to create a DataFrame using a list of dictionaries. However, her code contains some mistakes. Identify the errors, rewrite the correct code, and underline the corrections made.

import Pandas as pd 
D1 = {'Name': 'Rakshit', 'Age': 25} 
D2 = {'Name': 'Paul', 'Age': 30} 
D3 = {'Name': 'Ayesha", 'Age': 28} 
data = [D1, D2, D3) 
df = pd.Dataframe(data) 
print(df)

Answer

import Pandas as pd # Error 1
D1 = {'Name': 'Rakshit', 'Age': 25} 
D2 = {'Name': 'Paul', 'Age': 30} 
D3 = {'Name': 'Ayesha", 'Age': 28} # Error 2
data = [D1, D2, D3) # Error 3
df = pd.Dataframe(data) # Error 4
print(df)

Error 1 — The module should be imported as import pandas as pd (lowercase).

Error 2 — In D3, the value has mismatched quotes.

Error 3 — The list data should use square brackets [], not parentheses.

Error 4 — The Dataframe should be DataFrame (capital 'F').

The corrected code is:

import pandas as pd 
D1 = {'Name': 'Rakshit', 'Age': 25} 
D2 = {'Name': 'Paul', 'Age': 30} 
D3 = {'Name': 'Ayesha', 'Age': 28} 
data = [D1, D2, D3] 
df = pd.DataFrame(data) 
print(df)

Question 28(B)

Complete the given Python code to get the required output (ignore the dtype attribute) as

Output:

Tamil Nadu       Chennai   
Uttar Pradesh    Lucknow   
Manipur           Imphal   

Code:

import _______ as pd 
data = ['Chennai','_______','Imphal'] 
indx = ['Tamil Nadu','Uttar Pradesh','Manipur'] 
s = pd.Series(_______, indx) 
print(_______) 

Answer

import pandas as pd 
data = ['Chennai', 'Lucknow', 'Imphal'] 
indx = ['Tamil Nadu','Uttar Pradesh','Manipur'] 
s = pd.Series(data, indx) 
print(s)

Section C (3 Marks Each)

Question 29

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.

Answer

I. E-waste contains hazardous substances such as lead, mercury, cadmium, arsenic etc. Improper handling or disposal of e-waste can release these toxic substances into the environment, leading to various health hazards including lung cancer, DNA damage, and brain damage.

II. They can donate or sell it to a certified e-waste recycling center.

III. Recycling E-waste is important because it helps conserve natural resources and reduces pollution.

Question 30A

Write a Python program to create the following DataFrame using a list of dictionaries.

NoProductPrice
0Laptop60000
1Desktop45000
2Monitor15000
3Tablet30000
Solution
import pandas as pd 
d1 = {'Product': 'Laptop', 'Price': 60000} 
d2 = {'Product': 'Desktop', 'Price': 45000} 
d3 = {'Product': 'Monitor', 'Price': 15000} 
d4 = {'Product': 'Tablet', 'Price': 30000} 
data = [d1, d2, d3, d4] 
df = pd.DataFrame(data) 
print(df)
Output
   Product  Price
0   Laptop  60000
1  Desktop  45000
2  Monitor  15000
3   Tablet  30000

Question 30B

Write a Python Program to create a Pandas Series as shown below using a dictionary. Note that the left column indicates the indices and the right column displays the data.

RussiaMoscow
HungaryBudapest
SwitzerlandBern
Solution
import pandas as pd 
data = {'Russia':'Moscow','Hungary':'Budapest','Switzerland':'Bern'} 
s = pd.Series(data) 
print(s)
Output
Russia           Moscow
Hungary        Budapest
Switzerland        Bern
dtype: object

Question 31

I. Write an SQL statement to create a table named STUDENTS, with the following specifications:

Column NameData TypeKey
StudentIDNumericPrimary Key
FirstNameVarchar(20)
LastNameVarchar(10)
DateOfBirthDate
PercentageFloat(10, 2)

II. Write SQL Query to insert the following data in the Students Table

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

Answer

I.

CREATE TABLE STUDENTS ( 
StudentID NUMERIC PRIMARY KEY, 
FirstName VARCHAR(20),
LastName VARCHAR(10), 
DateOfBirth DATE, 
Percentage FLOAT(10,2) 
);

II.

INSERT INTO STUDENTS (StudentID, FirstName, LastName, 
DateOfBirth, Percentage) VALUES (1, 'Supriya', 'Singh', '2010-08-18', 
75.5); 

Question 32(A)

Consider the following tables:

Table 1:

EMPLOYEE which stores Employee ID (EMP_ID), Employee Name (EMP_NAME), Employee City (EMP_CITY)

Table 2:

PAYROLL which stores Employee ID (EMP_ID), Department (DEPARTMENT), Designation (DESIGNATION), and Salary (SALARY) for various employees.

Note: Attribute names are written within brackets.

Table: EMPLOYEE

EMP_IDEMP_NAMEEMP_CITY
1ABHINAVAGRA
2KABIRFARIDABAD
3ESHANOIDA
4PAULSEOUL
5VICTORIALONDON

Table: PAYROLL

EMP_IDDEPARTMENTDESIGNATIONSALARY
1SALESMANAGER75000
2SALESASSOCIATE50000
3ENGINEERINGMANAGER95000
4ENGINEERINGENGINEER70000
5MARKETINGMANAGER65000

Write appropriate SQL queries for the following:

I. Display department-wise average Salary.

II. List all designations in the decreasing order of Salary.

III. Display employee name along with their corresponding departments.

Answer

I.

SELECT DEPARTMENT, AVG(SALARY) 
FROM PAYROLL 
GROUP BY DEPARTMENT; 

II.

SELECT DESIGNATION 
FROM PAYROLL 
ORDER BY SALARY DESC; 

III.

SELECT EMP_NAME, DEPARTMENT 
FROM EMPLOYEE E, PAYROLL P 
WHERE E.EMP_ID = P.EMP_ID;

Question 32(B)

Consider the following tables:

Table 1:

ATHLETE, which stores AthleteID, Name, Country. The table displays basic information of the athletes.

Table 2:

MEDALS, which stores AthleteID, Sport, and Medals. The table displays the number of medals won by each athlete in their respective sports.

Table: ATHLETE

AthleteIDNameCOUNTRY
101ArjunINDIA
102PriyaINDIA
103AsifUAE
104RozyUSA
105DavidDENMARK

Table: MEDALS

AthleteIDSportMedals
101Swimming8
102Track3
103Gymnastics5
104Swimming2
105Track6

Write appropriate SQL queries for the following:

I. Display the sports-wise total number of medals won.

II. Display the names of all the Indian athletes in uppercase.

III. Display the athlete name along with their corresponding sports

Answer

I.

SELECT Sport, SUM(Medals) 
FROM MEDALS 
GROUP BY Sport;

II.

SELECT UPPER(Name) 
FROM ATHLETE 
WHERE Country = 'INDIA'; 

III.

SELECT Name, Sport 
FROM ATHLETE A, MEDALS M 
WHERE A.AthleteID= M.AthleteID; 

Section D (4 Marks Each)

Question 33

During a practical exam, a student Ankita has to fill in the blanks in a Python program that generates a bar chart. This bar chart represents the number of books read by four students in one month.

Student NameBooks Read
Karan12
Lina9
Raj5
Simran3

Help Ankita to complete the code.

During a practical exam, a student Ankita has to fill in the blanks in a Python program that generates a bar chart. This bar chart represents the number of books read by four students in one month. CBSE 2025 Computer Science Class 12 Sample Question Paper Solved.
import _____ as plt #Statement-1 
students = ['Karan', 'Lina', 'Raj', 'Simran'] 
books_read = [12, 9, 5, 3] 
plt.bar( students, _____, label='Books Read') #Statement-2 
plt.xlabel('Student Name') 
plt._____('Books Read') #Statement-3 
plt.legend() 
plt.title('_____') #Statement-4 
plt.show()

I. Write the suitable code for the import statement in the blank space in the line marked as Statement-1.

II. Refer to the graph shown above and fill in the blank in Statement-2 with suitable Python code.

III. Fill in the blank in Statement-3 with the name of the function to set the label on the y-axis.

IV. Refer the graph shown above and fill the blank in Statement-4 with suitable Chart Title.

Answer

I. matplotlib.pyplot

II. books_read

III. ylabel

IV. Number of Books Read by Students

Question 34(A)

Rahul, who works as a database designer, has developed a database for a bookshop. This database includes a table BOOK whose column (attribute) names are mentioned below:

BCODE: Shows the unique code for each book.

TITLE: Indicates the book’s title.

AUTHOR: Specifies the author’s name.

PRICE: Lists the cost of the book.

Table: BOOK

BCODETITLEAUTHORPRICE
B001MIDNIGHT'S CHILDRENSALMAN RUSHDIE500
B002THE GOD OF SMALL THINGSARUNDHATI ROY450
B003A SUITABLE BOYVIKRAM SETH600
B004THE WHITE TIGERARAVIND ADIGA399
B005TRAIN TO PAKISTANKHUSHWANT SINGH350

I. Write SQL query to display book titles in lowercase.

II. Write SQL query to display the highest price among the books.

III. Write SQL query to display the number of characters in each book title.

IV. Write SQL query to display the Book Code and Price sorted by Price in descending order.

Answer

I.

SELECT LOWER(TITLE) 
FROM BOOK;  

II.

SELECT MAX(PRICE) 
FROM BOOK; 

III.

SELECT LENGTH(TITLE) 
FROM BOOK; 

IV.

SELECT BCODE, PRICE 
FROM BOOK 
ORDER BY PRICE DESC; 

Question 34(B)

Dr. Kavita has created a database for a hospital's pharmacy. The database includes a table named MEDICINE whose column (attribute) names are mentioned below:

MID: Shows the unique code for each medicine.

MED_NAME: Specifies the medicine name.

SUPP_CITY: Specifies the city where the supplier is located.

STOCK: Indicates the quantity of medicine available.

DEL_DATE: Specifies the date when the medicine was delivered.

Table: MEDICINE

MIDMED_NAMESUPP_CITYSTOCKDEL_DATE
M01PARACETAMOLMUMBAI2002023-06-15
M02AMOXICILLINKOLKATA502023-03-21
M03COUGH SYRUPBENGALURU1202023-02-10
M04INSULINCHENNAI1352023-01-25
M05IBUPROFENAHMEDABAD302023-04-05

Write the output of the following SQL Queries.

I. Select LENGTH(MED_NAME) from MEDICINE where STOCK > 100;

II. Select MED_NAME from MEDICINE where month(DEL_DATE) = 4;

III. Select MED_NAME from MEDICINE where STOCK between 120 and 200;

IV. Select max(DEL_DATE) from MEDICINE;

Answer

I.

Output
+------------------+
| LENGTH(MED_NAME) |
+------------------+
|               11 |
|               11 |
|                7 |
+------------------+

II.

Output
+-----------+
| MED_NAME  |
+-----------+
| IBUPROFEN |
+-----------+

III.

Output
+-------------+
| MED_NAME    |
+-------------+
| PARACETAMOL |
| COUGH SYRUP |
| INSULIN     |
+-------------+

IV.

Output
+---------------+
| max(DEL_DATE) |
+---------------+
| 2023-06-15    |
+---------------+

Section E (5 Marks Each)

Question 35

ABC Pvt. Ltd., a multinational technology company, is looking to establish its Indian Head Office in Bengaluru, and a regional office branch in Lucknow. The Bengaluru head office will be organized into four departments: HR, FINANCE, TECHNICAL, AND SUPPORT. As a network engineer, you have to propose solutions for various queries listed from I to V.

ABC Pvt. Ltd., a multinational technology company, is looking to establish its Indian Head Office in Bengaluru, and a regional office branch in Lucknow. CBSE 2025 Computer Science Class 12 Sample Question Paper Solved.

The shortest distances between the departments/offices are as follows:

HR TO FINANCE65 M
HR TO TECHNICAL80 M
HR TO SUPPORT70 M
FINANCE TO TECHNICAL60 M
FINANCE TO SUPPORT75 M
TECHNICAL TO SUPPORT50 M
BENGALURU OFFICE TO LUCKNOW1900 KM

The number of computers in each department/office is as follows:

HR175
FINANCE35
TECHNICAL50
SUPPORT15
LUCKNOW OFFICE40

I. Suggest the most suitable department in the Bengaluru Office Setup, to install the server. Also, give a reason to justify your suggested location.

II. Draw a suitable cable layout of wired network connectivity between the departments in the Bengaluru Office.

III. Which networking device would you suggest the company to purchase to interconnect all the computers within a department in Bengaluru Office?

IV. The company is considering establishing a network connection between its Bengaluru Head Office and Lucknow regional office. Which type of network—LAN, MAN, or WAN—will be created? Justify your answer.

V. The company plans to develop an interactive website that will enable its employees to monitor their performance after login. Would you recommend a static or dynamic website, and why?

Answer

I. The server should be installed in the HR department as it has the most number of computers.

II. Star topology

ABC Pvt. Ltd., a multinational technology company, is looking to establish its Indian Head Office in Bengaluru, and a regional office branch in Lucknow. CBSE 2025 Computer Science Class 12 Sample Question Paper Solved.

III. Switch/Hub should be purchased by the company to interconnect all the computers within a department in Bengaluru office.

IV. A WAN (Wide Area Network) will be created because the offices are located in different cities, with a distance of 1900 km between the Bengaluru Head Office and the Lucknow Regional Office.

V. A dynamic website is recommended because it can display performance data that varies for each employee.

Question 36

Consider the DataFrame df shown below.

 MovieIDTitleYearRating
01LAGAAN20018.4
12TAARE ZAMEEN PAR20078.5
233 IDIOTS20098.4
34DANGAL20168.4
45ANDHADHUN20188.3

Write Python statements for the DataFrame df to:

I. Print the first two rows of the DataFrame df.

II. Display titles of all the movies.

III. Remove the column rating.

IV. Display the data of the 'Title' column from indexes 2 to 4 (both included)

V. Rename the column name 'Title' to 'Name'.

Answer

I. print(df.head(2))

II. print(df['Title'])

III. df = df.drop(‘Rating’, axis=1)

IV. print(df.loc[2:4,'Title'])

V. df.rename(columns={'Title':'Name'}, inplace=True)

Question 37(A)

Write suitable SQL query for the following:

I. To display the average score from the test_results column (attribute) in the Exams table.

II. To display the last three characters of the registration_number column (attribute) in the Vehicles table. (Note: The registration numbers are stored in the format DL-01-AV-1234)

III. To display the data from the column (attribute) username in the Users table, after eliminating any leading and trailing spaces.

IV. To display the maximum value in the salary column (attribute) of the Employees table.

V. To determine the count of rows in the Suppliers table.

Answer

I.

SELECT AVG(test_results) 
FROM Exams;

II.

SELECT RIGHT(registration_number, 3) 
FROM Vehicles;

III.

SELECT TRIM(username) 
FROM Users; 

IV.

SELECT MAX(salary) 
FROM Employees;

V.

SELECT COUNT(*) 
FROM Suppliers; 

Question 37(B)

Write suitable SQL query for the following:

I. Round the value of pi (3.14159) to two decimal places.

II. Calculate the remainder when 125 is divided by 8.

III. Display the number of characters in the word 'NewDelhi'.

IV. Display the first 5 characters from the word 'Informatics Practices'.

V. Display details from 'email' column (attribute), in the 'Students' table, after removing any leading and trailing spaces.

Answer

I.

SELECT ROUND(3.14159, 2); 

II.

SELECT MOD(125, 8); 

III.

SELECT LENGTH('NewDelhi');

IV.

SELECT LEFT('Informatics Practices', 5);

V.

SELECT TRIM(email) 
FROM Students;
PrevNext