Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 2 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 2 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.
In _____, users share their activities intentionally like social media activities, online chatting. [1]
(a) Passive digital footprint
(b) Active digital footprint
(c) Both (a) and (b)
(d) None of these
Answer:
(b) Active digital footprint
Question 2.
_____ is an act of copying another person’s idea, words or work and pretend that they are our own. [1]
(a) Copyright
(b) Virus
(c) Plagiarism
(d) IPR
Answer:
(c) Plagiarism
Question 3.
What will be the output of the given code?
import pandas as pd s = pd.Series([1, 2, 3, 4, 5]. index=[‘akram', 'brijesh', 'charu', ‘deepika', 'era']) print(s['charu'])
(a) 1
(b) 2
(c) 3
(d) 4
Answer:
(c) 3
Question 4.
Feasible method(s) to manage e-Waste. [1]
(a) Reducing
(b) Reusing
(c) Recycling
(d) All of these
Answer:
(d) All of these
Question 5.
Which of the following is the correct syntax of LCASE() function? [1]
(a) LCASE (row_name)
(b) LCE (column_name)
(c) LCASE (str/column_name)
(d) None of these
Answer:
(c) LCASE (str/column_name)
Question 6.
head( ) function is used to return first ………. rows. [1]
(a) n-1
(b) n+1
(c) n2
(d) n
Answer:
(d) n
Question 7.
Abdul deleted all his chats from all his social media accounts and he thinks that all his traces are deleted completely. Is he right in thinking so? [1]
(a) Yes
(b) No
(c) May be
(d) Not sure
Answer:
(b) No
Question 8.
What is a correct syntax to return the values of first row of a Pandas DataFrame? Assuming the name of the DataFrame is dfRent. [1]
(a) dfRent[0]
(b) dfRent.loc[1]
(c) dfRent.loc[0]
(d) dfRent.iloc[1]
Answer:
(c) dfRent.loc[0]
Question 9.
________ network is formed, when you connect two mobiles using bluetooth to transfer a picture file. [1]
(a) LAN
(b) MAN
(c) PAN
(d) WAN
Answer:
(c) PAN (Personal Area Network)
Question 10.
The MySQL function returns the specified number of characters from a particular position of a given string. [1]
(a) MID()
(b) SUBSTRING ()
(c) SUBSTR ()
(d) All of these
Answer:
(d) All of these
Question 11.
Geometric arrangement of devices on the network is called [1]
(a) topology
(b) protocols
(c) media
(d) LAN
Answer:
(a) topology
Question 12.
Which of the following SQL statement will give output as 190.5 after execution? [1]
(a) SELECT ROUND(190.52, 0);
(b) SELECT ROUND(190.52, -1);
(c) SELECT ROUND(190.52, 2);
(d) SELECT ROUNO(190.52, 1);
Answer:
(d) SELECT ROUND(190.52, 1);
Question 13.
We should exhibit proper manners and etiquettes while being online, is the right netiquette(s). [1]
(a) Avoid cyber bullying
(b) Respect other’s privacy
(c) No copyright violation
(d) All of these
Answer:
(d) All of these
Question 14.
Supriya has following code to insert a record in table ‘salesman’, but getting error. Help her in writing appropriate code. [1]
INSERT EMP VALUES (‘203’, ‘RAJU’, ‘DELHI’);
(a) INSERT IN EMP VALUES (‘203’, ‘RAJU’, ‘DELHI’);
(b) INSERT EMP VALUES (‘203’, ‘RAJU’, ‘DELHI’);
(c) INSERT TO EMP VALUES (‘203’, ‘RAJU’, ‘DELHI’);
(d) INSERT INTO EMP VALUES (‘203’, ‘RAJU’, ‘DELHI’);
Answer:
(d) INSERT INTO EMP VALUES (‘203’, ‘RAJU’, ‘DELHI’);
Question 15.
In the given query which keyword has to be inserted? [1]
INSERT INTO employee ____ (1002, “Kausar”, 2000);
(a) Table
(b) Values
(c) Relation
(d) Field
Answer:
(b) Values
Question 16.
Which aggregate function returns the count of all rows in a specified table? [1]
(a) SUM()
(b) DISTINCT ()
(c) COUNT ()
(d) None of these
Answer:
(c) COUNT()
Directions (Q.Nos. 17-18) Assertion and Reason based Questions.
Question 17.
Assertion (A) Social media are websites or applications that enable their users to participate in social networking but they cannot create and share content with others in the community. [1]
Reason (R) We should not waste precious time in responding to unnecessary emails or comments unless they have some relevance for us.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(с) A is true but R is false.
(d) A is false but R is true.
Answer:
(d) In social networking, we can create and share content with others in the community. We must respect time and be precise. We should not waste precious time in responding to unnecessary emails.
Question 18.
Assertion (A) Boolean indexing is a type of indexing. [1]
Reason (R) Boolean vectors can be used to filter the data.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of 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 of A.
Section – B
Question 19.
What is the advantage of using switch over hub? [2]
Or
List two differences between a website and a web page.
Answer:
- A switch is faster than a hub.
- A switch offers full-duplex communication while a hub offers Only half-duplex.
Or
Differences between website and web page are as follows
Website | Web Page |
It is a group of related web pages addressed to a typical URL. | It is a part of website which comprises links to other web pages. |
There is no extension used in the URL of a website, e.g. Amazon, Flipkart etc. | The web page URL has an extension, e.g. Contact pages, registration, login etc. |
Question 20.
The Python code written below has syntactical errors. Rewrite the correct code and underline the corrections made. [2]
Import pandas as pd import Numpy as np arr = np.array([1, 2, 3, 4, 5]) my_Series = pd.Series(arr) print(my_series)
Answer:
Correct code is:
import pandas as pd import numpy as np arr = np.array([1, 2, 3, 4, 5]) my_series = pd.Series(arr) print(my_series)
Question 21.
Complete the given Python code to Create a DataFrame from the following dictionary ‘data_dict’, and print the sum of all the values in the ‘sales’ column. [2]
import ____ as pd data_dict = {'item': ['A', ’B', 'C', 'D']. 'sales' : [50, 30, 45, 20]} df = pd.DataFrame(____) print (df ['sales']. ____( ))
Answer:
Correct code is:
import pandas as pd data_dict = {'item': ['A', 'B', 'C', 'D'], 'sales': [50, 30, 45, 20]} df = pd.DataFrame(data_dict) print(df['sales'].sum())
Question 22.
What will be the output of the following code [2]
>>>import pandas as pd >>>A=pd.Seri es (data=[35,45,55,40]) >>>print(A>40)
Answer:
0 False
1 True
2 True
3 False
Question 23.
Kiyaan, a database administrator needs to display house wise total number of records of ‘Blue’ and ‘Green’ house. He is encountering an error while executing the following query: [2]
SELECT HOUSE, COUNT (*) FROM SCHOOL GROUP BY HOUSE WHERE HOUSE=’Blue’ OR H0USE= ‘Green’:
Help him in identifying the reason of the error and write the correct query by suggesting the possible correction(s).
Answer:
The problem with the given SQL query is that WHERE clause should not be used with GROUP BY clause.
To correct the error, HAVING clause should be used instead of WHERE.
Correct query is:
SELECT HOUSE, COUNT(*) FROM SCHOOL GROUP BY HOUSE HAVING H0USE= ‘Blue’ OR HOUSE=’Green’;
Question 24.
Which SQL function is used to remove leading and trailing spaces from a character expression X, where X = ‘INFORMATION ###PRACTICE####’ (# denotes a blank space) and also give the output of X. [2]
Answer:
TRIM() function is used to remove all leading and trailing spaces from the given character expression.
Syntax
TRIM ([{BOTH/ LEADING/ TRAILING} [remstr] FROM] str)
e.g. mysql>SELECT TRIM (‘INFORMATION## PRACTICE###’):
Output
INFORMATION###PRACTICE
Spaces between ‘INFORMATION’ and ‘PRACTICE’ cannot be removed.
Question 25.
Using copyright, software piracy can be stopped. How? [2]
Answer:
The copyright is the work of authorship immediately becomes the property of the author, who created the work. Only the author or those deriving their rights through the author, can rightfully claim copyright.
Section – C
Question 26.
Explain the term plagiarism. Mention any two ways to avoid plagiarism. [3]
Or
Smridh has recently changed his school, so he is not aware of the people, but someone is posting negative, demeaning comments on his social media profile. He is also getting repeated mails from unknown people. Everytime he goes online, he finds someone chasing him online.
(i) Smridh is a victim of ………..
(ii) What should Smridh needs to do inorder to protect his personal information or data from 1 unintentional and intentional attacks.
(iii) Why are netiquettes important?
Answer:
Plagiarism is the act of using or stealing someone else’s intellectual work, ideas etc. and passing it as your own work. In other words, plagiarism is a failure in giving credit to its source.
Plagiarism is a fraud and violation of Intellectual Property Rights. Since, IPR holds a legal entity status, violating its owners right is a legally punishable offence.
Two ways to avoid plagiarism:
- Be original
- Cite/acknowledge the source
Or
(i) Cyber stalking
(ii) The incidents should be reported to the parents, school authorities and the cyber crime cell, since this would keep him safe from future troubles. If ignored these can put him into a deeper web of cyber problems.
(iii) Netiquettes are important as they promote communication skills, prevent miscommunications, and help you understand what is socially acceptable when working and collaborating online.
Question 27.
Write the code to create the following DataFrame: [3]
Name | Marks | Subject | |
a | Abhi | 75 | Maths |
b | Chirag | 82 | Science |
c | Tushar | 69 | English |
d | Mahi | 70 | Science |
e | Vanshika | 92 | Computer |
Answer:
import pandas as pd data ={‘Name’ : [‘Abhi’, ‘Chirag’, ‘Tushar’, ‘Mahi’, ‘Vanshika’], Marks’ : [75, 82, 69, 70, 92], ‘Subject’ : [‘Maths’, ‘Science’, ‘English’, ‘Science’, ‘Computer’]) df=pd.Data Frame (data, index = [‘a’, ‘b’, ‘c’, 'd', 'e'] print(df)
Question 28.
Consider the following DataFrame dfn that contain vegetables [3]
Color | Quantity | Price | |
Capsicum | Red | 12 | 60 |
Capsicum | Green | 22 | 100 |
Chilli | Red | 50 | 40 |
Chilli | Green | 65 | 55 |
Lime | Green | 20 | 35 |
Write the code statement to the following:
(i) Find all rows with the label “Chilli”. Extract all columns.
(ii) List 2nd, 3rd and 4th rows.
(iii) List only the columns Quantity and Price using loc.
Answer:
(i) dfn.loc [‘Chilli’, :]
(ii) dfn. iloc [1 : 4, : ]
(iii) dfn. loc [:, [‘Quantity’, ‘Price’]]
Question 29.
Consider the following table CLUB. [3]
Table : CLUB
COACH_ID | COACHNAME | AGE | SPORTS | Date_of_Joining | PAY |
1 | Rajesh | 30 | Karate | 1999-08-25 | 1000 |
2 | Anuj | 35 | Swimming | 2000-01-05 | 750 |
3 | Shuchi | 25 | Basketball | 2005-01-04 | 1200 |
4 | Reetika | 28 | Badminton | 2002-08-25 | 1400 |
5 | Virendra | 32 | Cricket | 1996-05-17 | 1500 |
Write SQL queries for the following:
(i) To display the substring of 4 characters of the name of each coach, starting from second character, with their age.
(ii) To display the day for the Date of Joining column.
(iii) To concat the COACHNAME with AGE where age of coach is above 30 years.
Or
What is the purpose of GROUP BY clause in MySQL? How is it different from ORDER BY clause?
Answer:
(i) SELECT SllBSTR(COACHNAME, 2, 4),AGE FROM CLUB;
(ii) SELECT DAY(Date_of_Joining) FROM CLUB:
(iii) SELECT CONCAT(COACHNAME, AGE) FROM CLUB WHERE AGE>30;
Or
The GROUP BY clause can be used to combine all those records that have identical value in a particular field or a group of fields.
Whereas, ORDER BY clause is used to display the records either in ascending or descending order based on a particular field. For ascending order, ASC is used and for descending order DESC is used. The default order is ascending order.
Question 30.
Write the output of following queries. [3]
(i) mysql >SELECT P0WER(9,3);
(ii) mysql >SELECT MID(‘SHUCHI GOYAL’, 8,5):
(iii) mysql >SELECT RIGHT(‘Dushyant ’, 5) ;
Answer:
(i) 729
(ii) GOYAL
(iii) hyant
Section – D
Question 31.
Zeenat has created the following DataFrame dataframe 1 to keep track of data Rollno, Name, Marks1 and Marks2 for various students of her class, where row indexes are taken as the default values: [4]
Rollno | . Name | Marks1 | Marks2 |
1 | Swapnil Sharma | 30 | 50 |
2 | Raj Batra | 75 | 45 |
3 | Bhoomi Singh | 82 | 95 |
4 | Jay Gupta | 90 | 95 |
(a) What will be the output of the following codes?
(i) printed:(dataframe1.size)
(ii) print(dataframe1[‘Rollno’]= =2)
(b) Write the code to print the highest marks obtained in Marks 1 and Marks2.
(c) Write the code to i dd new column “Marks3” with relevant data.
Or (option for part (c) only)
Write the code for delete the 3rd column.
Answer:
(a)
(i) 16
(ii) 2 Raj Batra 75 45
(b) print( (dataframe1.Marks1.max() ), (dataframe1.Marks2.max( ) ) )
(c) dataframel [‘Marks3’] = [45, 52, 90, 95]
Or
del dataframe1 ['Marks1’]
Question 32.
A Gift Gallery has different stores in India. Database Administrator Abhay wants to maintain database of their Salesmen in SQL to store the data. [4]
Consider the following records in ‘Salesman’ table and answer the given questions.
Table: Salesman
Scode | Sname | Address | Dtofjoin | Sales | Area |
100 | Sushant | Delhi | 2017/09/29 | 5000.90 | East |
101 | Sushant | Gurgaon | 2018/01/01 | 7000.75 | East |
102 | Priya | Noida | 2018/04/25 | 3450.45 | West |
103 | Mohit | Delhi | 2018/11/03 | 6000.50 | North |
104 | Priyanshi | Delhi | 2019/12/15 | 8000.62 | North |
(i) Display Sname and Sales of East and West areas.
(ii) Display the total Sales made in East Area.
(iii) The command to display the Name of the Salesman along with the Sales amount rounded off to one decimal point.
(iv) The command to display the length of salesman name.
Answer:
(i) SELECT Sname, Sales FROM Salesman WHERE Area=“East” OR Area=“West”;
(ii) SELECT SUM(Sales) FROM Salesman WHERE Area=”East”;
(iii) SELECT Sname, ROUND(Sales, 1) FROM Salesman;
(iv) SELECT LENGTH (Sname) FROM Salesman;
Section – E
Question 33.
Consider the following records in ‘Garment’ table. [5]
Table: Garment
Geode | Gname | Size | Color | Price |
111 | Tshirt | XL | Red | 1400.00 |
112 | Jeans | L | Blue | 1600.00 |
113 | Skirt | M | Black | 1100.00 |
114 | Jacket | XL | Blue | 4000.00 |
115 | Trousers | L | Brown | 1500.00 |
116 | LadiesTop | L | Pink | 1200.00 |
Write the commands for (i) to (iv) and answer for (v)
(i) To delete the record with Gcode as 116.
(ii) Display the Gname and Price with price highest to lowest.
(iii) To change the color of Garment with code as 116 to “Orange”.
(iv) To display the all details of table Garment.
(v) What is the degree and cardinality of ‘Garment’ table?
Or
Explain the given below functions:
(i) INSTR()
(ii) DATE()
(iii) LENGTH()
(iv) SUM()
(v) MOD()
Answer:
(i) DELETE FROM Garment WHERE Gcode=116;
(ii) SELECT Gname, Price FROM Garment ORDER BY Price DES):
(iii) UPDATE Garment SET Color =“0range” WHERE Gcode=116;
(iv) SELECT * FROM Garment:
(iv) Cardinality is the number of rows and degree is the number of columns in a table.
Cardinality = 6, Degree = 5
Or
(i) INSTR() This function takes a string and a substring of it as arguments and returns an integer which indicates the position of the first occurrence of the substring within the string.
Syntax INSTR (ori_str, sub_str)
(ii) DAY() This function returns the day of month (from 1 to 31) from a date specified as an argument.
Syntax DAY (date/column_name)
(iii) LENGTH() This function returns the length of the string in bytes. The length of the string also includes all the blanks.
Syntax LENGTH(string/column_name)
(iv) SUM() This function returns the sum of values in the specified column.
Syntax SUM (column_name)
(v) MOD() This function returns the remainder of a number dividing by another number.
Syntax M0D(DIVIDEND,DIVISOR)
Question 34.
Bias Methodologies is planning to expand their network in India, starting with three cities in India to build infrastructure for research and development of their chemical products. The company has planned to set up their main office in Pondicherry at three different locations and have named their offices as Back Office, Research Lab and Development Unit. The company has one more research office namely Corporate Unit in Mumbai. A rough layout of the same is as follows: [5]
Approximate distance between these offices are as follows:
From | To | Distance |
Research Lab | Back Office | 110m |
Research Lab | Development Unit | 16 km |
Research Lab | Corporate Unit | 1800 km |
Back Office | Development Unit | 13 km |
In continuation of the above, the company experts have planned to install the following number of computers in each of their offices
Research Lab | 158 |
Back Office | 79 |
Development Unit | 90 |
Corporate Unit | 51 |
(i) Suggest the type of network required (out of LAN, MAN, WAN) for connecting each of the following office units.
(a) Research Lab and Back Office
(b) Research Lab and Development Unit.
(ii) Which one of the following device, will you suggest for connecting all the computers with in each of their office units?
(a) Switch/Hub
(b) Modem
(c) Telephone
(iii) Company is planning to get its website designed which will allow students to see their results ; after registering themselves on its server. Out of the static or dynamic, which type of website
will you suggest?
(iv) Suggest a cable/wiring layout for connecting the company’s local office units located in Pondicherry. Also, suggest an effective method/technology for connecting the company’s office unit located in Mumbai.
(v) Which building is suitable to install the server with suitable reason?
Answer:
(i) (a) LAN
(b) MAN
(ii) (a) Switch/Hub
(iii) Dynamic
(iv)
An effective method/technology for connecting the company’s offices unit located in Mumbai is dial-up or broadband,
(v) Research lab is suitable to install the server because it has maximum number of computers.
Question 35.
Write the code for the following graph which display the different style multiline in same plot. [5]
Or
Write a Python code to create a line graph for the data given below based on TV SHOWS rated by the users.
Shows=[“ The Kapil Sharma Show”,”Friends’’/‘India has Got Talent’V’Big Boss”, “Dance India Dance”]
Rating=[4.2,4.8,5.0,3.8,4.1]
Answer:
import matplotlib.pyplot as plt x1 = [10,20,30] y1 = [20,40,10] x2 = [10,20,30] y2 = [40,10,30] plt.xlabe1(‘X - axis’) plt.ylabe1(‘Y - axis’) plt.plot(x1,y1, color=‘black’, linewidth = 5, label = ‘line1-dotted’, linestyle=‘dashed’) plt.plot(x2,y2, color=‘magenta ’, linewidth = 3, label = ‘line2-dashed’, linestyle=‘dotted ’) plt.title("Plot with different styles”) plt.legend( ) plt.show( )
Or
import matplotlib.pyplot as plt Shows=["The Kapil Sharma Show", "Friends", "India has Got Talent", "Big Boss", "Dance India Dance"] Rating=[4.2, 4.8, 5.0, 3.8, 4.1] plt.plot(Shows, Rating) plt.title("TV SHOWS") plt.xlabe1("Shows") plt.ylabe1("Rating") plt.show( )