Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 4 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 4 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.
Land line Telephone network is an example of ______ :
(i) LAN
(ii) WAN
(iii) MAN
(iv) Internet
Answer:
(ii) WAN
Explanation: A wide-area network (WAN) is a collection of local-area networks or other networks that communicate with each other. A WAN is essentially a network of networks, with the Internet the world’s largest WAN.
Question 2.
Which of the following element make e-waste hazardous in nature?
(i) Lead
(ii) Glass
(iii) Plastic
(iv) Iron
Answer:
(i) Lead
Explanation: The presence of elements like lead, mercury, arsenic, cadmium, selenium, hexavalent chromium, and flame retardants beyond threshold , quantities make e-waste hazardous in nature.
Question 3.
A provides legal protection for your brand and helps you guard against counterfeiting and fraud.
(i) Patents
(ii) Copyrights
(iii) Trademark
(iv) All of these
Answer:
(iii) Trademark
Explanation: A trademark is used for goods, while a service mark is used for services. A trademark: Identifies the source of your goods or services. Provides legal protection for your brand. Helps you guard against counterfeiting and fraud.
Question 4.
Predict the output of the following query:
SELECT MOD (4,3);
(i) 0
(ii) NULL
(iii) NaN
(iv) 1
Answer:
(iv) 1
Explanation: The MOD() function returns the remainder of a number divided by another number.
Question 5.
Which of the following SQL functions does not belong to the Math functions category?
(i) MOD ( )
(ii) ROUND( )
(iii) POW ( )
(iv) SUBSTRING( )
Answer:
(iv) SUBSTRING( )
Explanation: The SUBSTRING( ) function is not a math function.
Question 6.
PYTHON is ______ under the terms of the GNU General Public License.
(i) Office
(ii) Firefox
(iii) FOSS
(iv) All of these
Answer:
(iii) FOSS
Explanation: PYTHON is a Free and Open-Source Software (FOSS).
Question 7.
S in CSV stands for:
(i) separated
(ii) static
(iii) statement
(iv) None of these
Answer:
(i) separated
Explanation: A CSV (comma-separated values) file is a text file that has a specific format which allows data to be saved in a table structured format.
Question 8.
Ram, a Database Administrator, needs to display the Maximum pay of all workers from those departments which have more than Five employees, he is experiencing a problem while running the following query:
SELECT DEPT, Maximum(PAY) FROM EMP ORDER BY DEPT HAVING COUNT()>5;
Which of the following is a correct query to perform the given task? ‘
(i) SELECT DEPT, max(*) FROM EMP WHERE COUNT(*) > 5 GROUP BY DEPT;
(ii) SELECT DEPT, Maximum (*) FROM EMP HAVING COUNT (*) > 5 GROUP BY DEPT;
(iii) SELECT DEPT, Max (PAY) FROM EMP GROUP BY DEPT HAVING COUNT (*) >54;
(iv) SELECT DEPT, maximum(PAY) FROM EMP GROUP BY DEPT WHERE COUNT(*) > 54;
Answer:
(iii) SELECT DEPT, Max (PAY) FROM EMP GROUP BY DEPT HAVING COUNT (*) >54;
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: SID 1
SELECT UCASE (DAYNAME (“2023-05-16”));
Provided “2023-01-01” is Sunday.
(i) SUNDAY
(ii) MONDAY
(iii) TUESDAY
(iv) The corresponding month number when we execute the query.
Answer:
(iii) TUESDAY
Explanation:
Question 10.
Which of the following command will show the first 5 rows from a Pandas Series named NP?
(i) NP. head ( )
(ii) NP.head(5)
(iii) Both (i) & (ii)
(iv) None of these
Answer:
(iii) Both (i) & (ii)
Explanation: The head() method returns a specified number of first rows. The head() method returns the first 5 rows if a number is not specified.
Question 11.
With reference to SQL, identify the invalid data type for TEXT Values.
(i) FLOAT ( )
(ii) CHAR ( )
(iii) VARCHAR ( )
(iv) Both (i) & (ii)
Answer:
(i) FLOAT ( )
Explanation: CHAR,VARCHAR are the DataTypes which can store a TEXT Values.
Question 12.
In Python programming ______ will be the output of the given expression:- print(print(“All”),”of the above”)
(i) All of these
(ii) Syntax Error
(iii) None of these
(iv) All
Answer:
(iv) All
Explanation: The inner print function will display “All” and in the next line “NONE” this value will be concatenated with “of the above”. So the overall output will be “None of the above”.
Question 13.
Which of the following statements comes under plagiarism if you:
i. Make use of the works of others to gather information.
ii. Use the work of another and represent it as your own.
iii. Make use of the works of others to support your own arguments.
iv. Examine the ideas and arguments of others to help you shape your own thoughts or views on a particular issue. in response.
(i) Website
(ii) WebBrowser
(iii) Web Server
(iv) Web Hosting
Answer:
(ii) WebBrowser
Explanation: This is plagiarism because you are deliberately trying to suggest that the clever idea or wording was your own creation, which is a lie, and, of course, plagiarism.
Question 14.
In SQL, MID ( ) function is equivalent to:
(i) LEN ( )
(ii) TRIM ( )
(iii) SUBSTR ( )
(iv) None of these
Answer:
(iii) SUBSTR ( )
Explanation: The SUBSTR( ) function is equivalent to MID( ).
Question 15.
A web client is a computer system that sends requests to the ______ and displays the WebPages it receives in response.
(i) Website
(ii) WebBrowser
(iii) Web Server
(iv) Web Hosting
Answer:
(iii) Web Server
Explanation: A web client is a computer system that sends requests to the web server and displays the webpages it receives in response. Web clients can be either physical or virtual, and they can be located in a data center or in the cloud.
Question 16.
Creative Commons (CC) is an non-profit organization of ______ .
(i) India
(ii) America
(iii) UK
(iv) None of these.
Answer:
(i) India
Explanation: Creative Commons (CC) is an American non-profit organization.
Question 17.
Assertion (A):- A repeater amplifies the signal, it requires a source of electric power.
Reasoning (R): – A repeater is an electronic device in a communication channel that increases the power of a signal and retransmits it, allowing it to travel further.
(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: The statement Assertion & reason both are True and R is the correct explanation for A.
Question 18.
Assertion (A):- Da taSeries is a multidimensional data structure.
Reasoning (R): – To use DataSeries in a program we need not to import pandas library.
(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:
(iv) A and R both are False
Explanation: Both statements are false.
Section B
Question 19.
What is the concept of web server and web client?
OR
Ayus is doing a course in networking. He is unable to understand the concept of protocol. Help her by explaining it with the help of suitable example.
Answer:
A web server is a computer program that stores and delivers web pages to web clients. It is responsible for hosting websites and providing web services.
A web client is a computer program that is used to access and view web pages. It is usually a web browser such as Google Chrome, Mozilla Firefox, or Microsoft Edge.
OR
A network protocol is an established set of rules that determine how data is transmitted between different devices in the same network. Essentially, it allows connected devices to communicate with each other, regardless of any differences in their internal processes, structure or design.
Question 20.
The python code written below has syntactical errors. Rewrite the correct code and underline the corrections made.
import pandas as pd C ={"sl": ["102","103","104"], "sub":["math","bio","eng"]} df= Pd.dataframe(comp) print(Df)
Answer:
import pandas as pd C={"si": ["102", : 103","104"], "sub":["math","bio","eng"]} df=pd.DataFrame(C) print(df)
Question 21.
Consider the given SQL string:
“Informatics Practices Examination 2024”
Write suitable SQL queries for the following:
(i) Returns the position of the first occurrence of the substring “Examination” in the given string.
(ii) To extract last four characters from the string.
Answer:
(i) SELECT INSTR (“Informatics Practices Examination 2024″,”Examination”);
(ii) SELECT RIGHT (“Informatics Practices Examination 2024”,4);
Question 22.
Predict the output of the given Python code:
import pandas as pd a = pd.DataFrame ([2,6,8], index = ["Al", "B2","C3"], columns = ["VALUE"]) print (a [ : :-1])
Answer:
Output:
Question 23.
How a digital footprint is created?
Answer:
A digital footprint is the trail of data you create while using the Internet. This trail of data comes from the websites you visit, the emails you send, and the information you submit or download online. You build your footprint both actively and passively.
Question 24.
Complete the given Python code to get the required output of whole Dataframe.
import _____ as pd t= {"ROLL no": [10,11,13], "Name": ["SUMIT", "AMIT", "BIMAL"], "Age": [26, 19, 22], "Dept": ["PHYS", ”CHEM", "MATH"]} df: = _____.DataFrame (_____, index= [ 'A' , ' B' , ' C' ] ) print (_____)
Answer:
import pandas as pd t={"ROLL no": [10,11,13], "Name":["SUMIT","AMIT","BIMAL"], "Age": [26, 19,22], "Dept":["PHYS","CHEM","MATH”]} df=pd.DataFrame(t,index=['A', 'B', 'C']) print(df)
Question 25.
Which aggregate function is required to calculate the minimum salary in my SQL table? Give the syntax to get 2nd minimum salary in SQL?
Answer:
The aggregate function MIN( ) is required to calculate the minimum value with in a particular column.
SELECT MIN(S ALARY) FROM Employee WHERE SALARY < (SELECT MIN(S ALARY) FROM Employee);
Consider column name is salary and the table name is employee.
Section C
Question 26.
Based on the SQL table Garment, write suitable queries for the following:
Table:Garment
(i) Write the command to display the average price of those garments that are available in Red colour.
(ii) Write the command to count those garments that have their names starting with “T”.
(iii) Select the records that have a price below the average price.
Answer:
(i) Select AVG (Price) from Garment where Colour=”Red”;
(ii) Select Count(*) from Garment where Gname like “T%”;
(iii) SELECT * FROM Garment WHERE Price < (SELECT AVG(Price) FROM Garment);
OR
Predict the output of the following queries based on the table Garment given above:
(i) Select MIN(Price) AS “MIN PRICE” from Garment where size= “L”;
(ii) Select Count (*) from Garment where Gname NOT like ”T%”;
(iii) Select MAX (Price) from Garment;
Answer:
(i) MIN PRICE
1200.00
(ii) 3
(iii) 1600.00
Question 27.
Write python code to create the following DATAFRAME:
Answer:
import pandas as pd T= ["SLNO "NAME","MARKS] t= [[101, "Harsh",83] [102,"Arun",75], [103,"Manna",64], [104,"Hennat",71], [105, "Danny”,4 6], [106,"Fatima",76]] df= pd.DataFrame(t, columns = T) print(df)
Question 28.
Write MySQL statements for the following:
(i) To create a database named Z_BANK.
(ii) To create a table named EMP based on the following specification:
Column Name | Data Type | Constraints |
EMP_NO | Integer | Primary Key |
ENAME | Varchar(20) | NOT NULL |
W_HRS | FLOAT | DEFAULT “0.0” |
Answer:
(i) CREATE DATABASE Z_BANK;
(ii) CREATE TABLE EMP (EMP_N0 INTEGER PRIMARY KEY, ENAME VARCHAR(20) NOT NULL,W_HRS FLOAT DEFAULT
“0.0”);
Question 29.
Anjali, a student of class 12. One day she received a SMS about winning a lottery and to claim prize money she needs to share for bank account details. By mistakenly she had sheared her personal bank details and the very next day a good amount of money was deducted from her account.
Based on the given information, answer the questions given below.
(i) Identify the type of cybercrime he is a victim of.
(ii) How phishing works?
(iii) Who uses phishing?
Answer:
(i) This technique is called Phishing.
(ii) Phishing works by sending messages that look like they are from a legitimate company or website. Phishing messages will usually contain a link that takes the user to a fake website that looks like the real thing. The user is then asked to enter personal information, such as their credit card number.
(iii) This technique is often used by attackers who have taken control of another victim’s system. In this case, the attackers use their control of one system within an organization to email messages from a trusted sender, known to the victims.
OR
What did you mean by hazard?
Answer:
A hazard is any source of potential damage, harm or adverse health effects on something or someone. Basically, a hazard is the potential for harm or an adverse effect (for example, to people as health effects, to organizations as property or equipment losses, or to the environment).
Question 30.
Consider the given DataFrame ‘Furniture’:
Write suitable Python statements for the following:
Furniture
Fcode | Name | Price |
10023 | Table | 4000 |
10001 | Chair | 2050 |
10012 | Sofa | 3500 |
Write suitable Python statements for the following:
(i) Calculate Bonus as Price + 30% of price and assign to column “Bonus”.
(ii) Calculate the Increment as Bonus-Price.
(iii) Display the DataFrame.
Answer:
import pandas as pd T={"Fcode" : [10023, 10001,10012], "Name" :["Table", "Chair", "Sofa"] , "Price" : [4000.0,2050.0,3500.0]} df = pd.DaraFrame (T) 1= [ ] for i in T["Price"]: 1+=[i+((i* 30)/100)] df["Bonus"]=1 df["Increment"]=df["Bonus"] - df["Price"] print (df) Output:
Section D
Question 31.
Consider a table SALESMAN with the following data:
Write SQL queries using SQL functions to perform the following operations:
(i) Display salesmane name and bonus after rounding off to zero decimal places.
(ii) Display the position of occurence of the string “ta” in salesman names.
(iii) Display the four characters from salesman name starting from second character.
(iv) Display the month name for the date of join of salesman.
Answer:
(i) Select sname, round(bonus,0) from Salesman;
(ii) Select instr(Sname, “ta”) from Salesman;
(iii) Select mid(Sname,2,4) from Salesman;
(iv) Select monthname(DateofJoin) from Salesman;
Question 32.
AMIT, a Data Analyst with a multinational brand has designed the DataFrame Df:
Answer the following questions:
(i) Predict the output of the following python statement:
a. print (df . loc [ : :-1,: : – 1 ] )
b. print(df3.iloc[2::-1,])
(ii) Delete the last column from the DataFrame.
(iii) Write Python statement to add a new column total which is the sum of all the values.
OR
(Option for part iii only)
Write Python statement to export the DataFrame to a CSV file named book.csv stored at F: drive.
Answer:
import pandas as pd T=[ [0,20, 40,75], [1,40,10,27], [2,60,60,71]] df=pd.DaraFrame(T) print(df.lcc[::-1,::-1]) print(df.iloc[2::-1,]) Output:
Section E
Question 33.
Write the SQL queries which will perform the following operations:
(i) To remove spaces from the left side of the string,” ABC public school”.
(ii) To display last name from the string “AYUS BISWAS”.
(iii) To display the present day name.
(iv) To find the remainder of two numbers, 100 and 13.
(v) To print the string “QwErTy” in lower case letters.
Answer:
(i) SELECT LTRIM (” ABC public school”);
(ii) SELECT RIGHT (”AYUS BISWAS”, 6);
(iii) SELECT DAYNAME (NOW () ) ;
(iv) SELECT MOD(100,13);
(v) SELECT LCASE(“QwErTy”);
OR
Consider a table Sales with the following data:
Write SQL queries using SQL functions to perform the following operations:
(i) Display the position of occurrence of the letter ‘s’ in category.
(ii) Display the length of category names.
(iii) Display profit rounded off to one place before decimal point.
(iv) Display details in the ascending order of ItemCode.
(v) Display the number of profit values entered.
Answer:
(i) SELECT POSITION («s» IN Category) FROM SALES;
(ii) SELECT LEN (Category) FROM SALES;
(iii) SELECT ROUND (PROFIT, 1) FROM SALES;
(iv) SELECT ITEMCODE FROM SALES ORDER BY ITEMCODE;
(v) SELECT COUNT(PROFIT) FROM SALES;
Question 34.
ABC College of Arts and Science has 4 blocks of buildings at their main campus in Delhi
Shortest distances between various locations:
Admin to Science – 100 M
Admin to Commerce – 70 M
Admin to Arts – 200 M
Science to Arts – 50 M
Science to Commerce – 70 M
Commerce to Arts – 120 M
Number of Computer in various buildings:
Admin -15
Science – 40
Commerce – 25
Arts -10
(i) Suggest the most appropriate block to place the SERVER to get the best and effective connectivity. Justify your answer.
(ii) Suggest the cable layout to efficiently connect various blocks in the campus.
(iii) Will there be any possibility of signal loss? If yes suggest a method to prevent it.
If No justify your answer.
(iv) Suggest a method to ensure security of the entire college network.
(v) Suggest an appropriate technology to connect their sister institution from rural village of patna. What type of network will be formed here?
Answer:
(i) Science block because it has maximum number of computers.
(ii) Following is the cable layout to efficiently connect various blocks in the campus.
OR
Either BUS or STAR TOPOLOGY can be used.
(iii) Yes there will be a possibility for signal loss where the distance is more than 100 M. To prevent the is problem we need to use a device called repeater.
(iv) We can ensure the security of the entire college network by installing a Firewall in the network.
(v) To connect their sister institution from a rural village of Patna they need to use a high bandwidth wired connection using fiber optic cable.
Question 35.
The price of Items are given below:
item=[30,30,30,40,40,50,SO,50,50,60,60,70,70,70]
Write suitable Python code to generate a histogram based on the given data, along with an appropriate chart title and both axis labels and bins = [20,30,40,50,60,70,80],colour=’red’
Also give suitable python statement to save this chart.
Answer:
import matplotlib.pyplot as plt item=[30,30,30,40,40,50,50,50,60,60, 70,Y0,70] plt.hist(item,[20,30,40,50,60,70,80], color='r') plt.title("Hist_Chart") plt.xlabel("X-axis") plt.ylabel("Y-axis") plt.show() plt. savefig ( "sample. jpg")
OR
Write suitable Python code to create ‘FLOWER_Info’ Bar Chart as shown below:
Use the hexadecimal colour code [“#ec4d9a”, “#f3e0d2”, “#fcc201”, “#cc0000”]
Also give suitable python statement to save this chart.
Answer:
import matplotlib.pyplot as plt FLOWER= ('ROSE', 'JASMIN', 'MARIGOLD', 'HIBISCUS') PRICE = [50,10,20,30] plt.bar(FLOWER, PRICE,color=["#ec4d9a","#f3e0d2","#fcc201","#cc0000"]) plt.title("FLOWER_Info") plt.ylabel("PRICE") plt.xlabel("FLOWER") plt.show( ) plt. savefig ("PRICE. jpg")