Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 8 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 8 with Solutions
Time : 3 Hrs.
Max. Marks : 70
General Instructions
- Please check this question paper contains 37 questions.
- All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one of the choices in such questions.
- The paper is divided into 5 Sections- A, B, C, D and 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 case study type questions (33 to 34). Each question carries 4 Marks.
- Section E consists of 3 questions (35 to 37). Each question carries 5 Marks.
- All programming questions are to be answered using Python Language only.
- In case of MCQ, text of the correct answer should also be written.
Section A
Question 1.
State whether the following statements is True or False:
You can change the index of a Series after its creation.
Answer:
True
Question 2.
What is the meaning of “GROUP BY” clause in MySQL?
(a) Group data by column values
(b) Group data by row values
(c) Group data by column and row values
(d) None of these
Answer:
(a) Group data by column values
![]()
Question 3.
This cable uses light to transmit data :
(a) Co-axial cable
(b) Twisted pair
(c) OFC
(d) None of the above
Answer:
(c) OFC
Question 4.
Which of the following is not an aggregate function?
(a) AVG()
(b) ADD()
(c) MAX()
(d) COUNT()
Answer:
(b) ADD()
Question 5.
The term e-Waste can also be called as ___.
(a) WEEE
(b) WEST
(c) WET
(d) None of these
Answer:
(a) WEEE (Waste Electrical and Electronic Equipment)
Question 6.
DF1.loc[ ] method is used to ___. (Here# DF1 is a DataFrame)
(a) Add new row in a DataFrame ‘DFT
(b) To change the data values of a row to a particular value
(c) Both (a) and (b)
(d) None of the above
Answer:
(b) To change the data values of a row to a particular value
Question 7.
_____ function is used to draw points (markers) in a diagram?
(a) write()
(b) draw()
(c) plot()
(d) paint()
Answer:
(c) plot()
Question 8.
State whether the following statements is True or False:
The JOIN clause in SQL is used to combine rows from two oi; more tables based on a related column.
Answer:
True
Question 9.
All individuals of CSV rows of CSV files are called
(a) Tuple
(b) Data
(c) Record
(d) Cardinality
Answer:
(c) Record
Question 10.
The term plagiarism is not related to ___.
(a) illegal software copy
(b) illegal use of patents
(c) stealing others E-mail password
(d) None of these
Answer:
(c) stealing others E-mail password
Question 11.
Fill in the Blank:
To combine the result set of two or more SELECT statements into a single result, the ___ operator is used.
(a) UNION
(b) JOIN
(c) MERGE
(d) INTERSECT
Answer:
(a) UNION
Question 12.
Which of the below devices coverts analogue signals to digital bits?
(a) Flub
(b) Bridge
(c) Modem
(d) Gateway
Answer:
(c) Modem
![]()
Question 13.
Which of the following function is not a Boolean reduction function?
(a) Empty
(b) Any()
(c) All()
(d) Fillna()
Answer:
(d)Fillna()
Question 14.
What are component of IT Act 2000?
(a) Legal Recognition to Digital Signatures
(b) Regulation of Certification Authorities
(c) Digital Certificates
(d) All of the above
Answer:
(d) All of the above
Question 15.
The module that is required to create a Series is
(a) matplotlib
(b) pyplot
(c) pandas
(d) random
Answer:
(c) pandas
Question 16.
Match the following SQL functions/clauses with their descriptions:

(a) P-2, Q-1, R-4, S-3
(b) P-1, Q-2, R-4, S-3
(c) P-4, Q-3, R-2, S-1
(d) P-3, Q-4, R-1, S-2
Answer:
(a)P-2,Q-l,R-4,S-3
Question 17.
Fill in the Blank
In Pandas, the ___ method is used to return the number of unique elements in a DataFrame column.
(a) value_counts()
(b) unique()
(c) nunique()
(d) count()
Answer:
(c) nunique()
Question 18.
Which is the correct code statement to draw a plot without a line?
(a) plt.plot(xpoints, ypoints)
(b) plt.plotfxpoints, ypoints, 0)
(c) plt.plotfxpoints, ypoints, False)
(d) plt.plotfxpoints, ypoints, ’o’)
Answer:
(d) plt.plot(xpoints, ypoints, ‘o’)
Question 19.
A device is used to transfer data packets between two computer networks.
(a) Switch
(b) Router
(c) Brouter
(d) Gateway
Answer:
(b) Router
Directions (Q. Nos. 20 and 21) are Assertion (A) and Reason (R) Type questions. Choose the correct option as:
(a) Both Assertion (A) and Reason (R) are true, and Reason (R) is the correct explanation of Assertion (A)
(b) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of Assertion (A)
(c) Assertion (A) is True, but Reason (R) is False
(d) Assertion (A) is False, but Reason (R) is True
Question 20.
Assertion (A) DataFrame.count() function is used to count the number of non-null (not missing) values in each column.
Reason (R) axis=0, argument is to used to find sum column-wise.
Answer:
(c) Assertion A is true but reason R is false.
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.
Answer:
(d) ‘INSERT INTO’ is a Data Manipulation Language (DML) command, not DDL. It is used to add records to a table. DDL commands handle the structure of the database. Hence A is false and R is true.
Section B [7 × 2 = 14]
Question 22.
(A) How do >40u check for missing values in a Pandas DataFrame?
Or (B) How can you add a new column to an existing Pandas DataFrame?
Answer:
(A) You can use the isnull() or isna() functions to check for missing values in a DataFrame. Example: df.isnull ()
Or
(B) You can add a new column by assigning values to a new column name in the DataFrame.
Example: df [’New_Column’] = [value 1, value 2, …]
Question 23.
What is phishing and how can one protect against it?
Answer:
Phishing is a fraudulent attempt to obtain sensitive information by disguising as a trustworthy entity. Protection includes being cautious of unsolicited emails and not clicking on unknown links.
Question 24.
Consider the string: “Relational Database Management System”. Write suitable SQL queries for the following:
I. To extract and display “Database” from the string.
II. Display the position of the first occurrence of “System” in the given string.
Answer:
I. SELECT SUBSTRING! (’Relational Database Management System’, 12, 8) AS ExtractedString;
II. SELECT CHARINDEX (‘System’, ‘Relational Database Management System’) AS Position;
Question 25.
(A) Sahil, a Class Xth student, has just started understanding the basics of Internet and web technologies. He is a bit confused in between the terms “World Wide Web” and “Internet”. Help him in understanding both the terms with the help of suitable ‘ examples of each.
Or
(B) Ruhani wants to edit some privacy settings of her browser. How can she accomplish her task?
Answer:
(A) World Wide Web (WWW) is a set of programs, standards and protocols that allows the multimedia and hypertext files to be created, displayed and linked on the Internet, e.g. www.microsoft.com, www.amazon.com, etc. Internet is a computer-based world wide communications network, which is composed of large number of smaller interconnected networks.e.g. Web, E-mails, Social media, etc. While Internet is a collection of computers or networking devices connected together. WWW is a collection of documents, linked via special links called hyperlinks. WWW forms a large part of Internet but is not the Internet.
Or
(B) She can accomplish her task by performing following steps:
Step 1 Open your web browser.
Step 2 Open browser settings.
Step 3 Look for Privacy and Security settings. If not directly found, click on Advanced settings.
Step 4 After reaching Privacy and Security.
Question 26.
Differentiate char and varchar data types of MySQL.
Answer:
| Char | Varchar |
| Fixed length | Variable length |
| Uses the entire memory allocated for the field irrespective of the data stored, hence memory is wasted. | Uses only as much memory as required by the data stored. Memory is not wasted. |
Question 27.
Mention one hazard of e-waste and its impact on the environment.
Answer:
One hazard of e-waste is the release of toxic chemicals like lead and mercury, which can contaminate soil and water, causing environmental and health issues.
Question 28.
(A) The Python code written below has syntactical errors. Rewrite the correct code and underline the corrections made.
import pandas as Pd data = [10, 20, 30, 40, 50] myseries = pd.Series(data) result = my_series + 5 print()
Or
(B) Complete the given Python code: Given the DataFrame ‘df’, drop the ’salary’ column and display the first 5 rows of the modified DataFrame.
import ___ as pd
df = pd.DataFrame!{’name’: ['Riya', ‘Preeti’, ‘Neeta’], ’age’: [25, 30, 22], 'salary': [50000, 60000, 45000]})
df = df.___(___, axis=1)
print(df.____(___))
Answer:
(A)
import pandas as pd data = [10, 20, 30, 40, 50] my_series = pd.Series(data) result = my_series + 5 print(result)
Or
(B)
import pandas as pd
df = pd.DataFrame!{'name': ['Riya', 'Preeti', 'Neeta']. 'age': [25, 30, 22], 'salary': [50000, 60000. 45000]}) > df = df.drop('salary'. axis=1)
print(df.head(5))
Section C
Question 29.
Ravi has been receiving threatening messages from an anonymous user on social media. These messages have started affecting his mental health and daily life. The user also posts harmful comments about Ravi, spreading false information.
(i) What is happening to Ravi?
Answer:
Ravi is experiencing cyberbullying.
(ii) What steps should Ravi take to address the cyberbullying?
Answer:
Ravi should block the user, report the abuse to the social media platform, and talk to a trusted adult or counselor.
(iii) What legal recourse does Ravi have under Indian law?
Answer:
Ravi can report the incident to the police under the IT Act, 2000, which deals with cybercrimes including cyberbullying.
![]()
Question 30.
(A) Write a Python code to create a DataFrame df using dictionary of dictionaries from the data given below:

Answer:
import pandas as pd
# Creating a dictionary of dictionaries
data = {
0 : {'Bno' : 1, 'name': 'Sunil Grover', 'Score1': 90, 'Score2' : 80},
1 : {'Bno' : 2, 'name': 'Sourav Ganguli', 'Score1': 65, 'Score2': 45}.
2 : {'Bno' : 3, 'name': 'Virat Kohli’.
'Score1': 70, 'Score2': 90},
3: {'Bno': 4, 'name': 'Rahul Dravid', 'Score1': 80, 'Score2' : 70}
}
df = pd.DataFrame.from_dict(data, orient='index’)
print(df)
Or
(B) 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.

Answer:
import pandas as pd
# Creating a dictionary
data = {
'Bharatpur Bird Sanctuary’: 'Rajasthan',
'Chilika Lake Bird Sanctuary': 'Odisha',
'Chinnar Wildlife Sanctuary': 'Kerala'
}
series = pd.Series(data)
print(series)
Question 31.
Considering the table Student

Answer the following questions :
(i) If two more records are added, what will be the cardinality of the table?
Answer:
Cardinality = 10
(ii) What should be the data type of “Stream” column?
Answer:
Varchar
(iii) Write a query to remove the “Age” column.
Answer:
ALTER TABLE Student DROP Age;
Question 32.
(A) Write queries for (i) to (iii) which are based on the tables:
Table : VEHICLE


(i) To display CNO, CNAME, TRAVELDATE from the table TRAVEL in descending order of CNO.
Answer:
SELECT CNO, CNAME, TRAVELDATE FROM TRAVEL ORDER BY CNO DESC;
(ii) To display the CNAME of all customers from the table TRAVEL who are travelling by vechicle with code V01 or V02
Answer:
SELECT CNAME FROM TRAVEL WHERE VCODE IN (‘V01’ , ‘V02’);
(iii) To display the CNO and CNAME of those customers from the table TRAVEL who travelled between ‘2015-12-31’ and ‘2015-05-01’.
Answer:
SELECT CNO, CNAME FROM TRAVEL WHERE TRAVELDATE BETWEEN ‘2015-05-01’ AND ‘2015-12-31’;
Or
(B) Write SQL queries for (i) to (iii) which are based on the tables TRANSPORT and TRIP

(i) To display NO, NAME, TDATE from the table TRIP in descending order of NO.
Answer:
SELECT NO, NAME, TDATE FROM TRIP ORDER BY NO;
(ii) To display the NAME of the drivers from the table TRIP who are travelling by transport vehicle with code 101 or 103.
Answer:
SELECT NAME FROM TRIP WHERE TCODE = 101 OR TCODE = 103;
(iii) To display the NO and NAME of those drivers from the table TRIP who travelled between ‘2015-02-10’ and ‘2015-04-01’.
Answer:
SELECT NO AND NAME FROM TRIP WHERE ‘2015-02-10’ < TDATE < ‘2015-04-01’;
Section D [2 × 4 = 8]
Question 33.
Write Python code to create a horizontal bar graph of the following data with tastiest fruit based on number of people who likes it. Give appropriate title and labels on X axis and Y

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. Refer the graph shown above and fill the blank in Statement-3 with suitable Chart Title.
IV. Fill in the blank in Statement-4 with the name of the function to set the label on the y-axis.
Answer:
I. matplotlib.pyplot
II. barh
III. title
IV. ylabel
![]()
Question 34.
(A) Akhilesh a clerical staff in a Doctor’s Dispensary. He maintains records of visiting doctors in a table Doctor. He wants to analyse some data and find some results such as total number of doctors of certain departments, average charges in some departments etc. Help him in writing proper queries to get the results.

(i) To display the maximum Charges among the Ortho Doctors.
Answer:
SELECT MAX(Charges) FROM Doctor WHERE Dept=“0rtho”;
(ii) To display the doctor names in uppercase along with their department names concatenated.
Answer:
SELECT CONCAT(UCASE( Dname), Dept) FROM Doctor;
(iii) To display each department and the total number of doctors in them.
Answer:
SELECT Dept,COUNT(*) FROM Doctor GROUP BY Dept;
(iv) To display each department and the average charges of each.
Answer:
ELECT Dept, AVG(Charges) FROM Doctor GROUP BY Dept;
Or
(B) Sumit, who works as a database designer, has developed a database for a office. This database includes a table Employee whose column(attribute) names are mentioned below:
emp_id – shows Employee ID
name – indicates the name of Employee
department – specifies the department of the Employees.
salary – lists of salaries
joining_date – lists of date of joining of the Employees.

(i) SELECT name FROM Employee WHERE salary > 70000;
(ii) SELECT AVG(salary) AS avg_salary FROM Employee WHERE department = ’HR’;
(iii) SELECT department. COUNT!*) AS num_employees FROM Employee GROUP BY department;
(iv) SELECT MAX (salary) AS max_salary FROM Employee;
Answer:
(i)

(ii)

(iii)

(iv)

Section E
Question 35.
Bhartiya Connectivity Association is planning to spread their offices in four major cities of India to provide regional IT infrastructure support in the field of education and culture.
The company has planned to set up their head office in New Delhi in three locations and have named their New Delhi offices as Front Office, Back Office and Work Office. The company has three more regional offices as three major cities of India. A rough layout of the same is as follows:

Approximate distances between these offices as per network survey team is as follows:

In continuation of the above, the company experts have planned to install the following number of computers in each of their offices.

(i) Suggest the network type (out of LAN, MAN, WAN) for connecting each of the following set of the their offices.
(a) Back Office and Work Office
(b) Back Office and South Office
Answer:
The type of network between the Back Office and the Work Office is LAN (Local Area- Network).
(b) The type of network between the Back Office and the South Office is WAN (Wide Area Network).
(ii) Which device will you suggest to be procured by the company for connecting all the computers with each of their offices out of the following devices?
(a) Switch/Hub
(b) Modem
Answer:
The suitable device for connecting all ’the computers in each of their offices is switch/hub.
(iii) Suggest the cable/wiring layout for connecting the company’s local offices located in New Delhi. Also, suggest an effective method for connecting the company’s regional offices East Office, West Office and South Office with offices located in New Delhi.
Answer:
The suggested layout for connection isas follows:

(iv) Data is converted in a form so as to travel over telephone lines using this device.
Answer:
Modem
(v) Network device that sends the data over optimising paths through connected loop is
(a) gateway
(b) hub
(c) router
(d) bridge
Answer:
(c) Network device that sends the data over optimising paths through connected loop is router.
![]()
Question 36.
Write the code in Python to create the following DataFrame:

Write the commands to do the following operations on the dataframes given above:
(i) To display both the dataframes.
(ii) To add dataframes df1 and df2.
(iii) To subtract df2 from df1.
(iv) To rename column Markl as Marksl in both the dataframes dfl and df2.
(v) To change index label of dfl from 0 to zero and 1 to one.
Answer:
import numpy as np
import pandas as pd
df1 = pd.DataFrame({'Mark1' : [30, 40, 15, 40],
‘Mark2’:[20, 45, 30, 70]})
df2 = pd.DataFrame({'Mark1' : [10, 20, 20, 50],
'Mark2' : [15, 25, 30, 30]})
(i)
print(df1) print(df2)
(ii)
print(df1.add(df2))
(iii)
print(df1.subtract(df2))
(iv)
df1.rename (columns = {'Mark1' : 'Marks1'}, inplace = True)
(v)
df1.rename (index = {0 : ‘zero’, 1 : 'one'}, inplace = True)
Question 37.
(A) Write suitable SQL query for the following:
I. To display the total number of orders in the Orders table.
II. To display the last four characters of the user_id column (attribute) in the Users table. (Note: The user IDs are stored in the format U123-4567)
III. To display the data from the column (attribute) address in the Clients table, after eliminating any leading and trailing spaces.
IV. To display the minimum value in the cost column (attribute) of the Services table.
V. To determine the count of rows where the status is ’Active’ in the Accounts table.
Answer:
I. SELECT COUNT (*) FROM Orders;
II. SELECT RIGHT(user_id, 4) FROM Users;
III. SELECT TRIM(address) FROM Clients;
IV. SELECT MIN(cost) FROM Services;
V. SELECT COUNT(*) FROM Accounts WHERE status = ‘Active’ ;
Or
(B) Write the names of SQL functions which will perform the following operations:
(i) To display the current date.
(ii) To convert the string in capital letters ‘Kendriya’.
(iii) To remove spaces from the end of string “Kvs RO Jammu
(iv) To display the month from the current date.
(v) To compute the power of a number n1 raised to the power n2.
Answer:
(i) CURRENT_DATE() or CURDATE()
(ii) UPPER(‘Kendriya’)
(iii) RTRIM(‘Kvs RO Jammu’)
(iv) MONTH(CURRENT_DATE())
(v) POWER(n1, n2)