Subject: Informatics Practices
Class XII
Time Allowed: 3 hours
Max. Marks: 70
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 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 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only.
8. All programming questions are to be answered using Python Language only
PART A
1. Computers connected by a network across different cities is an example of _____________.
i. LAN ii. MAN iii. WAN iv. PAN
2. Out of the following, which crime(s) will come under cyber crime category ?
i. Identity theft ii. Invasion of privacy iii. Online harassment iv. All of the above
3. E-waste is harmful to the environment and human health if not properly treated or disposed of, therefore they must be handled with care. What are the health hazards which can be caused by E-waste?
i. Lung cancer ii.DNA damage iii. Brain damage iv All of the above
4.What will be returned by the given query? SELECT RIGHT(“LEFT”, 2)=
(i) LE (ii) FT (iii) RI (iv) HT
5. If column “Fees” contains the data set (5000,8000,7500,NULL,5000,8000), what will be the output after the execution of the given query?
SELECT COUNT (DISTINCT Fees) FROM student;
i. 2 ii. 3 iii. 4 iv. 5
6. ‘F’ in FOSS stands for:
i. Free ii. Forever iii. Fire iv. Freezing
7.Identify Single Row function of MySQL among the following
i. Trim() ii. Max() iii. Avg() iv. Count()
8.What will be returned by the given query? select round(23456.1234,-2)=
i. 23456.00 ii. 23400 iii. 23500 iv. 23456.1200
9. Which one of the following functions is used to find the smallest value from the given data in MySQL?
i. MIN( ) ii. MINIMUM( ) iii. SMALL( ) iv. SMALLEST( )
10. To display last five rows of a series object ‘S’, you may write:
i. S.Tails(5) ii. S.Tail(5) iii. S.Head(5) iv. S.tail()
11. Which of the following statement will import pandas library?
i. Import pandas as pd
ii. import Pandas as pd1
iii. import pandas as pd2
iv. import panda as pd3
12.Which of the following code will display the total number of rows in DataFrame stud
i. print(len(stud.axes[0])
ii. print(stud.len(0))
iii. print(stud.len[axes=0])
iv. print(len(stud.axes[row])
13. Google chromeis an example of a
i. Website ii. Web browser iii. Web Page iv. Web Software
14. In SQL, which function returns the name of the weekday? The DAYNAME function
i. Nameofday () ii. Nameday() iii. Weekday() iv. Dayname ()
15. Legal term to describe the rights of a creator of original creative or artistic work is:
i. Copyright ii. Copyleft iii. GPL iv. FOSS 1
16. ____________is the practice of taking someone else’s work or ideas and passing them off as one’s own:
i. Plagiarism ii. Copyright iii. Patent iv. All of the above
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as
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
17. Assertion (A): – A repeater is an electronic device that receives a signal and retransmits it.
Reasoning (R): – Repeaters are used to extend transmissions so that the signal can cover longer distances.
Ans. Both A and R are true and R is the correct explanation for A
18. Assertion (A): – In Series, values of Data is Immutable: Value of elements cannot be changed. Reasoning (R): – Pandas Series are homogeneous one-dimensional objects, that is, all data are of the same type.
Ans. A is false but R is True
PART B
19 How do Computer networks reduce hardware costs of an organization? Explain with the help of example.
Ans. Computer network allows sharing of hardware resources thereby reducing hardware cost of an organization. For example, a printer can be shared among the users in a network so that there’s no need to have individual printers for each and every computer in the network.
OR
Distinguish between static and dynamic web page.
Ans. Static: The contents of static page are usually unchanged over long period of time and written down manually inside HTML documents directly. The content is static and will show same content to almost every visitor. Dynamic: Dynamic webpages can show the different content, information. It is designed by server side scripting language like PHP, ASP, JSP with HTML, CSS.
The content is dynamic and will change accordingly to the situation.
20 Mr. Janak is using a table with following columns:
Name, Class, Course_Id, Course_name
He need to display names of students, who have not been assigned any stream or have been assigned Course_name that ends with “economics”. He wrote the following command, which did not give the desired result. Select name,class from students where course_name=NULL or course_name=”%economics”;
Help Mr.Janak to run the query by removing the error and write the correct query.
Ans. Select name from students where stream_name is NULL or stream_name like”%economics”;
21. What is the purpose of DROP TABLE command in MySql ? How is it different from DELETE command?
Ans. The DROP command is used to remove a table
Difference:
(i) DELETE command removes rows from a table while DROP TABLE removes the table (rows as well as the structure)
(ii) DELETE is a DML command while DROP TABLE is a DDL command
(iii) The effect of DELETE command can be rolled back while the effect of DROP TABLE cannot be rolled back
22. Write python code to create the following Series Stock (using list)
Ans. import pandas as pd
L=[“PEN”,”PENCIL”,”ERASER”]
Stock=pd.Series(L,index=[1,2,3])
23. Ms Samtha has many electronics gadgets which are not usable due to outdated hardware and software. Help her to find any three best ways to dispose the used electronic gadgets.
Ans. 1. Give Your Electronic Waste to a Certified E-Waste Recycler
2. Donating Your Outdated Technology
3. Give Back to Your Electronic Companies and Drop Off Points
OR
What do you understand by Net Ettiquetes? Explain any two such ettiquetes
Ans. Net Ettiquets refers to the proper manners and behaviour we need to exhibit while being online. These include :
i. No copyright violation: we should not use copyrighted materials without the permission of the creator or owner. We should give proper credit to owners/creators of open source content when using them.
ii. Avoid cyber bullying: Avoid any insulting, degrading or intimidating online behaviour like repeated posting of rumours, giving threats online, posting the victim’s personal information, or comments aimed to publicly ridicule a victim.
24. Give the output
import pandas as pd
name=[‘Pahul’,’Aman’,’Karan’]
p=pd.Series(name,index=[0,1,2])
p1=p.reindex([1,2,3])
print(p)
print (p1)
Ans.
0 Pahul
1 Aman
2 Karan
1 Aman
2 Karan
3 NaN
25. Carefully observe the following code:
import pandas as pd
list_of_dict = [
{‘Name’: ‘Sourab’ , ‘Age’: 35, ‘Marks’: 91},
{‘Name’: ‘Rohan’, ‘Age’: 31, ‘Marks’: 87},
{‘Name’: ‘Shalini’, ‘Age’: 33, ‘Marks’: 78},
{‘Name’: ‘Divya’ , ‘Age’: 23, ‘Marks’: 93},
]
df = pd.DataFrame(list_of_dict)
print(df)
Answer the following:
i. List the index of the DataFrame df
Ans. Index : 0,1,2,3
ii. List the column names of DataFrame df.
Ans. Column : Name,Age,Makrs
SECTION C
26. Mr. Som, a HR Manager in a multinational company “Star-X world” has created the following table to store the records of employees:
He has written following queries:
i) select max(year(DOB)) from emp;
Ans. 2001
ii) select ENAME from emp where month(DOJ)=11;
Ans. Melinda
iii)Select length(EName) from Emp where Department=”IT”
Predict the output.
Ans. length(EName)
7
5
27. Write a python code to create a dataframe with appropriate headings from the list given below [‘S101’, ‘Amy’, 70], [‘S102’, ‘Bandhi’, 69], [‘S104’, ‘Cathy’, 75], [‘S105’,’Gundaho’, 82]
Ans.
import pandas as pd
data = [[‘S101’, ‘Amy’, 70], [‘S102’, ‘Bandhi’, 69], [‘S104’,’Cathy’, 75], [‘S105’, ‘Gundaho’, 82]] df = pd.DataFrame(data, columns = [‘ID’, ‘Name’, ‘Marks’])
print(df )
28.Consider the dataframe SHOP given below:
Write commands to :
(i) Write short code to show the information having city=”Delhi”
Ans. print(SHOP[SHOP.City==’Delhi’])
(ii) Calculate Qty* Price and assign to column ‘Net_Price’
Ans. SHOP[‘Net_Price’]=SHOP.Qty*SHOP.Price
(iii) Display name of all rows
Ans. print(SHOP.axes[0]) #or print(SHOP.index)
29. Sutapa received an email from her bank stating that there is a problem with her account. The email provides instructions and a link, by clicking on which she can logon to her account and fix the problem. Help Sutapa by telling her the precautions she should take when she receives these type of emails.
Ans. She should check whether it is a valid bank site or not by checking in the url https. It is always better to type the url and then login to the site. She should not click on the link provided in the email.
OR
Write names of any two common types of Intellectual Property Rights which are protected by the Law.
Ans. (Any two from the following)
● Rights upon musical, literary, and artistic works
● Rights upon discoveries and inventions
● words, phrases, symbols, and designs
● copyrights, trademarks, patents, industrial design rights and trade secrets
30. A relation Vehicles is given below:
Write SQL commands to:
a. Display the average price of each type of vehicle having quantity more than 20.
Ans. select Type, avg(Price) from Vehicle group by Type having Qty>20;
b. Count the type of vehicles manufactured by each company.
Ans. select Company, count(distinct Type) from Vehicle group by Company;
c. Display the total price of all the types of vehicles.
Ans. Select Type, sum(Price* Qty) from Vehicle group by Type;
OR
What is the difference between the order by and group by clause when used along with the select statement? Explain with an example
Ans. The order by clause is used to show the contents of a table/relation in a sorted manner with respect to the column mentioned after the order by clause. The contents of the column can be arranged in ascending or descending order. The group by clause is used to group rows in a given column and then apply an aggregate function eg max(), min() etc on the entire group.
SECTION D
31. Consider the following table named “GARMENT”.
Table: GARMENT
Write SQL queries using SQL functions to perform the following operations:
a) Display name and price after rounding off to one decimal place.
Ans. select gname,round(price,1) from Garment
b) Display the all Gname in upper case.
Ans. Select upper(Gname) from Garment
c) Display the last three characters from gname.
Ans. Select right(gname,3) from Garment
d) Display the highest Gcode from table garment.
Ans. Select max(gcode) from Garment
e) Display the sum of all price of size ‘L’.
Ans. Select sum(price) from Garment where size=’L’
OR
Write the SQL functions which will perform the following operations:
(i) To return the summation of all non-NULL values a set.
Ans. SUM()
(ii) To extract a substring starting from a position with a specific length
Ans. SUBSTRING()
(iii) To convert a string to uppercase
Ans. UPPER()
(iv) To return the year for a specified date
Ans. YEAR()
(v) To truncates a number to a specified number of decimal places
Ans. TRUNCATE()
32. A company in Mega Enterprises has 4 wings of buildings as shown in the diagram: [SP 21]
Center to center distances between various Buildings:
W3 to W1 – 50m
W1 to W2 – 60m
W2 to W4 – 25m
W4 to W3 – 170m
W3 to W2 – 125m
W1 to w4 – 90m
Number of computers in each of the wing:
W1 – 150
W2 – 15
W3 – 15
W4 – 25
Computers in each wing are networked but wings are not networked The company has now decided to connect the wings also.
i. Suggest a most suitable cable layout for the above connections.
Ans. Most suitable layout according to distance is :
ii. Suggest the most appropriate topology of the connection between the wings.
Ans. Star Topology
iii. The company wants internet accessibility in all the wings. Suggest a suitable technology.
Ans. Broadband.
iv. Suggest the placement of the following devices with justification if the company wants minimized network traffic a) Repeater b)Hub / switch
Ans. a. Not required.
Repeaters may be skipped as per above layout (because distance is less than 100 m)
b. In every wing
v. The company is planning to link its head office situated in New Delhi with the offices in hilly areas. Suggest a way to connect it economically
Ans. Radio Waves
33.Write python code to draw the following bar graph representing the number of students in each class.
Ans.
import matplotlib.pyplot as plt
classes = [‘VII’,’VIII’,’IX’,’X’]
students = [40,45,35,44]
plt.bar(classes, students)
plt.show()
OR
Write python code to create a Line Graph using list of elements x and y. Set ylabel as “marks” and xlabel as “names”. Title of graph is “Result”
x=[‘A’,’B’,’C’,’D’,’E’]
y=[82,25,87,14,90]
Ans. import matplotlib.pyplot as p1
x=[‘A’,’B’,’C’,’D’,’E’]
y=[82,25,87,14,90]
p1.ylabel(“marks”)
p1.xlabel(“names”)
p1.title(“RESULT”)
p1.plot(x,y)
p1.show()
SECTION E
34. Consider the following table named“Student”
Write the SQL functions which will perform the following operations:
(i) To show the sum of fees of all students
Ans. select sum(Fees) from student
(ii) To display the maximum and minimum marks.
Ans. select min(marks),max(marks) from student
(iii) To count the different types of grade available.
Ans. select count(distinct grade) from student
OR (Option for part iii only)
Write a query to count grade wise total number of students
Ans.
Select count(*),grade from student group by grade
35 A. Consider the dataframe “EMP”
Give the output
EMP.iloc[1,2]=8000
EMP.Hra=EMP.Hra+200
print(EMP)
Ans.
OUTPUT Name Basic Da Hra
E1 Sanya 9500 3000 2200
E2 Krish 7000 8000 2100
E3 Rishav 9650 1500 2300
E4 Deepak 7500 2000 2900
E5 Kriti 9200 1800 700
B. Write Python statement to Change the name ‘Rishav’ to ‘Rishab’ in the above dataframe
Ans. EMP.iloc[2,0]=’Rishab’
OR (Option for part B only)
Write Python statement to calulate sum of Basic,Da and Hra and assign to column “Salary”
Ans. EMP[‘Salary’]=EMP.Basic+EMP.Da+EMP.Hra