Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 1 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 1 with Solutions
Time Allowed: 3 hours
Maximum Marks: 70
General Instructions:
- This question paper contains five sections, Section A to E.
- All questions are compulsory.
- Section A has 18 questions carrying 01 mark each.
- Section B has 07 Very Short Answer type questions carrying 02 marks each.
- Section C has 05 Short Answer type questions carrying 03 marks each.
- Section D has 02 questions carrying 04 marks each.
- Section E has 03 questions carrying 05 marks each.
- All programming questions are to be answered using Python Language only.
Section – A
Question 1.
A _____ is a device that connects the organisation’s network with the outside world of the Internet. [1]
(a) Hub
(b) Modem
(c) Gateway
(d) Repeater
Answer:
(c) Gateway
Question 2.
When e-waste such as electronic circuit boards are burnt for disposal, the elements contained in them create a harmful chemical called _____ which causes skin diseases, allergies and an increased risk of lung cancer. [1]
(a) Hydrogen
(b) Beryllium
(c) Chlorine
(d) Oxygen
Answer:
(b) Beryllium
Question 3.
Copyright, Patent and Trademark comes under [1]
(a) Intellectual Property Right
(b) Individual Property Right
(c) Industrial Property Right
(d) None of these
Answer:
(a) Intellectual Property Right
Question 4.
Predict the output of the following query [1]
SELECT MOD (9,0);
(a) 0
(b) NULL
(c) NaN
(d) 9
Answer:
(b) NULL
Question 5.
Which of the following SQL functions does not belong to the Math functions category? [1]
(a) POWER()
(b) ROUND()
(c) LENGTH()
(d) MOD()
Answer:
(c) LENGTH()
Question 6.
____ is not a FOSS tool. [1]
(a) Libre Office
(b) Mozilla Firefox
(c) Google Chrome
(d) Python
Answer:
(c) Google Chrome
Question 7.
CSV stands for: [1]
(a) Column Separated Value
(b) Class Seperated Value
(c) Comma Separated Value
(d) None of these
Answer:
(c) Comma Separated Value
Question 8.
Raj, a Database Administrator, needs to display the average pay of workers from those departments which have more than five employees. He is experiencing a problem while running the following query:
SELECT DEPT, AVG(SAL) FROM EMP WHERE COUNT(*) > 5 GROUP BY DEPT;
Which of the following is a correct query to perform the given task? [1]
(a) SELECT DEPT, AVG(SAL) FROM EMP WHERE COUNT(*) ) 5 GROUP BY DEPT;
(b) SELECT DEPT. AVG(SAL) FROM EMP HAVING CO(JNT(*) > 5 GROUP BY DEPT;
(c) SELECT DEPT. AVG(SAL) FROM EMP GROUP BY DEPT WHERE COUNT(*) > 5.
(d) SELECT DEPT. AVG(SAL) FROM EMP GROUP BY DEPT HAVING COUNT(*) > 5:
Answer:
(d) SELECT DEPT, AVG(SAL) FROM EMP GROUP BY DEPT HAVING COUNT(*) > 5;
Question 9.
Predict the output of the following query: [1]
SELECT LCASE (MONTHNAMEC2023-03-05′));
(a) May
(b) March
(c) may
(d) march
Answer:
(d) march
Question 10.
Which of the following command will show the last 3 rows from a Pandas Series named NP? [1]
(a) NP.Tail( )
(b) NP.tail(3)
(c) NP.TAIL(3)
(d) All of these
Answer:
(b) NPtail(3)
Question 11.
With reference to SQL, identify the invalid data type. [1]
(a) Date
(b) Integer
(c) Year
(d) Month
Answer:
(d) Month
Question 12.
In Python Pandas, while performing mathematical operations on series, index matching is implemented and all missing values are filled in with by default. [1]
(a) Null
(b) Blank
(c) NaN
(d) Zero
Answer:
(c) NaN
Question 13.
By restricting the server and encrypting the data, a software company’s server is unethically accessed in order to obtain sensitive information. The attacker blackmails the company to pay money for getting access to the data, and threatens to publish sensitive information unless price [1]
(a) Phishing
(b) Identity Theft
(c) Plagiarism
(d) Ransomware
Answer:
(d) Ransomware
Question 14.
In SQL, the equivalent of UCASE() is [1]
(a) UPPERCASE ()
(b) CAPITALCASE()
(c) UPPER()
(d) TITLE ()
Answer:
(c) UPPER()
Question 15.
Collection of hyper linked documents available on the internet is known as_____________ [1]
(a) Website
(b) Webpage
(c) Web Server
(d) Web Hosting
Answer:
(a) Website
Question 16.
_____________is a non-profit organisation that aims to build a publicly accessible global platform where a range of creative and academic work is shared freely. [1]
(a) Creative Cost
(b) Critical Commons
(c) Creative Commons
(d) Creative Common
Answer:
(c) Creative Commons
Question 17.
Assertion (A) MODEM stands for modulator-demodulator.
Reason (R) It is a computer hardware device that converts data from a digital format to analog and vice versa. [1]
(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
Answer:
(a) Both A and R are true and R is the correct explanation for A
Question 18.
Assertion (A) To use the Pandas library in a Python program, one must import it. [1]
Reason (R) The only alias name that can be used with the Pandas library is pd.
(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
Answer:
(c) A is True but R is False
Section – B
Question 19.
Briefly explain the basic concepts of a web server and web hosting. [2]
Or
Rati is doing a course in networking. She is unable to understand the concept of URL. Help her by explaining it with the help of suitable example.
Answer:
Web Server It is a program that runs on a computer connected to the internet. The primary function of a web server is to deliver web pages on the request of client using the HTTP
Web Hosting Web hosting service is a type of Internet hosting service that allows individuals and organisations to make their website accessible via the world wide web.
Or
URL stands for Uniform Resource Locator that uses the HTTP protocol. It provides the location and mechanisms (protocol) to access the resources over the Internet. URL is also called as web address.
e.g. http://www.microsoft.com
Question 20.
The python code written below has syntactical errors. Rewrite the correct code and underline the corrections made. [2]
Import pandas as pd df ={"Technology":["Programming", "Robotics","3D Printing"],"Time(in months)":[4, 4, 3]} df = Pd.dataframe(df) Print(df)
Answer:
Correct code is
Import pandas as pd df={“Technology”:["Programming", “Robotics”,"3D Printing”], “Time(in months)”:[4, 4, 3]} df=pd.DataFrame (df) print(df)
Question 21.
Consider the given SQL string [2]
“12#All the Best!”
Write suitable SQL queries for the following
(i) Returns the position of the first occurrence of the substring “the” in the given string.
(ii) To extract last five characters from the string.
Answer:
(i) SELECT INSTR(“12#All the Best!”,“the”);
(ii) SELECT RIGHT(“12#All the Best!”, 5);
Question 22.
Predict the output of the given Python code [2]
import pandas as pd list1=[-10,-20,-30] ser=pd.Series(list1*2) print(ser)
Answer:
Output
0 -10
1 -20
2 -30
3 -10
4 -20
5 -30
dtype : int64
Question 23.
Differentiate between the active digital footprint and passive digital footprints. [2]
Answer:
Differences between active digital footprint and passive digital footprint are as follows
Active digital footprint | Passive digital footprint |
Active digital footprint is where the user has deliberately shared information about themselves either by using social media sites or by using websites. | Passive digital footprint is made when information is collected from the user without the person knowing this is happening. |
e.g. Posting on Facebook, Instagram, Snapchat, Twitter and other social media platforms. | e.g. Websites that install cookies in your device without disclosing it to you. |
Question 24.
Complete the given Python code to get the required output as: Rajasthan [2]
import ____ as pd di = {'Corbett':'Uttarakhand', 'Sariska': 'Rajasthan', 'Kanha': 'Madhya Pradesh', 'Gir' : 'Gujarat'} NP = ____ Series( ____ ) print(NP[____])
Answer:
Complete code is
import pandas as pd di={'Corbett':'Uttarakhand', 'Sariska':'Rajasthan', ’Kanha':'Madhya Pradesh', ’Gir':'Gujarat'} NP = pd.Series (di) print(NP['Sariska'])
Question 25.
What are aggregate functions in SQL? Name any two. [2]
Answer:
Aggregate functions are also known as group functions or multiple row functions. These functions are used to perform the calculations on multiple rows of a single column of a table. It returns a single value.
Some aggregate functions are SUM( ), MAX( ), MIN( ), AVG( ),COUNT(), etc.
Section – C
Question 26.
Based on the SQL table CAR SALES, write suitable queries for the following [3]
(i) Display fuel wise average sales in the first quarter.
(ii) Display segment wise highest sales in the second quarter.
(iii) Display the records in the descending order of sales in the second quarter.
Or
Predict the output of the following queries based on the table CAR SALES given above:
(i) SELECT LEFT(SEGMENT,2) FROM CAR_SALES WHERE FUEL= “PETROL”;
(ii) SELECT (QT2 – QTl)/2 “AVG SALE” FROM CAR_SALES WHERE SEGMENT= “SUV”;
(iii) SELECT SUM(QT1) “TOT SALE” FROM CAR_SALES WHERE FUEL= “DIESEL”;
Answer:
(i) SELECT FUEL, AVGCQTl) FROM CAR_SALES GROUP BY FUEL;
(ii) SELECT SEGMENT, MAX (QT2) FROM CAR_SALES GROUP BY SEGMENT;
(iii) SELECT*FROM CAR_SALES ORDER BY QT2 DESC;
Or
Question 27.
Create a DataFrame in Python from the given list [3]
[[‘Divya’,’HR’ ,95000],[‘Marita’, ‘Marketing’, 97000], [‘Payal’,’IT’ ,980000], [‘Deepak’, ‘Sales’, 79000]]
Also give appropriate column headings as shown below
Name | Department | Salary | |
0 | Divya | HR | 95000 |
1 | Mamta | Marketing | 97000 |
2 | Payal | IT | 98000 |
3 | Deepak | Sales | 79000 |
Answer:
import pandas as pd df = [["Divya","HR",95000], ["Mamta", "Marketing", 97000], ["Payal", df =pd.DataFrame(df,columns=["Name", "Department", "Salary"]) print(df)
Question 28.
Write MySQL statements for the following [3]
(i) To create a database named FOOD.
(ii) To create a table named Nutrients based on the following specification
Column Name | Data Type | Constraints |
Food_item | Varchar (20) | Primary Key |
Calorie | Integer |
Answer:
(i) CREATE DATABASE FOOD;
(ii) CREATE TABLE Nutrients
(Food_Item Varchar(20) Primary Key, Calorie Integer
Question 29.
Richa, recently started using her social media account. Within a few days, she befriends many people she knows and some that she does not know. After some time, she starts getting negative comments on her posts. She also finds that her pictures are being shared online without her permission.
Based on the given information, answer the questions given below. [3]
(i) Identify the type of cybercrime she is a victim of.
(ii) Under which act, she can lodge a complaint to the relevant authorities?
(iii) Suggest her any two precautionary measures which she should take in future while being online to avoid any such situations.
Or
Mention any three health hazards associated with inappropriate and excessive use of gadgets.
Answer:
(i) Cyber Bullying
(ii) IT Act 2000
(iii) (a) Never share her password with others.
(b) Never share her personal information on social media.
Or
- Get headaches, but too much screen time can bring one on.
- Too much time on a device does not just drain the brain, its tires the body too.
- Using technology too close to bedtime may cause issues with sleep.
Question 30.
Consider the given DataFrame ‘Genre’ [3]
Type | Code | |
0 | Fiction | F |
1 | Non Fiction | NF |
2 | Drama | D |
3 | Poetry | P |
Write suitable Python statements for the following:
(i) Add a column called Num_Copies with the following data: [300,290,450,760],
(ii) Add a new genre of type ‘Folk Tale’ having code as “FT” and 600 number of copies.
(iii) Rename the column ‘Code’ to ‘Book_Code’.
Answer:
(i) Genre [ ” Num_Copies ‘ ‘] = [300, 290, 450, 760]
(ii) Genre. loc[4] = [‘Folk Tale’, ’FT’, 600]
(iii) Genre = Genre . rename ({“Code” : “Book_Code” 1, axis = 1)
Section – D
Question 31.
Preeti manages database in a blockchain start-up. For business purposes, she created a table named BLOCKCHAIN. Assist her by writing the following queries [4]
TABLE : BLOCKCHAIN
(i) Write a query to display the year of oldest transaction.
(ii) Write a query to display the month of most recent transaction.
(iii) Write a query to display all the transactions done in the month of May.
(iv) Write a query to count total number of transactions in the year 2022.
Answer:
(i) SELECT YEAR(MIN(transaction_date)) FROM BLOCKCHAIN;
(ii) SELECT M0NTH(MAX (transaction_date)) FROM BLOCKCHAIN;
(iii) SELECT* FROM BLOCKCHAIN WHERE MONTHNAME(transaction_date) = “May”;
(iv) SELECT COUNT (ID) FROM BLOCKCHAIN WHERE YEAR(transaction_date) = 2022;
Question 32.
Ekam, a Data Analyst with a multinational brand has designed the DataFrame df that contains the four quarter’s sales data of different stores as shown below [4]
Store | Qtr1 | Qtr2 | Qtr3 | Qtr4 | |
0 | Store1 | 300 | 240 | 450 | 230 |
1 | Store2 | 350 | 340 | 403 | 210 |
2 | Store3 | 250 | 180 | 145 | 160 |
Answer the following questions
(i) Predict the output of the following python statement
(a) print(df.size)
(b) print(df[1 : 3])
(ii) Delete the last row from the DataFrame.
(iii) Write Python statement to add a new column Total Sales which is the addition of all the 4 quarter sales.
Or (Option for part iii only)
Write Python statement to export the DataFrame to a CSV file named data.csv stored at D: drive.
Answer:
(i) (a) 15
(b)
Store | Qtr1 | Qtr2 | Qtr3 | Qtr4 |
1 Store2 | 350 | 340 | 403 | 210 |
2 Store3 | 250 | 180 | 145 | 160 |
(ii) df=df.drop(2)
(iii) df [“Total_Sales”] = df[“Qtr1”] + df[“Qtr2”] + df[“Qtr3”]+ df[“Qtr4″]
Or df.to_csv(”D:\data.csv”)
Section – E
Question 33.
Write suitable SQL queries for the following [5]
(i) To calculate the exponent for 3 raised to the power of 4.
(ii) To display current date and time.
(iii) To round off the value – 34.4567 to 2 decimal place.
(iv) To remove all the probable leading and trailing spaces from the column userid of the table named user.
(v) To display the length of the string ‘FIFA World Cup’.
Or
Kabir has created following table named exam
Reg No | Name | Subject | Marks |
1 | Sanya | Computer Science | 98 |
2 | Sanchay | IP | 100 |
3 | Vinesh | CS | 90 |
4 | Sneha | IP | 99 |
5 | Akshita | IP | 100 |
Help him in writing SQL queries to the perform the following task
(i) Insert a new record in the table having following values [6,’Khushi’,’CS’,85]
(ii) To change the value “IP” to “Informatics Practices” in subject column.
(iii) To remove the records of those students whose marks are less than 30 .
(iv) To add a new column Grade of suitable datatype.
(v) To display records of “Informatics Practices” subject.
Answer:
(i) SELECT P0WER(3, 4);
(ii) SELECT NOW();
(iii) SELECT ROUND(-34, 4567 , 2);
(iv) SELECT TRIM(userid) FROM USER;
(v) SELECT LENGTH (“FIFA World Cup”);
Or
(i) INSERT INTO EXAM VALUES (6, “Khushi”, “CS”, 85);
(ii) UPDATE EXAM SET subject = “Informatics Practices” WHERE Subject = “IP”;
(iii) DELETE FROM EXAM WHERE Marks <30;
(iv) ALTER TABLE EXAM ADD COLUMN Grade Varchar (2);
(v) SELECT * FROM EXAM WHERE Subject = “Informatics Practices”;
Question 34.
XYZ Media house campus is in Delhi and has 4 blocks named Z1, Z2, Z3 and Z4. The tables given below show the distance between different blocks and the number of computers in each block. [5]
Block Z1 to Block Z2 | 80 metres |
Block Z1 to Block Z3 | 65 metres |
Block Z1 to Block Z4 | 90 metres |
Block Z2 to Block Z3 | 45 metres |
Block Z2 to Block Z4 | 120 metres |
Block Z3 to Block Z4 | 60 metres |
Block | Number of computers |
Z1 | 135 |
Z2 | 290 |
Z3 | 180 |
Z4 | 195 |
The company is planning to form a network by joining these blocks.
(i) Out of the four blocks on campus, suggest the location of the server that will provide the best connectivity. Explain your response.
(ii) For very fast and efficient connections between various blocks within the campus, suggest a suitable topology and draw the same.
(iii) Suggest the placement of the following devices with justification
(a) Repeater
(b) Hub/Switch
(iv) VoIP technology is to be used which allows one to make voice calls using a broadband internet connection. Expand the term VoIP.
(v) The XYZ Media House intends to link its Mumbai and Delhi centers. Out of LAN, MAN, or WAN, what kind of network will be created? Justify your answer.
Answer:
(i) Block Z2 is the most suitable location of the server because it has maximum number of computers,
(ii) Star Topology
(iii)
(a) Repeater should be installed between Z2 and Z4 as distance is more than 100 m.
(b) Switch should be installed in each block to connect several computers.
(iv) Voice over Internet Protocol
(v) WAN (Wide Area Network)
Question 35.
The heights of 10 students of eighth grade are given below: [5]
Height_cms=[145, 141, 142, 142, 143, 144, 141, 140, 143, 144]
Write suitable Python code to generate a histogram based on the given data, along with an appropriate chart title and both axis labels. Also give suitable python statement to save this chart.
Or
Write suitable Python code to create ‘Favourite Hobby’ Bar Chart as shown below
Also give suitable python statement to save this chart.
Answer:
import matplotlib.pyplot as plt Height_cms=[145,141,142,142.143,144, 141,140,143,144] plt.hist(Height_cms) plt.title("Height Chart of Students") pit.xlabel("Height in cms") plt.ylabel("Number of Students") plt.show( ) plt.savefig("data.jpg")
Or
import matplotlib.pyplot as plt hobby=(’Dance', 'Music', ’Painting', 'Playing Sports') users=[300, 400, 100, 500] pit.bar(hobby.users) plt.title("Favourite Hobby") plt.ylabel("Number of people") plt.xlabel("Hobbies”) plt.show( ) pit.savefig("nobbles.jpg")