Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 5 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 5 with Solutions
Time: 3 Hours
Maximum 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 the case of MCQ, the text of the correct answer should also be written.
Section A
(21 × 1 = 21)
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
Question 2.
In MySQL, Reena and Zebi are getting the following output of SELECT statement on a table Employee.
Which keyword has Zebi used with a SELECT statement to get the above output?
(a) COUNT
(b) UNIQUE
(c) DISTINCT
(d) All of these
Answer:
(c) DISTINCT
Question 3.
Which of the following is used to extend the range of a network by amplifying signals?
(a) Router
(b) Repeater
(c) Modem
(d) Switch
Answer:
(b) Repeater
Question 4.
The AVG() function in MySQL is an example of
(a) MATH() function
(b) TEXT() function
(c) DATE() function
(d) Aggregate function
Answer:
(d) Aggregate function
Question 5.
___________ are the impact of e-Waste on the environment.
(a) Soil pollution
(b) Water pollution
(c) Air pollution
(d) Sound pollution
Answer:
(d) Sound pollution
Question 6.
How can you add a new column new_column with all values set to 0 to an existing DataFrame df?
(a) df.add_column(‘new_column’, 0)
(b) df[‘new_column] = 0
(c) df.insert_column(‘new_column’, 0)
(d) df.append_column(‘new_column’, 0)
Answer:
(b) df[‘new_column’] = 0
Question 7.
Which is the correct import statement to import pyplot?
(a) import matplotlib.pyplot as pit
(b) import pyplot from matplotlib
(c) Both (a) and (b)
(d) None of these
Answer:
(a) import matplotlib.pyplot as pit
Question 8.
State whether the following statement is True or False:
The DISTINCT keyword in SQL is used to return all rows, including duplicates.
Answer:
False
Question 9.
Which function is used to save a DataFrame to a CSV file in pandas (Note: df is a DataFrame object)?
(a) df.to_save(‘filename.csv’)
(b) df.write_csv(‘filename.csv’)
(c) df.save_csv(‘filename.csv’)
(d) df.to_csv(‘filename.csv’)
Answer:
(d) df.to_csv(‘filename.csv’)
Question 10.
Which of the following is not a violation of IPR?
(a) Plagiarism
(b) Copyright infringement
(c) Patent
(d) Trademark infringement
Answer:
(c) Patent
Question 11.
Fill in the Blank.
The ___________ constraint ensures that all values in a column are different.
(a) NOT NULL
(b) CHECK
(c) UNIQUE
(d) FOREIGN KEY
Answer:
(c) UNIQUE
Question 12.
Data Communication systems spanning states, countries or the whole world is
(a) PAN
(b) LAN
(c) MAN
(d) WAN
Answer:
(d) WAN
Question 13.
The command to display first 4 rows from series named “week” is
(a) print(week.head (4))
(b) print(week.Head(4))
(c) print(week.heads(4))
(d) print(week.Heads(4))
Answer:
(a) print(week.head (4))
Question 14.
Which of the following is not a type of Cyber crime?
(a) Data theft
(b) Forgery of online documents
(c) Damage to data and systems
(d) Installing antivirus for protection
Answer:
(d) Installing antivirus for protection
Question 15.
Which of the following will not display the data type of a series “s1”?
(a) s1.type
(b) s1.dtype
(c) s1.data
(d) s1.values
Answer:
(b) s1.dtype
Question 16.
Match the following SQL set operators with their functions:
SQL Set Operator | Function |
P. INTERSECT | 1. Combines all unique rows from two queries. |
Q. EXCEPT | 2. Returns rows that exist in both queries. |
R. UNION | 3. Returns rows from the first query but not the second. |
S. JOIN | 4. Combines rows from two or more tables. |
(a) P – 2, Q – 3, R – 1, S – 4
(b) P – 4, Q – 1, R – 2, S – 3
(c) P – 3, Q – 2, R – 4, S – 1
(d) P – 1, Q – 2, R – 3, S – 4
Answer:
(d) P – 1, Q – 2, R – 3, S – 4
Question 17.
Fill in the blank.
When we create DataFrame from List of Dictionaries, then dictionary keys will become ___________
(a) Column labels
(b) Row labels
(c) Both (a) and (b)
(d) None of these
Answer:
(a) Column labels
Question 18.
Mohit is trying to create a histogram of “STEP” type with 10 bins. Help him to identify the correct statement from the following statements.
(a) plt.hist(x, bins=10, histype=”barstacked”)
(b) plt.hist(x, blns=11)
(c) plt.hist(x, bins=10, histype=”step”)
(d) plt.hist(x, bins=10, histytpe=”Dashed”)
Answer:
(c) plt.hist(x, bins=10, histype=”step”)
Question 19.
Two computers in the same part of a city, separated by a distance of 50 KM, are connected. What kind of network is formed?
(a) PAN
(b) MAN
(c) LAN
(d) WAN
Answer:
(b) MAN
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): Elements of Series can be accessed using positional index.
Reason (R): Positional index values ranges from 1 to n, if n is the size of the series.
Answer:
(c) Assertion (A) is true but Reason (R) is false.
Question 21.
Assertion (A): In SQL, the ‘GROUP BY’ clause is used to aggregate data based on a specific column.
Reason (R): The ‘GROUP BY’ clause helps in grouping similar data to apply aggregate functions such as ‘SUM’ or ‘COUNT’.
Answer:
(a) ‘GROUP BY’ is used to group rows that have the same values in specified columns.
Hence, Both A and R are true, and R is the correct explanation of A.
Section B
(7 × 2 = 14)
Question 22.
(A) How can you drop rows or columns from a DataFrame in pandas?
Or
(B) What is a DataFrame in Python Pandas? Provide an example.
Answer:
(A) Use the drop() method to remove rows or columns by specifying the axis.
Example:
df = df.drop(’column_name’, axis=1)
df = df.drop([0, 1], axis=0)
Or
(B) A DataFrame is a 2-dimensional, size-mutable, and potentially heterogeneous tabular data structure with labeled axes (rows and columns).
Example:
import pandas as pd
data = {‘Name’: [‘Alice’, ‘Bob’, ‘Charlie’], ‘Age’: [25, 30, 35]}
df = pd.DataFrame(data)
print(df)
Question 23.
Write any two steps towards awareness about health concerns related to the usage of technology.
Answer:
Two steps towards awamess about health concerns to the usage of technology:
1. Promote regular breaks and physical activity to reduce the effects of sedentary behavior.
2. Encourage proper ergonomics and screen positioning to prevent strain and injury.
Question 24.
Consider the string: “Database Normalization Techniques”. Write suitable SQL queries for the following:
I. To extract and display “Normalization” from the string.
II. Display the position of the first occurrence of “Techniques” in the given string.
Answer:
I. SELECT SUBSTRING(‘Database Normalization Techniques’, 10, 12)
AS ExtractedString;
II. SELECT CHARINDEX(‘Techniques’, ‘Database Normalization Techniques’)
AS Position;
Question 25.
(A) Navya has just created a website for her company and now need to host it. Briefly discuss the role of a web server in hosting a website.
Or
(B) Write one advantage each of star and bus topology used in networking. Draw a network layout of bus topology to connect six computers.
Answer:
(A) A web server is the residence of web pages. It is also the agent that fetches the web pages when the web pages are requested by clients. The main job of a web server is to display website content through storing, processing and delivering web pages to users. All computers that host websites must have web server software. Web servers are used in web hosting or the hosting of data for websites and web-based applications or web applications.
Or
(B) Advantage of star topology is that it is most reliable as there is a direct connection of every node with the central node or server.
Advantage of bus topology is that all nodes are connected through a single length of a cable, so very short cable length is used.
A network layout of bus topology to connect six computers is as follows:
Question 26.
Why is the GROUP BY clause used for?
Answer:
The GROUP BY Statement in SQL is used to arrange identical data into groups with the help of some functions, i.e if a particular column has same values in different rows then it will arrange these rows in a group. In the query, GROUP BY clause is placed after the WHERE clause. GROUP BY is one of the most frequently used SQL clauses. It allows you to collapse a field into its distinct values. This clause is most often used with aggregations to show one value per grouped field or combination of fields. We can use an SQL group by and aggregates to collect multiple types of information.
Question 27.
List two health hazards related to excessive use of Technology. Also list two precautions to be taken while using computers to avoid any health hazard.
Answer:
Two health hazards related to excessive use of technology:
1. Eye strain and vision problems.
2. Back and neck pain due to poor posture.
Two precautions to avoid health hazards while using computers:
1. Take regular breaks to rest your eyes and stretch.
2. Maintain good posture and use ergonomic furniture.
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 = {Name [‘Riya’, ‘Preeti’, ‘Neeta’]. ‘Age’: [25, 30, 22]}
df = pd.DataFrame(Data)
for row in df:
print(row)
Or
(B) Complete the given Python code: Create a pandas Series from a scalar value ’10’ and display the last 3 elements of the Series.
import ___________ as pd
series_data = pd.Series(___________)
print(series_data.___________ (___________))
Answer:
(A) Correct code is:
import pandas as pd
data = {‘Name’: [‘Riya’, ‘Preeti’, ‘Neeta’], ‘Age’: [25, 30, 22]}
df = pd.DataFrame(data)
for index, row in df.iterrows():
print(row)
Or
(B) Code is
import pandas as pd
series_data = pd.Series(10)
print(series data.tail(3))
Section C
(4 × 3 = 12)
Question 29.
Ms. Jayita found that her 17 year old child studying in class XII Science, is using the digital media for her studies. She came to know that children who use technology more, may be effected by psychological problems.
(i) How can excessive use of digital media impact students psychological well-being?
(ii) What are some strategies for balancing digital media use and maintaining mental health?
(iii) Why is it important for students to be mindful of their digital media usage?
Answer:
(i) Excessive use of digital media can lead to psychological problems such as increased stress, anxiety, depression, and sleep disturbances. It may also affect concentration and academic performance in students.
(ii) Students can maintain mental health by setting limits on screen time, taking regular breaks from digital devices, engaging in physical activities, practicing mindfulness or relaxation techniques, and maintaining face-to-face social interactions.
(iii) It is important for students to monitor their digital media usage because excessive screen time can negatively impact their overall well-being and academic performance. Being mindful helps in maintaining a healthy balance between online activities and other aspects of life.
Question 30.
(A) Rahul has written a code with a DataFrame and a CSV file “Emp.csv” containing records of employees as follows:
Write the Python code to read the data from the CSV file, display its first two records and then rewrite the data to a new CSV file.
Or
(B) Write a Python program to create a Pandas Series using the following dictionary. Note that the left column indicates the indices and the right column displays the data.
Answer:
(A) import pandas as pd
empdf=pd.read_csv(‘C:\\Data\\Emp.csv’)
empdf.head(2)
empdf.tocsv(‘C:\\Data\\Empnew.csv’)
Or
(B) import pandas as pd
data = {‘Japan’: ‘Tokyo’, ‘South Korea’: ‘Seoul’, ‘China’: ‘Beijing’}
series = pd.Series(data)
print(series)
Question 31.
I. Write an SQL statement to create a table named TRAIN, with the following specifications:
II. Write an SQL Query to insert the following data into the TRAIN table:
1032, Express, 120, 2024-09-10
Answer:
I. CREATE TABLE TRAIN (
TrainID Numeric PRIMARY KEY,
TrainName Varchar(30),
Seats Numeric,
Departure Date
);
II. INSERT INTO TRAIN (TrainID, TrainName, Seats, Departure)
VALUES (1032, ‘Express’, 120, ‘2024-09-10’);
Question 32.
(A) Consider the following tables SCHOOL and ADMIN and answer this question:
Write SQL statements for the following:
(i) To display TEACHERNAME, PERIODS of all teachers whose periods are more than 25.
(ii) To display DESIGNATION without duplicate entries from the table ADMIN.
(iii) To display TEACHERNAME, CODE and corresponding DESIGNATION from tables SCHOOL and ADMIN of Male teachers.
Or
(B) Write SQL commands for (i) to (iii) based on the tables Watches and Sale given below.
(i) To display all the details of those watches whose name ends with ‘Time’.
(ii) To display watch’s name and price of those watches which have price range in between 5000-15000.
(iii) To display total quantity in store of unisex type watches.
Answer:
(A) (i) SELECT TEACHERNAME, PERIODS
FROM SCHOOL WHERE PERIODS>25:
(ii) SELECT DISTINCT DESIGNATION FROM ADMIN;
(iii) SELECT TEACHERNAME.CODE
DESIGNATION FROM
SCHOOL.CODE = AOMIN.CODE
WHERE GENDER = MALE;
Or
(B) (i) SELECT * FROM WATCHES WHERE WATCH_NAME LIKE ‘%TIME’;
(ii) SELECT WATCH_NAME, PRICE WATCH WHERE PRICE BETWEEN 5000 AND 15000;
(iii) SELECT SUM (QTY STORE) FROM WATCHES WHERE TYPE LIKE ‘UNISEX’;
Section D
(2 × 4 = 8)
Question 33.
Write Python code to plot a bar chart for Mobiles sales for quarters. Also give suitable Python statement to save this chart and assign file name ‘Mybar’.
Sales | Quarters |
150 | Q1 |
200 | Q2 |
180 | Q3 |
220 | Q4 |
This Bar chart represents the Mobile Sales(in thousand) for Quarters.
import ___________ as plt #Statement-1
quarters = [‘Q1’, ‘Q2’. ‘Q3’, ‘Q4′]
sales = [150, 200, 180, 220]
pit.___________ (quarters, sales, color=’blue’) #Statement-2
plt.xlabel(‘Quarters’)
pit.___________ (‘Sales (in thousands)’) #Statement-3
pit.title(‘Mobile Sales per Quarter’)
pit.___________ (‘Mybar.png’) #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 Python statement.
Answer:
I. matplotlib.pyplot
II. bar
III. ylabel
IV. savefig
Question 34.
(A) Given below a table Bookhouse, write SQL query for part (i) to (iv).
(i) Display Publisher wise total stock value (Qty * Price).
(ii) Display Title of the book which is costliest.
(iii) Display number of books and total Price for each type of Publisher.
(iv) Display all the books where subject starts with “D” and Qty is less than 3.
Or
(B) Consider the table SUPPLIER given below. Write the output for (i) to (iv).
(i) SELECT Pname FROM SUPPLIER WHERE Supname IN (‘Bread’, ‘Maggi’);
(ii) SELECT COUNT AS DISTINCT City FROM SUPPLIER;
(iii) SELECT MAX(Price) FROM SUPPLIER WHERE City = ‘Kolkat’;
(iv) SELECT Pname FROM SUPPLIER WHERE Qty = 200;
Answer:
(A) (i) SELECT Publisher, Qty*Price AS Total_Stock_Value FROM Bookhouse GROUP BY Publisher;
(ii) SELECT Title FROM Bookhouse WHERE Price=MAX(Price);
(iii) SELECT.COUNT(*), SUM(Price) FROM Bookhouse GROUP BY Publisher;
(iv) SELECT Title FROM Bookhouse WHERE Subject LIKE ‘D%’ AND Qty<3;
Or
(B)
Section E
(3 × 5 = 15)
Question 35.
Granuda consultants are setting up a secured network for their office campus at Faridabad for their day-to-day office and web based activities. They are planning to have connectivity between 3 buildings and the head office situated in Kolkata.
Answer the questions (i) to (v) after going through the building positions in the campus and other details, which are given below.
Distance between various buildings
Building RAVI to Building JAMUNA | 120 m |
Building RAVI to Building GANGA | 50 m |
Building GANGA to Building JAMUNA | 65 m |
Faridabad Campus to Head Office | 1460 km |
Number of Computers
Building RAVI | 25 |
Building JAMUNA | 150 |
Building GANGA | 51 |
Head Office | 10 |
(i) Suggest the most suitable place (i.e. Building) to house the server of this organisation. Also, give a reason to justify your suggested location.
(ii) Suggest a cable layout of connections between the building inside the campus.
(iii) Suggest the placement of the following devices with justification
(a) Switch
(b) Repeater
(iv) Consultancy is planning to connect its office in Faridabad which is more than 10 km from head office. Which type of network will be formed?
(v) State the use of HUB?
Answer:
(i) The most suitable place to house, the server is JAMUNA because it has maximum number of computers.
(ii)
(iii) (a) Switches are needed in every building to share bandwidth in every building.
(b) Repeaters may be skipped as per above layout, (because distance is less than 100 m) however, if building RAVI and building JAMUNA are directly connected, we can place a repeater there as the distance between these two buildings is more than 100 m.
(iv) MAN
(v) A hub is a device, used with computer systems to connect several computers together. It acts as a centralised connection to several computers with the central node or server.
Question 36.
Jacqueline has created the following DataFrame consisting of data of houses of a school and the number of boys in the houses, shown as follows. She wants to perform certain operation on the data set. Help her with the correct actions.
(a) What will be the output of the following code?
(i) print (House, shape)
(ii) House.pop (“Locati on”)
print(House)
(b) She wants the “Housename” column to be the index of the DataFrame. What statement she should write?
(c) To display total number of elements in the dataframe.
(d) She wants to see the number of columns. Write the statement which will display the number of columns.
Answer:
(a) (i) (3, 3)
(ii)
(b) House.set_index(‘Housename’)
(c) House.size
(d) len(House.columns)
Question 37.
(A) Write suitable SQL queries for the following:
I. To display the total quantity from the quantity_sold column in the Sales table.
II. To display the last five characters of the phone_number column in the Contacts table.
III. To display the address column in the Customers table, after trimming any extra spaces at the beginning and end.
IV. To display the minimum value from the purchase_date column in the Transactions table.
V. To determine the total number of rows in the Inventory table.
Or
(B) Write suitable SQL query for the following:
(i) Display 7 characters extracted from 7th left character onwards from the string ‘SHINING WORLD’.
(ii) Display the position of occurrence of string ‘COME’ in the string ‘WELCOME TO NEW ERA’
(iii) Round off the value 53.78 to one decimal place.
(iv) Display the remainder of 100 divided by 9.
(v) Remove all the expected leading and trailing spaces from a column EMPID of the table ”EMP”?
Answer:
(A) I. SELECT SUM(quantity_sold) FROM Sales;
II. SELECT RIGHT(phone_number, 5) FROM Contacts;
III. SELECT TRIM(address) FROM Customers;
IV. SELECT MIN(purchase_date) FROM Transactions;
V. SELECT COUNT(*) FROM Inventory;
Or
(B) (i) SELECT SUBSTRING(‘SHINING WORLD’, 7, 7);
(ii) SELECT INSTR(‘WELCOME TO NEW ERA’, ‘COME’);
(iii) SELECT ROUND(53, 78, 1);
(iv) SELECT MOD(100, 9);
(v) SELECT TRIM(EMPID) FROM EMP;
The post CBSE Sample Papers for Class 12 Informatics Practices Set 5 with Solutions appeared first on Learn CBSE.