Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 8 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 8 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.
______ topology is best suited for large businesses which must carefully control and coordinate the operation of distributed branch outlets? (i) Ring
(ii) Local area
(iii) Hierarchical
(iv) Star
Answer:
(iv) Star
Explanation: The star topology is the best network topology for large businesses because it is simple to control and coordinate from the central computer.
Question 2.
______ element/s is/are cause of e-waste?
(i) Lead
(ii) Cadmium
(iii) Beryllium, or Brominates flame retardants
(iv) All of these
Answer:
(iv) All of these
All of the above element/s is/are cause of e-waste.
Question 3.
Data protection refers to protecting data from:
(i) Substantial Harm
(ii) Embarrassment
(iii) Inconvenience and unfairness
(iv) All of these
Answer:
(iv) All of these
Explanation: Data protection is a set of strategies and processes you can use to secure the privacy, availability, and integrity of your data.
Question 4.
Write the output of the following SQL command, select round(49.88);
(i) 49.88
(ii) 9.8
(iii) 49.0
(iv) 50
Answer:
(iv) 50
Explanation: ROUND( ): Function is used to round up the number to the upwards or downwards whichever the nearest whole number.
Question 5.
We apply the aggregate function to a group of set of tuples using the clause.
(i) group by
(ii) group
(iii) group set
(iv) group attribute
Answer:
(i) group by
Explanation: Th 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 diffrent rows then it will arrange these rows in a group.
Question 6.
Exploring appropriate and ethical behaviours related to online environments and digital media.
(i) Cyber ethics
(ii) Cyber security
(iii) Cyber safety
(iv) Cyber law
Answer:
(i) Cyber ethics
Explanation: “Cyber ethics” refers to the code of responsible behavior on the Internet.
Question 7.
The CSV files only take which delimiter as default delimiter.
(i) comma
(ii) dot
(iii) Hyphen
(iv) asterisk
Answer:
(i) comma
Explanation: The CSV fies only take comma as default delimiter.
Question 8.
Mr. Vinay wanted to display average salary of each category. He entered the following SQL statement but he is experiencing a problem while running the query:
SELECT Category, Salary FROM Hotel GROUP BY Category;
Which of the following is the correct query to perform task?
(i) SELECT Category, AVG(Salary) FROM Hotel GROUP BY Category;
(ii) SELECT Category, AVG (Salary) FROM Hotel ORDER BY Category;
(iii) SELECT Category, AVG(Salary) FROM Hotel HAVING Category;
(iv) SELECT Category, Salary FROM Hotel ORDER BY Category;
Answer:
(i) SELECT Category, AVG(Salary) FROM Hotel GROUP BY Category;
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.
Question 9.
Predict the output of the following query:
SELECT LCASE (RIGHT (“Programming”,4));
(i) Prog
(ii) prog
(iii) ming
(iv) Ming
Answer:
(iii) ming
Explanation: RIGHT()is used to return a specified number of characters from the right of the string. Th number of characters returned is determined by the second argument. LCASE()is used to convert the characters of an argument string to the lowercase characters.
mysql> SELECT UCASE (MONTHNAME (“2023-05-11”));
Question 10.
Minimum number of arguments we require to pass in pandas series:
(i) 0
(ii) 1
(iii) 2
(iv) 3
Answer:
(ii) 1
Explanation: It requires minimum argument.
Question 11.
A combination of two or more attributes that is used as a primary key are called.
(i) Alternate keys
(ii) Candidate keys
(iii) Composite keys
(iv) None of these.
Answer:
(iii) Composite keys
Explanation: In certain tables, a single key cannot be used to identify rows uniquely and a combination of two or more attributes is used as a primary key. Such keys are called Composite keys.
Question 12.
In Pvthon programming ______ will be the output of the given expression:-
print (“csv\’ is a Text\’ file”, sep=’0′ , end= ‘ #’)
(i) Syntax Error
(ii) csv’ is a Text’ file#
(iii)csv@’ is0a@Text’ @file#
(iv) csv#’ is#a#Text’#file@
Answer:
(ii) csv’ is a Text’ file#
>>> print ("csv\' is a Text\' fie", sep='@', end="#") csv' is a Text' fie#
Question 13.
The plagiarism is:
(i) a violation of academic norms.
(ii) offence against the author.
(iii) it applies to both licensed and unlicensed contains.
(iv) All of these
Answer:
(iv) All of these
Explanation: All of the mentioned points are falls into the category of Plagiarism.
Question 14.
Data types used to store Unicode characters in SQL
(1) Char
(2) Varchar
(3) Nchar
(4) Nvarchar
(i) (1) and (2)
(ii) (3) and (4)
(iii) All of these
(iv) None of these
Answer:
(ii) (3) and (4)
Explanation: Data types char and varchar cannot store Unicode characters where as nchar and nvarchar can.
Question 15.
Logical OR operator in SQL is:
(i) OR
(ii) ||
(iii) |
(iv) Both (i) and (ii)
Answer:
(i) OR
Explanation: Th logical operators OR, AND and NOT are used to connect search conditions in the where clause.
Question 16.
Which one of the four Creative Commons core conditions is always included in a CC licence?
(i) Share Alike (SA)
(ii) No Derivatives (ND)
(iii) Attribution (BY)
(iv) Non Commercial (NC)
Answer:
(iii) Attribution (BY)
Explanation: Th CC BY license allows others to reuse, adapt, remix, and and distribute the work for any purpose, including commercial use. Th only requirement is that the work or adaptation must be shared with attribution to the creator.
Question 17.
Assertion (A):- A hub is less sophisticated than a switch, the latter of which can isolate data transmissions to specific devices.
Reasoning (R):- A network hub is a node that broadcasts data to every computer or Ethernet-based device connected to it.
(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:
(i) Both A and R are true and R is the correct explanation for A
Explanation: Th statement Assertion & reason both are True.
Question 18.
Assertion (A):- To use the numpy library in a Python program, one must import it.
Reasoning (R):- The only alias name that can be used with the numpy library is np.
(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
We can use any alias name for numpy library.
Section B
Question 19.
What is the concept of web crawler?
OR
Ayus is doing a course in networking. He is unable to understand the concept of search engine. Help him by explaining it with the help of suitable example. Examples: Google, Bing & Yahoo!
Answer:
A web crawler, crawler or web spider, is a computer program that’s used to search and automatically index website content and other information over the internet. These programs, or bots, are most commonly used to create entries for a search engine index.
OR
A search engine is a software program that helps people fid the information they are looking for online using keywords or phrases.
Question 20.
The python code written below has syntactical errors. Rewrite the correct code and underline the corrections made.
import pandas As pd data = {'One': pd.series(['a', 'b', 'c'], index = [1, 2, 3]),'Two': pd. Series (['a', 'b', 'c', 'd'] , index = [1, 2, 3, 4])} value = pd.DataFrame (Data) print(data)
Answer:
import pandas as pd data = {‘One’: pd. Series([‘a’, ‘b’,‘c’], index = [1, 2, 3]),’Two’: pd.Series([‘a’, ‘b’, ‘c’, ‘d’], index = [1, 2, 3, 4])} value = pd.DataFrame (data) print(value)
Question 21.
Consider the given SQL string:
“The sun sets in The West”
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 first three characters from the string.
Answer:
(i) SELECT INSTR(“The sun sets in The West”,”The”);
(ii) SELECT LEFT (“The sun sets in TheWest”,4);
Question 22.
Give the output:
import pandas as pd M=[15,--10, 56, 39,-90, 15] p=pd.Series(M,index=[10,20,30,40,50,60]) print(p[10]) print(p[[10,30,50]])
Answer:
Question 23.
List out some basic netiquettes.
Answer:
(i) While copying/downloading photos, videos or other contents be careful it should be copyright free.
(ii) Avoid posting any spam messages like advertisements, promotions messages and other related contents frequently.
(iii) Write the message with clear and concise notes.
(iv) Always remember your posts are shared in public so they can be viewed or read by your friends, siblings, elders and younger ones. So post the content in a respectful manner.
Question 24.
Complete the given Python code to get the required output of whole Dataframe.
Import pandas as ____ t= {'Rollno': [11, 12, 13, 14, 15, 16, 17], 'Name': ['Anay', 'Ritu', 'Ayus','Himani', 'Sudeep', 'Shilpi', 'Anjali'], 'Age': [19, 15, 17, 14, 11, 14, 17], 'Marks': [72.9, 90.4, 50.9, 80.3, 76.576, 87.7, 65.0], 'Class': ['11', 'll', 'll', 'll', 'll', 'll', 'll', ]} df =____.DataFrame (t, ____=[10, 20, 30, 40, 50, 60, 70]) ____(df)
Answer:
import pandas as pd t= {‘Rollno’: [11,2,3,4,5,16,7], ‘Name’: [‘Anay’, ‘Ritu’, ‘Ayus’, ‘Himani’, ‘Sudeep’, ‘Shilpi’,‘Anjali’], ‘Age’: [19,5,7,4,1,4,7], ‘Marks’: [72.9, 90.4, 50.9, 80.3, 76.576, 87.7, 65.0], ‘Class’: [‘11’, ‘11’, ‘11’, ‘11’, ‘11’, ‘11’, ‘11’, ]} df = pd.DataFrame (t,index=[10, 20, 30, 40, 50, 60, 70]) print (df)
Question 25.
What are Math functions in SQL? Name any two.
Answer:
Math functions are the predefied functions in my SQL library which is used to perform any mathematical operations.
Example:
pow( ): Returns the power of a number
round( ):Returns the round off value of a number
Section C
Question 26.
Based on the SQL table CLUB, write suitable queries for the following:
Table: CLUB
(i) To show all information about the swimming coaches in the club.
(ii) To list names of all coaches with their date of appointment (DATOFAPP) in descending order,
(iii) To display a report, showing coachname, pay, age and bonus (15% of pay) for all the coaches.
Answer:
(i) SELECT * FROM CLUB WHERE SPORTS=’SWIMMING’;
(ii) SELECT COACHNAME,DATOFAPP FROM CLUB ORDER BY DATOFAPP DESC;
(iii) SELECT COACHNAME, PAY, AGE, PAY*0.15 AS BONUS FROM CLUB ;
OR
Predict the output of the following queries based on the table CLUB given above:
(i) SELECT SUM(PAY) FROM CLUB WHERE DATOFAPP> ’31/01/1998′;
(ii) SELECT LCASE (SPORTS) FROM CLUB;
(iii) SELECT SPORTS FROM CLUB WHERE SEX = “F”;
Answer:
(i) 78000
(ii)
Karate |
Karate |
Squash |
Basketball |
Swimming |
Swimming |
Squash |
Karate |
Swimming |
Basketball |
(iii)
KARATE
SWIMMING
SQUASE
Question 27.
Write python code to create the Series EMP with following data (using Dictionary)
Code | |
E1 | Sanya |
E2 | Krish |
E3 | Rishav |
E4 | Deepak |
Answer:
import pandas as pd d={“E1”:”Sanya”,”E2”:”Krish”,”E3”:Rishav”,”E4”:”Deepak”} EMP=pd.Series(d) EMP.index.name=”code” print(EMP)
Question 28.
Write SQL commands to perform the following tasks –
(i) Create table Employee with the following structure:
Name of Column | ID | First_Name | Last_Name | User_ID | Salary |
Type | Number(4) | Varchar(30) | Varchar(30) | Varchar(10) | Number(9,2) |
(ii) Ensure the following specification in created table:
- ID should be declared as Primary Key
- User lD should be unique
- Salary Must be greater than 5000
Answer:
mysql>CREATE TABLE Employee (ID NUMBER(4) PRIMARY KEY,
First_Name VARCHAR(30) NOT NULL,
Last_Name VARCHAR(30) NOT NULL,
User_ID VARCHAR(10) UNIQUE,
Salary NUMBER (9,2));
Question 29.
Preeti celebrated her birthday with her family. She was excited to share the moments with her friend Himanshu. She uploaded selected images of her birthday party on a social networking site so that Himanshu can see them. After few days, Preeti had a fight with Himanshu. Next morning, she deleted her birthday photographs from that social networking site, so that Himanshu cannot access them. Later in the evening, to her surprise, she saw that one of the images which she had already deleted from the social networking site was available with their common friend Gayatri. She hurriedly enquired Gayatri “Where did you get this picture from?”.Gayatri replied “Himanshu forwarded this image few minutes back”. Help Preeti to get answers for the following questions. Give justification for your answers so that Preeti can understand it clearly.
(i) How could Himanshu access an image which I had already deleted?
(ii) Can anybody else also access these deleted images?
(iii) Had these images not been deleted from my digital footprint?
Answer:
(i) The images uploaded by Preeti must have been downloaded by Himanshu, which he forwarded to their common friend. Any image uploaded on social media sites can be easily downloaded by anyone if we don’t set the privacy settings.
(ii) No one can access those deleted photos but Himanshu can send those photos to anyone so whoever he sends can access those.
(iii) The images deleted from social media sites remain on their servers for long time even after they are deleted. so they form part of one’s digital footprint. moreover, if some post or images before being deleted are copied by someone else they remain with them.
OR
How open data is useful?
Answer:
Open data is data that can be freely used, re-used and redistributed by anyone-subject only, at most, to the requirement to attribute and share alike.
(i) Availability and Access: The data is available as a whole and at no more than a reasonable reproduction cost, preferably by downloading over the internet. The data is available in a convenient and modifible form.
(ii) Re-use and Redistribution: The data is provided under terms that permit re-use and redistribution including the intermixing with other data sets.
(iii) Universal Participation: Everyone is able to use, re-use and redistribute, there is no discrimination against filds of endeavour or against a person or groups.
For example, ‘noncommercial’ restrictions that would prevent ‘commercial’ use or restrictions of use for certain purpose (e.g., only in education,) are not allowed.
Question 30.
Suppose a data frame contains information about student having columns rollno, name, class and section. Write the- code for the following:
(i) Add one more column as fee
(ii) Write syntax to transpose data frame.
(iii) Write python code to delete column fee of data frame.
Answer:
(i) Df1[‘fee’]=([100,200,300])
(ii) Df1=Df1.T
(iii) Df2.pop(‘fee’)
Section D
Question 31.
Reena manages database in a wholesale start-up. For business purposes, she created a table names.
Assist her by writing the following queries:
Table: EMPLOYEE
(i) To display the name of employees whose salary not known.
(ii) To display DEPTID from the table EMPLOYEE without repetition. ‘
(iii) To modify the column Desig and change its width to varchar(25).
(iv) To display name and designation of those employees whose name starts with N.
Answer:
(i) SELECT NAME, SALARY FROM EMPLOYEE WHERE SALARY IS NULL;
(ii) SELECT DISTINCT(DEPTID) FROM EMPLOYEE;
(iii) ALTER TABLE EMPLOYEE MODIFY DESIG VARCHAR(25);
(iv) SELECT NAME, DESIG FROM EMPLOYEE WHERE NAME LIKE N%;
Question 32.
Write one python program to find the following from the given dataframe DF:
(i) Maximum marks and minimum marks
(ii) Sum of all the marks
(iii) Mean and mode of age of the students
(iv) Count the no of rows present in the dataframe
OR
(Option for part iii only)
Write Python statement to export the DataFrame dfl to a CSV file named book.csv stored at E: drive.
Answer:
(i) print(“Maximum marks = “ , DF[“Marks”].max())
print(“Minimum marks = “ , DF[“Marks”].min())
(ii) print(“Sum of marks = “ , DF[“Marks”].sum())
(iii) print(“Mean of Age = “,DF[“Age”].mean())
print(“Mode of Age = “,DF[“Age”].mode())
(iv) print(“No of rows = “,DF.count())
OR
df1.to_csv(“E:\book.csv”)
Section E
Question 33.
Write suitable SQL queries for the following:
(i) To display the first four characters from the string “I Love Python”
(ii) To display the length of string “Hello Wonders World”.
(iii) To display the string after removing leading space of string “Hello”
(iv) To display the square of 5.
(v) To display string “HELLO WORLD” in lowercase.
Answer:
(i) SELECT LEFT (“I Love Python”, 4);
(ii) SELECT LENGTH (“Hello WondersWorld”);
(iii) SELECT LTRIM (“Hello“);
(iv) SELECT POWER (5,2);
(v) SELECT LOWER (“HELLO WORLD”);
OR
Priya has created following table named exam:
Table: CABHUB
Help her in writing SQL queries to perform the following task:
(i) To display the names of all the white coloured vehicles.
(ii) To display all the records.
(iii) To display vehicles name and their charges whose capacity is more than 5.
(iv) Delete the records of vehicles of white colour.
(v) Add a column Pnum in the table CABHUB with datatype as integer.
Answer:
(i) SELECT VehicleName From CABHUB WHERE Color = “WHITE”;
(ii) SELECT *FROM CABHUB;
(iii) SELECT VehicleName, Charges FROM CABHUB WHERE Capacity >5;
(iv) DELETE FROM CABHUB WHERE color=’white’;
(v) ALTER TABLE CABHUB ADD(PNUM integer);
Question 34.
Software Development Company has set up its new centre at Raipur for its office and web-based activities. It has. 4 blocks of buildings named Block A, Block B, Block C, Block D. Number of Computers.
Block A | 25 |
Block B | 50 |
Block C | 125 |
Block D | 10 |
Shortest distances between various Blocks in meters:
Block A to Block B – 60 m
Block B to Block C – 40 m
Block C to Block A – 30 m
Block D to Block C – 50 m
(i) Suggest the most suitable place (i.e. block) to house the server of this company with a suitable reason.
(ii) Suggest the type of network to connect all the blocks with suitable reason.
(iii) The company is planning to link all the blocks through a secure and high speed wired medium. Suggest a way to connect all the blocks.
(iv) Suggest the most suitable wired medium for efficiently connecting each computer installed in every block out of the following network cables:
- Coaxial Cable
- Ethernet Cable
- Single Pair Telephone Cable.
(v) Give example of any 2 protocol.
Answer:
(i) Block C , It has maximum number of computer.
(ii) LAN
(iii) Star topology
(iv) Ethernet Cable
(v) FTP, SMTP
Question 35.
Write code to create a Histogram with the given values of x(4 bins) using facecolor=red
x=[10,10,155,70,50, 125,75,149, 98,81]
Answer:
import matplotlib.pyplot as plt
x=[10,10,155,70,50,125,75,149,98,81]
plt.hist(x,bins=4,facecolor=’red’)
plt.show( )
OR
Write suitable Python code to create Chart as shown below:
Also give suitable python statement to save this chart.
Answer:
import matplotlib.pyplot as plt import numpy as np x = np.arange(1, 5) #or x=[1,2,3,4] plt.plot(x, x*1.5, label=’Normal’) plt.plot(x, x*3.0, label=’Fast’) plt.plot(x, x/3.0, label=’Slow’) plt.legend( ) plt.show( ) plt.savefi(“Speed.jpg)