Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 7 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 7 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.
When sending an Email, the _______ line describes the contents of the message.
(i) To
(ii) Cc
(iii) Subject
(iv) Contents
Answer:
(iii) Subject
Explanation: The subject line of an email is the single line of text people see when they receive your email. The one line of text can of the determine whether an email is opened or sent straight to trash, so make sure it’s optimized toward your audience.
Question 2.
Following are the impact of e-waste on the environment. Choose the odd one out.
(i) Soil Pollution
(ii) Water Pollution
(iii) Air Pollution
(iv) Sound Pollution
Answer:
(iv) Sound Pollution
Explanation: Sound pollution cannot be an impact of e-waste on environment.
Question 3.
Which of the following is not covered under IPR?
(i) Music
(ii) Insurance
(iii) Logo designed
(iv) Invention
Answer:
(ii) Insurance
Explanation: Intellectual property rights include patents, copyright, industrial design rights, trademarks, plant variety rights, trade dress, geographical indications, and in some jurisdictions trade secrets.
Question 4.
Write the output of the following SQL command.
select substr(“COMPUTER”,3,4);
(i) MPUT
(ii) PUTE
(iii) PU
(iv) MP
Answer:
(i) MPUT
Explanation: The SUBSTR() function extracts some characters from a string.
Syntax: SUBSTR(string, start, length)
Question 5.
Which among the following belongs to an “aggregate function”?
(i) COUNT
(ii) UPPER
(iii) LOWER
(iv) All of the mentioned
Answer:
(i) COUNT
Explanation: COUNT(*) returns the number of rows in a specifid table, and it preserves duplicate rows. It counts each row separately. Ths includes rows that contain null values.
Question 6.
The trademark product is denoted by _______ symbols.
(i) ® or ™
(ii) ©
(iii) !
(iv) None of these
Answer:
6. Ans. Option (i) is correct.
Explanation: A trademark is a type of intellectual property consisting of a recognizable sign, design, or expression which identifis products or services of a particular source from those of others.
Question 7.
Which object do you get after reading a CSV file using pandas.read_csv()?
(i) Dataframe
(ii) Nd array
(iii) Char Vector
(iv) None
Answer:
(iv) None
Th
Explanation: Pandas read_csv() method is used to read CSV fie into DataFrame object. The CSV fie is like a twodimensional table where the values are separated using a delimiter.
Question 8.
Tishya, an accounts officer has written the following query to display the number of workers on contract from every department of her organization along with their department. She is experiencing a problem while running the query.
SELECT COUNT(*), Dept FROM Emp WHERE Type = “CONTRACT”;
Which of the following is a correct query to perform the given task?
(A) SELECT COUNT(*), Dept FROM Emp WHERE Type = “CONTRACT” GROUP BY Dept;
(B) SELECT COUNT (), Dept FROM Emp WHERE Type = “CONTRACT” ORDER BY Dept;
(C) SELECT COUNT(*), Dept FROM Emp GROUP BY Dept;
(D) SELECT COUNT(), Dept FROM Emp WHERE Type = “CONTRACT” GROUP BY Dept;
Answer:
(A) SELECT COUNT(*), Dept FROM Emp WHERE Type = “CONTRACT” GROUP BY Dept;
Explanation: GROUP BY clause is used to summarize the result set into groups defied in the query using aggregate function. Here the records are to be grouped according to the department and then count(*) is used to count the number of records in each group.
Question 9.
Predict the output of the following query: INSTR JAVAT POINT’,
(i) MPUT
(ii) PUTE
(iii) PU
(iv) MP
Answer:
(i) MPUT
Explanation: The SUBSTR() function extracts some characters from a string. Syntax SUBSTR(string, start, length)
Question 10.
Pandas Series is:
(i) 2 Dimensional
(ii) 3 Dimensional
(iii) 1 Dimensional
(iv) Multi-Dimensional
Answer:
(iii) 1 Dimensional
Explanation: Pandas Series is one Dimensional Data Structure.
Question 11.
To apply a constraint to a table it is defined at:
(i) The Beginning of the CREATE < table > command
(ii) The end of the CREATE < table > command
(iii) Separately in next command
(iv) None of these
Answer:
(ii) The end of the CREATE < table > command
Explanation: The constraint that is to be applied to a complete table should be specifid at the end of the CREATE <table> command.
Question 12.
Series data is _______ but the size of Series data is _______.
(i) Immutable, mutable
(ii) Mutable, immutable
(iii) Mutable, mutable
(iv) Immutable, immutable
Answer:
(ii) Mutable, immutable
Explanation: Data structures in Pandas can be mutated in the terms of value but not of size.
Question 13.
The trail that is automatically created when a person uses the internet on any digital devices like Laptops, smart phones, tablets, etc is called _______
(i) Cyberbullying
(ii) Phishing
(iii) Digital Footprint
(iv) Digital Activity
Answer:
(iii) Digital Footprint
Explanation: Digital footprints are the marks of one’s digital activity.
Question 14.
To specify condition with a GROUP BY clause, Which clause is used?
(i) USE
(ii) WHERE
(iii) HAVING
(iv) LIKE
Answer:
(iii) HAVING
Explanation: A HAVING clause in SQL specifis that an SQL SELECT statement must only return rows where aggregate values met the specifid conditions. Aftr the aggregating operation, HAVING is applied, fitering out the rows that don’t match the specifid conditions.
Question 15.
Repeaters work on the _______ layer.
(i) Network Layer
(ii) Physical Layer
(iii) Application Layer
(iv) All of the Above
Answer:
(ii) Physical Layer
Explanation: In computer networking, because repeaters work with the actual physical signal, and do not attempt to interpret the data being transmitted, they operate on the physical layer, the fist layer of the OSI model.
Question 16.
When someone steals someone else’s personal information to commit theft or fraud, it is called _______
(i) Identity theft
(ii) Hacking
(iii) Computer piracy
(iv) Infringement
Answer:
(i) Identity theft
Explanation: Identify thieves increasingly use personal informational stolen from computers r computer networks, to commit fraud by using the data gained unlawfully. The four types of identity thef include medical, criminal, fiancial and child identity theft
Directions: 17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as
Question 17.
Assertion (A): The Internet is world wide system of computer networks i.e., network of networks.
Reasoning (R): All computer on the Internet, communicate with one another using POP/IMAP which is a basic protocol of the Internet.
(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) is false but (R) is True
Answer:
(iii) (A) is True but (R) is False
Explanation: The Internet is a vast network that connects computers all over the world. Though the Internet, people can share information and communicate from anywhere with an Internet connection.
All computer on the Internet, communicate with one another using TCP/IP, which is a basic protocol of the Internet.
Question 18.
Assertion (A): To delete a column from Pandas DataFrame, drop() method is used.
Reasoning (R): Columns are deleted by dropping columns with index label.
(i) Both (A) and (R) are true and (R) is the correct explanation for (A)
(ii) Both (A) and ® are true and R is not the correct explanation for (A)
(iii) (A) is True but (R) is False
(iv) (A) is false but (R) is True
Answer:
(iii) (A) is True but (R) is False
Explanation: To delete a column from Pandas DataFrame,
drop() method is used. Columns are deleted by dropping
columns with column names.
Section B
Question 19.
How is it easier to diagnose fault in Star topology than in Bus topology ?
OR
Sahil, a Class X 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. (NCERT)
Answer:
In Star topology each node is directly connected to a central hub / switch, hence fault diagnosis becomes easy.
In bus topology all the nodes are connected to the backbone cable. The signal travels through the entire length of the backbone and is received by the node for which it is intended. Hence, fault diagnosis is difficult.
Difference between Internet and WWW:
INTERNET | WWW |
(i) Internet is a global network of networks. | WWW stands for World Wide Web. |
(ii) Internet is a means of connecting a computer to any other computer anywhere in the world. | World Wide Web is a collection of information which is accessed via Internet. |
(iii) Internet can be viewed as a big bookstore. | Web can be viewed as collection of books on that store. |
Question 20.
The python code written below has syntactical errors. Rewrite the correct code and underline the corrections made.
import panda as pd data + [['Alex', 10], ['Bob', 12], ['Claske', 13]] df = pd.DataFrame (Data, columns = ['Name','Age']) Print(df)
Answer:
import pandas as pd data = [[‘Alex’, 10], [‘Bob’, 12], [‘Claske’, 13]] df = pd.DataFrame (data, columns =[‘Name’,’Age’]) print(df)
Question 21.
Consider the given SQL string:
“International Labor Day”
Wife suitable SQL queries for the following:
(i) Returns the string in upper case.
(ii) Returns the following string
“yaD robaL lanoitanretni”
Answer:
(i) SELECT UPPER(“International Labor Day”);
(ii) SELECT LOWER(REVERSE(“Inter national Labor Day”));
Question 22.
Predict the output of the given Python code:
import pandas as pd
s=pd.Series ‘([1,2,3,4,5,6], index=[‘A’, ‘B’, ‘C’, ‘D’, ‘E’,’F’])
print (s[s%2==0])
Answer:
Output:
B 2
D 4
F 6
dtype: flt64 2
Question 23.
What do you mean by cyber law ?
Answer:
Any law that applies to the Internet and Internet related technologies. Cyber law is one of the newest areas of the legal system. This is because Internet technology develops at such a rapid pace. Cyber law provides legal protections to people using the Internet. This includes both businesses and everyday citizens. Understanding cyber law is of the utmost importance to anyone who uses the Internet. Cyber law has also been referred to as the law of the Internet.
Question 24.
Carefully observe the following code:
import pandas as pd Yearl={'Q1':5000,'Q2':8000,'Q3':12000,'Q4': 18000} Year2={'A' :13000,'B':14000,'C':12000} totSales={1:Year1,2:Year2} df=pd.DataFrame(totSales) print (df)
Answer:
(i) The index labels of df will include Q1, Q2, Q3, Q4, A,B,C
(ii) The column names of df will be : 1,2 2
Question 25.
Explain the following SQL functions using suitable examples.
(i) MID( ) (ii) TRIM( )
Answer:
i. MID(): It extracts the specified number of characters from given string.
Example:
SELECT MID(‘ Welcome world,4,,4);
Output:
Come
ii. TRIM(): It removes the leading and trailing spaces from the given string.
Example:
SELECT TRIM(‘ Welcome world ‘);
Output:
Welcome world
Section C
Question 26.
Based on the SQL table PURCHASE, write suitable queries for the following:
TABLE: PURCHASE
(i) Display the city wise average quantity.
(ii) Display the Cname and city from the Purchase table your date of purchase within 2022-06-11 TO 2023-01-04.
(iii) Display the records of the dty Chandigarh in descending order as per quantity.
Answer:
(i) SELECT CITY, AVG(QUANTITY) FROM PURCHASE GROUP BY CITY;
(ii) SELECT THE CNAME,CITY FROM PURCHASE WHERE DOP BETWEEN ‘2022-06-11’ AND ‘2023-01-04’;
(iii)SELECT * FROM PURCHASE WHERE CITY = “CHANDIGARH” ORDER BY QUANTITY DESC;
OR
Predict the output of the following queries based on the table PURCHASE given above:
(i) SELECT LENGTH(CNAME) FROM PURCHASE WHERE QUANTITY>100;
(ii) SELECT CNAME FROM PURCHASE WHERE MONTH (DOP) =3;
(iii) SELECT MOD (QUANTITY, DAY (DOP)) FROM PURCHASE WHERE CITY= ‘CHANDIGARH’;
Answer:
(i) 8
(ii) No Output
(iii) 0
15
Question 27.
Create a DataFrame in Python from the given list:
[[101, ‘Gurman’,98], [102,’Raj veer’,95], [103,’Samar’ ,96], [104,’Yuvraj’,88]]
Also give appropriate column headings as shown below:
Answer:
import pandas as pd data=[[101,'Gurman',98], [102,'Rajveer',95], [103,'Samar' ,96], [104,'Yuvraj',88]] df=pd.DataFrame(data,columns=['Rno','Name','Marks']) print(df)
Question 28.
Write MySQL statements for the following:
(i) To create a database named BAG.
(ii) To create a table named BOOK based on the following specification:
COUNTRY | October | November | December |
India | 1678 | 1212 | 2345 |
Pakistan | 23232 | 12710 | 88989 |
Afghanistan | 6758 | 10089 | 8979 |
Sri Lanka | 12366 | 12123 | 9899 |
Answer:
CREATE DATABASE BAG;
CREATE TABLE BOOK (BOOK_NUMBER INTEGER PRIMARY KEY, BNAME VARCHAR(20) );
Question 29.
Rohan,a management trainee of the bank was engaged to be married. The couple exchanged many e-mails using the company computers. After some time the two broke up and the girl created fraudulent e-mail ids such as “indianbarassodations” and sent e-mails to the boy’s foreign clients. She used the bank’s computer to do this. The boy’s company lost a large number of clients and took the bank to the court. The bank was held liable for the e-mails sent using the bank’s system.
(i) Identify the type of cybercrime he is a victim of.
(ii) Under which act, he can lodge a complaint to the relevant authorities?
(iii) Suggest him any two precautionary measures which he should take in future while being online to avoid any such situations.
Answer:
(i) Phishing
(ii) PHISHING A cyber crime, the provisions of information technology act, 2000.
(iii) To Avoid Phishing Scams follow given precautions:
- Keep himself updated with the latest Phishing scams.
- Think twice before clicking links.
- Installing an anti-phishing toolbar or application.
- Verifying the website’s security.
- Checking the online accounts regularly.
- Keeping the Internet browser up to date.
- Using updated Firewall.
- Never sharing personal information to anonymous person, emails or websites.
OR
List the guidelines to avoid plagiarism.
Answer:
Follow the below given guidelines to avoid plagiarism:
- To avoid plagiarism, instead of copying the language of the book as it is, try to put it in your own language/words.
- One should have a clear understanding of plagiarism and its consequences, so that no one can perform it unintentionally.
- If copying someone else’s work in our task, word for word, then do not forget enclosing it in quotes and also mention its source.
- Another way is to credit the original creator/author.
Question 30.
Consider the given DataFrame ‘Stock’:
Write suitable Python statements for the following:
(i) Add a column called SpedalPrice with the following data: [135,150,200,440].
(ii) Add a new book named ‘The Secret’ having price 800.
(iii) Remove the column Spedal Price.
Answer:
(i) Stock[‘Special_Price’]=[135,150,200,400]
(ii) Stock.loc[‘4’]=[‘TheSecret’,800]
(iii) Stock=Stock.drop(‘Special_Price’,axis=1)
Section D
Question 31.
Riya manages database in a New office Delhi. For business purposes, she created a table named PRODUCT. Assist her by writing the following queries:
Write SQL queries for the following:
(A) To display the records in decreasing order of price.
(B) To display category and category wise total quantities of products.
(C) To display the category and its average price.
(D) To display category and category wise highest price of the products.
Answer:
(A) select * from stock order by price desc;
(B) select category, sum(qty) from stock group by category;
(C) select category,avg(price) from stock group by category;
(D) select category, max(price) from stock group by category:
Question 32.
Q4. Krishna, a data Analyst has designed the DataFrame df that contains the production data of four quarters at different units as shown below
Answer the following questions:
(i) Predict the output of the following python statement:
(a) print (df .columns)
(b) print (df [0 : 2])
(ii) Delete the second row from the DataFrame.
(iii) Write Python statement to add a new column Total_prod which is the total of all the four -quarter production of each unit.
OR
(option for part (iii) only)
Write Python statement to export the DataFrame to a CSV file named production.csv stored at d:\home.
Answer:
(i)(a) [Unit, Qtr1, Qtr2, Qtr3, Qtr4]
(b)
(ii) df.drop(1) OR df.drop(1,axis=0)
(iii) df[“Total_prod”]=df[“Qtr1”]+[“Qtr2”]+[“Qtr3”]+[“Qtr4”]
OR
df.to_csv(“d:\home\production.csv”)
Section E
Question 33.
Write suitable SQL queries for the following:
(i) To calculate the exponent for 3 raised to the power of 2.
(ii) To display current date and time.
(iii) To round off the value 4.4787 to -2 decimal place.
(iv) To display the day name of “2023-11-07”.
(v) To display the length of the string TPL#2023′.
Answer:
(i) SELECT POWER(2,3);
(ii) SELECT NOW();
(iii) SELECT ROUND(4.4787 ,-2);
(iv) SELECT DAYNAME(“2023-11-07”);
(v) SELECT LENGTH(“IPL#2023”);
OR
Seema has created following table name WORLD DATA:
Help her in writing SQL queries to the perform the following task:
(i) Insert a new record in the table having following values:
[“Chili”,12365,25412,32564]
(ii) To change the value “Pakistan” to “Nepal” in Country, column.
(iii) To remove the name of those countries where the value is lesser than 10000 in the month of October.
(iv) To add a new column CAPITAL of suitable datatype.
(v) To display the records of all the countries in ascending order of their name.
Answer:
(i) INSERT INTO WORLD_DATA VALUES(“Chili”,12365,25412,32564);
(ii) UPDATE WORLD_DATA SET COUNTRY= “NEPAL” where COUNTRY= “Pakistan”;
(iii) DELETE FROM WORLD_DATA WHERE OCTOBER<10000;
(iv) ALTER TABLE WORLD_DATA ADD CAPITAL varchar(20);
(v) Select * from WORLD_DATA ORDER BY COUNTRY;
Question 34.
ABC International school, Delhi has different wings Administrative Wing (Wl), Primary Wing (W2), Middle Wing (W3), and Secondary Wing (W4), as shown in the diagram:
The school also has a branch in Mumbal. The school management wants to connect all the wings as well as all the computers of each wing (W1, W2, W3, W4)
Distance between the wings are as follows:
W3 to W1 | 85m |
W1 to W2 | 40m |
W2 to W4 | 25m |
W4 to W3 | 120m |
W3 to W2 | 150m |
W1 to W4 | 170m |
Number of computers in each of the wing:
W1 | 125 |
W2 | 40 |
W3 | 42 |
W4 | 60 |
(i) Suggest the topology and draw the most suitable cable layout for connecting all the wings of Delhi branch.
(ii) Suggest the kind of network required (out of LAN, MAN, WAN) for connecting
(a) Administrative Wing (Wl) With Middle Wing (W3)
(b) Administrative Wing (Wl) With the Mumbai Branch.
(iii) Suggest the placement of the following devices with Justification:
(a) Repeater
(b) Switch/Hub
(iv) Due to pandemic school had to adopt Online classes. Suggest the protocol that is used for sending the voice signals over internet. Also, give an example of an application of WWW that helped the teachers to send messages instantly to the students.
(v) Suggest the suitable wing where we can set up the server.
Answer:
(i) Star topology
(ii) (a) LAN
(b) WAN
(iii) (a) Repeater should be placed in between wings
W3 to W2 and W1 to W4 as distance is more.
(b) Hub/Switch should be placed in each wing
to connect various computers together.
(iv) Protocol : VoIP
Example to send messages instantly: WhatsApp
(v) As per the 8020 rule we can set up the server
on Administrative Wing (W1) , since this being
contains maximum number of computers.
Question 35.
Consider the following graph. Wife the Python code to plot it. Also add the Title, label for X and Y axis. 5 @05 Use the following data for plotting the graph
smarks = [10, 40, 30, 60, 55]
sname = [“Sahil”, “Deepak”, “Anil”, ”Riti”]
Answer:
Import matplotlib.pyplot as plt smarks=[10, 20, 30, 40, 50] sname=[‘sahil’,’deepak’,’anil’,’ravi’,’riti’] plt.plot(sname,smarks) plt.xlabel(‘Student Name’) plt.ylabel(‘Marks Scored’) plt.title(‘Marks secured by students in Term-I’) plt.show( )
OR
Write Python code to draw the following bar graph representing the total sales in each quarter. Add the Title, Label for X-axis and Y-axis.
Use the following data for plotting the graph:
sales = [450, 300, 500, 650]
qtr = [“QTR1”, “QTR2”, “QTR3″, ”QTR4”]
Answer:
Import matplotlib.pyplot as plt sales=[450, 300, 500, 650] qtr=[‘QTR1’,’QTR2’,’QTR3’,’QTR4’] plt.bar(qtr,sales) plt.xlabel(‘quarter) plt.ylabel(‘sales’) plt.title(‘Sales each quarter’) plt.show( )