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 Allowed: 3 hours
Maximum Marks: 70
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each,
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 02 questions carrying 04 marks each.
7. Section E has 03 questions carrying 05 marks each.
8. All programming questions are to be answered using Python Language only.
Section – A
Question 1.
______ is a physical or virtual appliance that passes information between two or more packet-switched computer networks.
(i) Router
(ii) Switch
(iii) Both (i) & (ii)
(iv) None of these
Answer:
(i) Router
Explanation: Router is a physical or virtual appliance that passes information between two or more packet switched computer networks.
Question 2.
Which of the following data is not required for hazard identification?
(i) Land use
(ii) Contaminant levels
(iii) Affected population
(iv) Estimation of risk
Answer:
(iv) Estimation of risk
Explanation: Estimation of risk is done at risk characterization whereas land use, contaminant level, affected population and biota data play a major role while identifying a hazard.
Question 3.
Which of the following is not type of patent?
(i) Utility Patent
(ii) Design Patent
(iii) Plant Patent
(iv) Copyright Patent
Answer:
(iv) Copyright Patent
Explanation: Copyright is a type of intellectual property rights that protects original works of authorship as soon as an author fixes the work in a tangible form of expression.
Question 4.
Predict the output of the following query:
SELECT MOD (73,9);
(i) 0
(ii) NULL
(iii) NaN
(iv) 1
Answer:
(iv) 1
Explanation:
Question 5.
Which of the following SQL functions belongs to the Date functions category?
(i) NOW ( )
(ii) COUNT( )
(iii) UCASE ( )
(iv) TRUNCATE ( )
Answer:
(i) NOW ( )
Explanation: NOW( ) function belongs to the Date functions category.
Question 6.
OpenOffice is under the terms of the GNU General Public License.
(i) Office
(ii) Firefox
(iii) FOSS
(iv) All of these
Answer:
(iii) FOSS
Explanation: OpenOffice is a Free and Open-Source Software (FOSS).
Question 7.
Data files can be stored as
(i) Text file
(ii) Binary file
(iii) Both (i) & (ii)
(iv) None of these
Answer:
(iii) Both (i) & (ii)
Explanation: Data files can be stored as Text Files or Binary Files.
Question 8.
Sumit, a Database Administrator, needs to display the Total average of all teachers from those departments which have more than six employees, he is experiencing a problem while running the following query:
SELECT DEPT, AVG(PAY) FROM EMP ORDER BY DEPT HAVING COUNT()>=6;
Which of the following is a correct query to perform the given task?
(i) SELECT DEPT, AVG(*) FROM EMP WHERE COUNT!*) > 5 GROUP BY DEPT;
(ii) SELECT DEPT, AVG (*) FROM EMP HAVING COUNT!*) > 5 GROUP BY DEPT;
(iii) SELECT DEPT, AVG(PAY) FROM EMP GROUP BY DEPT HAVING COUNT(*)>6;
(iv) SELECT DEPT, AVG(PAY) FROM EMP GROUP BY DEPT WHERE COUNT (*) >=6;
Answer:
(iii) SELECT DEPT, AVG(PAY) FROM EMP GROUP BY DEPT HAVING COUNT(*)>6;
Explanation: To put a condition in a group in my SQL we need to use having clause on the other hand if we want to put condition for all individual host then we need to use where clause. Order by is used to arrange the data in ascending and descending order while group by is used to segregate the data into different groups.
Question 9.
Predict the output of the following query:
SELECT DAYOFYEAR (“2023-05-11”);
(i) 121
(ii) 131
(iii) 52
(iv) The corresponding DAY number when we execute the query.
Answer:
(ii) 131
Explanation:
Question 10.
Which of the following command will show the LAST 8 rows from a Pandas Series named NP?
(i) NP. tail ( )
(ii) NP.tail(8)
(iii) Both (i) & (ii)
(iv) None of these
Answer:
(ii) NP.tail(8)
Explanation: The tail( ) method returns a specified number of last rows. The tail( ) method returns the bottom 5 rows if a number is not specified.
Question 11.
With reference to SQL, identify the invalid data type for floating point number Values.
(i) FLOAT ( )
(ii) DOUBLE ( )
(iii) DECIMAL ( )
(iv) All of the above
Answer:
(iv) All of the above
Explanation: FLOAT, DOUBLE & DECIMAL are the DataTypes which can store a floating point number Values.
Question 12.
In Python programming will be the output of the given expression:
print(print(ord(‘A’)+ord(‘b’)),ord(‘D’))
(i) 163 68
(ii) 163 None 68
(iii) 163 68
(iv) 131 68
Answer:
(ii) 163 None 68
>>>print (print (ord (‘A’) +ord ( ‘ b’) ) , or d(‘D’)
163
None 68
>>>
Question 13.
Trade mark:
(i) is represented graphically
(ii) is capable of distinguishing the goods or services of one person from those of others
(iii) may include shapes of goods or combination of colours
(iv) All of these
Answer:
(iv) All of these
Explanation: All options are valid for Trade Mark.
Question 14.
The storage size in bytes required for the MEDIUMINT datatype is ______
(i) 1
(ii) 2
(iii) 3
(iv) 4
Answer:
(iii) 3
Explanation: The numeric datatypes used in MySQL vary over ranges. There are a variety of INT types in the type specification. TINYINT requires 1, SMALLINT requires 2 bytes and MEDIUMINT requires 3.
Question 15.
Which clause is used with “aggregate functions”?
(i) GROUP BY
(ii) SELECT
(iii) WHERE
(iv) Both (i) & (ii)
Answer:
(i) GROUP BY
Explanation: Aggregate functions are often used with Group By clause in the Select statement.
Question 16.
Which one of the creative commons licenses are considered for commercial use?
(i) BY-NC-ND
(ii) BY-ND
(iii) BY-NC
(iv) All of these
Answer:
(ii) BY-ND
Explanation: BY-ND is the creative commons licenses are considered for commercial use.
Question 17.
Assertion (A):- The sole purpose of the modem is to provide you with internet access.
Reasoning (R): – If you were to only have one internet-connected device with an Ethernet port you could connect the modem directly to your computer with no need for a router.
(i) Both A and R are true and R is the correct explanation for A
(ii) Both A and R are true and R is not the correct explanation for A
(iii) A is True but R is False
(iv) A and R both are False
Answer:
(ii) Both A and R are true and R is not the correct explanation for A
Question 18.
Read the statements given below. Identify the right option from the following for Attribute and method/function.
Assertion (A): Attribute always ends without parenthesis.
Reasoning (R): Function/Method cannot work without arguments.
(i) Both A and R are true and R is the correct explanation for A
(ii) Both A and R are true and R is not the correct explanation for A
(iii) A is True but R is False
(iv) A and R both are False
Answer:
(iii) A is True but R is False
Section B
Question 19.
Explain the terms Web page and Home Page.
OR
Mention any four networking goals.
Answer:
Web Page: A Web Page is a part of a website and is commonly written in HTML. It can be accessed through a web browser.
Home Page: It is the first web page you see when you visit a website.
OR
Four networking goals are:
(i) Resource sharing
(ii) Reliability
(iii) Cost effective
(iv) Fast data sharing
Question 20.
The python code written below has syntactical errors. Rewrite the correct code and underline the corrections made.
import Pandas as pd MP ={"no":["AB1","AB2","AB3"],"DEPT":["CHEM","ACCT","MNGR"]} df= Pd.dataframe(comp) print(Df)
Answer:
import pandas as pd MP={"no":["ABl","AB2","AB3"], "DEPT”:["CHEM","ACCT","MNGR"]} df = pd.DataFrame(MP) print(df)
Question 21.
Consider the given SQL string:
“The sun rises in The East”
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 four characters from the string.
Answer:
(i) SELECT INSTR(“The sun rises in The East”,”The”);
(ii) SELECT RIGHT(“The sun rises in The East”,4);
Question 22.
Give the output of the code:
import pandas as pd a = pd.DataFrame ([2,4,8], index = [''Two", ''Four", "Eight"] , columns = ["Val"]) print(a[1:5])
Answer:
Output:
Question 23.
What causes a digital footprint?
Answer:
Whenever you use the internet, you leave behind a trail of information known as your digital footprint A digital footprint grows in many ways – for example, posting on social media, subscribing to a newsletter, leaving an online review, or shopping online.
Question 24.
Complete the given Python code to get the required output of whole Dataframe.
import ____ as pd t = {"roll": [10,12,13], "Name": ["sahil", "ayus", "Subir"], "Age": [8, 7, 9], "Marks": [77.5, 70.4, 60.9]} df = ____.DataFrame (____, index= [ 'A' , ' B' , ' C ] ) print (____)
Answer:
import pandas as t={"roll”: [10,12, 13], "Name":["shail", "ayus","Subir"], "Age":[8,7,9] "Marks": [77.5,70.4,60.9] } df=pd.DataFrame (t,index['A','B', 'c'] print (df)
Question 25.
Which aggregate function is required to calculate the Sum of salary in my SQL table? Give the syntax to get the sum of all salary which is more than the average salary in SQL?
Answer:
The aggregate function Sum() is required to calculate the Sum value with in a particular column.
SELECT SUM(SALARY) FROM Employee WHERE SALARY < (SELECT AV6(SALARY) FROM Employee);
Consider column name is salary and the table name is employee.
Section C
Question 26.
Based on the SQL table Store, write suitable queries for the following:
Table: Store
(i) To display names of stores along with Sales Amount of those stores which are located in Mumbai.
(ii) To display the details of store in alphabetical order of name.
(iii) To display the City and the number of stores located in that City, only if number of stores is more than 2.
Answer:
(i) SELECT NAME, SALESAMT FROM STORE WHERE CITY=’MUMBAI’;
(ii) SELECT * FROM STORE ORDER BY NAME;
(iii) SELECT CITY, COUNT (*) FROM STORE GROUP BY STORE HAVING COUNT(*)>2;
OR
Predict the output of the following queries based on the table Store given above:
(i) SELECT MIN (DATEOPEN) FROM STORE;
(ii) SELECT COUNT (STOREID) , NOOFEMP FROM STORE GROUP BY NOOFEMP HAVING MAX(SALESAMT)<60000;
(iii) SELECT MAX (DATEOPEN) FROM STORE;
Answer:
Question 27.
Write the code in pandas to create the following dataframes :
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] }) print(df1) print(df2)
Question 28.
Write MySQL statements for the following:
(i) To create a database named DPS_School.
(ii) To create a table named Student based on the following specification:
Column Name | Data Type | Constraints |
RL_NO | Integer | Primary Key |
SNAME | Varchar(20) | NOT NULL |
Marks | Float | UNIQUE |
Answer:
(i) CREATE DATABASE DPS_School;
(ii) CREATE TABLE Student (RL_NO INTEGER PRIMARY KEY, SNAME VARCHAR(20) NOT NULL, Marks FLOAT UNIQUE);
Question 29.
Rohit a student of class 12 had opened a FaceBook account newly. He received Friend request from a group of class 12 girls from his school. After some time, He starts getting negative comments on his posts. Based on the given information, answer the questions given below.
(i) Identify the type of cybercrime he is a victim of.
(ii) What do you mean by cyberbullying?
(iii) How to prevent cyberbullying?
Answer:
(i) Cyberbullying
(ii Cyberbullying is bullying with the use of digital technologies. It can take place on social media, messaging platforms, gaming platforms and mobile phones.
(iii)
- Establish a climate of communication with your child
- Monitor online activity
- Know the apps and platforms
- Give them strategies to respond
OR
How to identify a hazard?
Answer:
OR
Identifying hazards:
(1) Observing how work tasks are being performed.
(2) Assessing the equipment workers are using, and considering how that equipment is being used.
(3) Analyzing the design and layout of the work areas.
Question 30.
Given a data frame df1 as shown below:
(i) Write command to compute sum of every column of the data frame.
(ii) Write command to compute mean of column Rainfall.
(iii) Write command to compute Median of the Maxtemp Column.
Answer:
(i) df1.sum( )
(ii) dfl [‘Rainfall’] .mean ( )
(iii) df1.loc[:, ‘Maxtemp’].median( )
Section D
Question 31.
Consider the table FANS and answer the following.
FANS
Write SQL queries for the following:
(i) To display the details of fans in descending order of their DOB
(ii) To display the details of FANS who does not belong to AJMER
(iii) To count the total number of fans of each fan mode
(iv) To display the dob of the youngest fan.
Answer:
(i) SELECT * FROM FANS ORDER BY FAN_DOB .DESC;
(ii) SELECT * FROM FANS WHERE FAN_ CITYO’AJMER’ ;
(iii) SELECT FAN_MODE, COUNT (* ) FROM FANS GROUP BY FAN_MODE;
(iv) SELECT MAX ( FAN_DOB) FROM FANS;
Question 32.
Write the commands to do the following operations on the dataframes given above :
(i) (a) To add dataframes df1 and df2.
(b) To subtract df2 from df1.
(ii) To rename column rnarkl as rnarksl in both the dataframes df1 and df2.
(iii) To change index label of df1 from 0 to zero and from 1 to one.
OR (Option for part iii only)
Write Python statement to export the DataFrame df1 to a CSV file named book. csv stored at D: drive.
Answer:
(i) (a) print (df1. add (df2) )
b)print(dfl.subtract(df2))
(ii) df1.rename(columns={‘markl’:’mar .’ksl’}, inplace=True)
print(dfl)
(iii) dfl. rename (index = {0: “zero”,1: “one”}, inplace = True)
print(dfl)
OR
(iv) dfl. to_csv (“D: \book. csv”)
Section E
Question 33.
Write the SQL functions which will perform the following operations:
(i) To get the number of characters of a string.
(ii) To get a specified number of rightmost character from a string.
(iii) To get the day of the month for specified date.
(iv) To return the day number of the year index of a date.
(v) To return the number of rows, excluding rows with NULL values.
Answer:
OR
Carefully observe the following table named ‘stock’ and write SQL queries:
(i) To display the records in decreasing order of price.
(ii) To display category and category wise total quantities of products.
(iii) To display the category and its average price category wise.
(iv) To display category and category wise highest price of the products.
(v) To display category and category wise lowest price of the products.
Answer:
(i) select * from stock order by price desc;
(ii) select category, sum(gty) from stock group by category;
(iii) select category,avg(price) from stock group by category;
(iv) select category, max (price) from stock group by category;
(v) select category, min(price) from stock group by category;
Question 34.
“Anutulya Creations”-A start-up fashion house has set up its main centre at Kanpur, Uttar Pradesh for its dress designing, production and dress supplying activities. It has 4 blocks of buildings.
Distance between the various blocks is as follows:
A to D 50 m
A to P 60 m
A to S 110m
D to S 60m
P to S 50m
P to D 150m
Numbers of computers in each block
Block A-20
Block D-80
Block P-15
Block S – 8
Based on the above specifications, answer the following questions:
(i) Out of LAN, WAN and MAN, what type of network will be formed if we interconnect different computers of the campus? Justify.
(ii) Suggest the topology which should be used to efficiently connect various blocks of buildings within Kanpur ‘ centre for fast communication. Also draw the cable layout for the same.
(iii) Suggest the placement of the following device with justification:
a. Repeater
b. Hub/Switch
(iv) Now a day, video-conferencing software is being used frequently by the company to discuss the product details with the clients. Name any one video conferencing software.
Also mention the protocol which is used internally in video conferencing software.
(v) Suggest the placement of the Server.
Answer:
(i) LAN
As computers are placed with-in the same campus within a small range.
(ii) Star topology
(iii) a) Repeater should be placed in between Block ‘D’ (Design) and Block T’ as distance is more.
b) Hub/Switch should be placed in each building to connect various computers together.
(iv) Video Conferendng software: Teams, Zoom, Skype, etc.
Protocol of Video Conferencing software: VoIP
(v) Since the block D is having most number of computers that is 80. So, as per 80-20 rule the most suitable place to set up the server is the block D.
Question 35.
The price of 10 Items and the intervals are given below:
Price_item=[10,15,20,26,30,40,42,45,50,48,36]
b=[10,20,30,40,50] .
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.
Answer:
import matplotlib.pyplot as plt Price_item=[10,15,20,26,30,40,42,45,50,48,36,17] b=[10,20,30,40,50] plt.hist(Price_item,bins=b) plt.title("Hist_Chart") plt.xlabel("X-axis") plt.ylabel("Y-axis") plt.show( ) plt. savefig ("ABC. jpg")
OR
Write suitable Python code to create ‘FRUIT_Info’ Bar Chart as shown below:
Also give suitable python statement to save this chart.
Answer:
import matplotlib.pyplot as plt FRUIT= ('APPLE', 'GUAVA', 'BANANA', 'blackberry') PRICE = [70,50,20,60] plt.bar(FRUIT, PRICE, color=["r","g","y","k"]) plt.title("FRUIT_Info") plt.ylabel("PRICE") plt.xlabel("FRUIT") plt.show( ) plt. savefig ("FRUIT . jpg")