Set a 2024-25_ms_pre Board Xii Ip

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

KENDRIYA VIDYALAYA SANGTHAN

JABALPUR REGION
FIRST PREBOARD EXAMINATION 2024-25
CLASS XII
INFORMATICS PRACTICES (065) – MARKING SCHEME
TIME: 3 HOURS M.M-70
General Instructions:
 Please check this question paper contains 37 questions.
 All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions
 The paper is divided into 5 Sections- A, B, C, D and E.
 Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
 Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
 Section C consists of 4 questions (29 to 32). Each question carries 3 Marks.
 Section D consists of 2 case study type questions (33 to 34). Each question carries 4 Marks.
 Section E consists of 3 questions (35 to 37). Each question carries 5 Marks.
 All programming questions are to be answered using Python Language only.
 In case of MCQ, text of the correct answer should also be written.

SECTION A
1. Which of the following can be used as data in Pandas? 1
d. All of the Above
2. Which one of the following is not an aggregate function? 1
a. ROUND()
3. It allows a visited website to store its own information about a user on the user‟s 1
computer:
b. Cookies
4. In SQL, what will be output of SELECT INSTR („wednesday‟, 'e'); 1
c. 2
5. Intellectual Property is legally protected through 1
d. All of the above
6. Which of the following attribute is used to convert all rows of a DataFrame to columns and all 1
columns to rows.
b. T
7. Which of the following is correct statement to import pyplot module? 1
a. import matplotlib.pyplot
8. In SQL, What will be output of SELECT Month („2023-05-11‟); 1
b. 5
9. What is a correct syntax to create a Pandas DataFrame? 1
c. pd.DataFrame(data)
10. Suhana left the computer laboratory but forgot to sign off from her email account. Later, 1
her classmate Revaan started using the same computer. He is now logged in as Suhana.
He sends inflammatory email messages to few of his classmates using Suhana‟s email
account. Revaan‟s activity is an example of which of the following cybercrime?
b. Identity theft
11. In what situations can we use having clause and where clause interchangeably in Select 1
queries:
d. Can not be used interchangeably
12. Which device is used to connect to dissimilar networks: 1
b. Gateway
13. To display first three elements of a Series object S, you may write 1
a. S[:3]
14. Which set of the following are open-source software: 1
b. Python, MySQL, Linux
15. To extract row/column from a dataframe _______________ function may be used. 1
c. loc()
16. Which term of following is not similar with rest three : 1
d. INSTR()
17. A DataFrame is : 1
e. Both value and size mutable
18. The part of chart which identifies different sets of data plotted on plot by using different 1
colors is called
a. Legend
19. “When central server fails, entire network fails” this statement is true for which of the 1
following topology:
f. Star
20. (A) Assertion: Pandas series can not be used to create DataFrame 1
(R) Reason: Every column of DataFrame is a pandas series.

g. R is correct but A is incorrect


21. (A) Assertion: MySQL is a database Management system that allows us to create and 1
manipulate databases
(R) Reason : SQL is a data sub language used to manipulate data in the database across
various database management systems.

a. Both A and R are correct but R is not correct explanation of A


SECTION B
22 a. What will be the output of the following code: 2
import pandas as pd
A=pd.Series(data=[10,13,22,18])
print(A>15)

Output will be :
0 False
1 False
2 True
3 True
(1/2 mark on each correct index-value pair)
OR
b. Create a Series monthdays in which name of the months are index and corresponding
number of days are data.

import pandas as pd
monthnames=['JAN','FEB','MAR','APRIL','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC']
days=[31,28,31,30,31,30,31,31,30,31,30,31]
monthdays = pd.Series(days, index=monthnames)
print(monthdays)
(any similar code which gives correct output, 1 marks for correct data formation, 1
mark for correct series formation)
23 What is E-waste? List any two e-waste management techniques. 2

E-waste, or electronic waste, is any unwanted electronic device or component that


contains a circuit board, display device, or computer. It includes items such as: phone,
batteries, hard disk etc.
E-waste management techniques
Reduce:
Refurbish/Reuse:
Recycle:
1 mark on e-waste definition and ½ mark on each technique name.
24. Consider a string “Success is important”, write SQL commands to display: 2
a. the position of the substring „import‟ in the string
select instr("Success is important","import")
1 mark on correct answer
b. the first 4 letters of the string
select left("Success is important",4)
1 mark on correct answer
25. Explain Static and Dynamic Webpage. 2

Static web pages : These pages contains the static information that changes rarely and
these pages are pre-designed and stored on webserver. They are sent when a browser
sends request to access them.
Dynamic web pages : These pages are not already created and not stored on the web
server. These pages are created when a user request is received at the server. A program
(script) fetches the data from the databases and creates them on request and then these
pages are sent to browser. For example : Board exams result page for any specific
student.

1 mark on each correct explanation


26. What is the difference between count() and count(*)? Give Example. 2

Count() function counts the non-null values in the given column while count(*) counts
the number of records in the specified table.

For example, to find the total number of rows in the orders table, you can use the
COUNT(*) function in a SELECT statement as :
SELECT COUNT(*) AS total_rows FROM orders.

Select COUNT(order_id) from orders counts the number of non-null values in the order
id column

1 mark on difference and 1 mark on example.


27. List one positive impact and one negative impact of usage of network technology. 2

Positive Impact : Made the communication easy and fast


Negative Impact : Our personal information is now vulnerable to be misused.

1 mark on any valid positive impact and 1 mark on any valid negative impact
28. a. Carefully observe the following code: 2
import pandas as pd
xiic = {„Amit‟:34, „Kajal‟:27, „Ramesh‟:37}
xiid = {„Kajal‟:34, „Lalita‟:33, „Prakash‟:38}
result = {„PT1‟:xiic, „PT2‟:xiid}
df = pd.DataFrame(result)
print(df)
Answer the following:
i) List the index of the dataframe df
Index(['Amit', 'Kajal', 'Ramesh', 'Lalita', 'Prakash'], dtype='object')

1 mark for correct answer

ii) Find the output of the following code :


print(df.loc[„Kajal‟ : „Ramesh‟])
PT1 PT2
Kajal 27.0 34.0
Ramesh 37.0 NaN
1 mark on correct output
(1/2 marks awarded if only a row or a column is correct)

OR

c. What will be the output of the following:


import pandas as pd
x= [20, 40,90, 110]
y=pd.Series([20, 40,90, 110])
print (x*2)
print(y*2)

Output of First print()


[20, 40, 90, 110, 20, 40, 90, 110]

1 mark on correct output

Output of Second print()

0 40
1 80
2 180
3 220
dtype: int64
1 mark on correct output irrespective of dtype mentioned or not.
SECTION C

29. Manisha received an e-mail from bank stating that there is a problem with her account. 3
The e-mail provides an instruction and a link, by clicking on which she can login her
account and fix the problem.
a. What is happening to Anisha?
She is a victim of phishing attack.
b. What immediate action should she take to handle it?
She should confirm from the bank whether any such problem is there with her
account.
c. Name the law to handle such issues in India.
Information Technology Act
1 mark on each correct answer.
30. a. Consider following dataframe DFSales : 3

Sales Commission Promotion


500 100 254
300 NaN 247
200 125 125
100 187 350

a. Write statement to add one more column Incentive with values


4000,8500,2500,100 respectively.

DFSales['Incentive']=[4000,8500,2500,100]

b. Write statement to add one more row with values 650, 200,450 and 14000.
Consider the column incentive as the part of dataframe.
DFSales.loc[4]=([650,200,450,14000])

c. Write statement to remove sales column from the dataframe.


del DFSales['Sales']

1 mark on each correct answer.

OR
b. Consider following dataframe “ZonalData” :

EmpCode Zone Product SalesQty


E109 NORTH HARD DISK 550
E102 SOUTH HARD DISK 400
F105 NORTH PROCESSOR 120
E109 CENTRAL LAPTOP 75
E102 CENTRAL PROCESSOR 25
F501 SOUTH LAPTOP 65
F602 CENTRAL DESKTOP 300
M540 SOUTH MONITOR 70
F602 WEST MONITOR 90
F602 NORTH DESKTOP 160

a. Write statement to display only those rows where quantity is more than 250.
print(ZonalData[ZonalData.SalesQty>250])

b. Write statement to display first 5 rows.


print(ZonalData.head(5)

c. Write statement to display only Product column.


print(ZonalData.Product)

1mark on each correct answer.


31. Write SQL statements for the following: 3
a. To create a table named “Students” as per following specifications:
Column Name Data Type
Enrollment Char(5)
RNo Integer
Class Integer
Name Varchar(25)
Address Varchar(50)

CREATE TABLE STUDENTS(


ENROLLMENT CHAR(5) primary key,
RNO INTEGER not null,
CLASS INTEGER,
NAME VARCHAR(25),
ADDRESS VARCHAR(50))

1 MARK ON CORRECT DATA TYPE SPECIFICATION AND 1 MARK


ON OVERALL SYNTAX

b. Write SQL Statement to add a new record in the above table having values
Enrollment no. - AC325, Roll No. - 456784, Class- 12, Name- Rajkumar, Address-
MG Road.

INSERT INTO STUDENTS VALUES(„AC325‟,456784,12,‟RAJKUMAR‟,‟MG


ROAD‟);

1 MARK ON CORRECT ANSWER


32 a. Consider following two tables STUDENTS and EXAMS with only a few sample 3
record for example write SQL Statements for questions i to iii:
Students
RollNo Name Class Section
12102 RAVI 12 A
11203 JAYA 11 A
12104 ADITYA 12 B
11205 MAHIMA 11 B

Exams
RollNo ExamName Subject Marks
12102 PT1 BST 38
12103 MT2 ECO 25
11102 PT2 BST 16
11205 MT2 BST 18
i. Display the name, class, examname and marks of all students

SELECT NAME, CLASS, EXAMNAME


FROM STUDENTS, EXAMS
WHERE STUDENTS.ROLLNO = EXAMS.ROLLNO;

ii. Display the average marks in BST in PT2 for all class 12 students.

SELECT AVG(MARKS)
FROM STUDENTS, EXAMS
WHERE (STUDENTS.ROLLNO = EXAMS.ROLLNO) AND
STUDENTS.CLASS=12 AND SUBJECT=‟BST‟;

iii. Display the list of students who scored marks less than 13 in Economics.

SELECT NAME
FROM STUDENTS, EXAMS
WHERE (STUDENTS.ROLLNO = EXAMS.ROLLNO) AND MARKS<13 AND
SUBJECT=‟ECO‟;

1 MARK ON EACH CORRECT ANSWER

OR
b. Consider following two tables EMPLOYEE and DEPTS with only a few sample
record for example write SQL Statements for questions i to iii:
EMPLOYEE
EmpNo EmpName Designation Salary DeptID
560 Rajendra Manager 75000 102
254 Mahesh Manager 65000 104
657 Richa Clerk 45000 102
125 Rashika Manager 75000 106
186 Nihira Clerk 50000 104
DEPTS
DeptID DName ManagerID
102 PRODUCTION 560
104 MARKETING 254
106 HR 125

i. Display the names of employees along with the department names in which they
are working
SELECT EMPNAME,DNAME
FROM EMPLOYEES, DEPTS
WHERE EMPLOYEES.DEPTID=DEPTS.DEPTID;

ii. Display the total salary paid to employees working in “PRODUCTION”


department (Hint : must use Department name)

SELECT SUM(SALARY)
FROM EMPLOYEES, DEPTS
WHERE EMPLOYEES.DEPTID=DEPTS.DEPTID AND DEPTS.DNAME=
„PRODUCTION‟;

iii. Display the number of employee working names of manager of each Department
SELECT EMPNAME,DNAME
FROM EMPLOYEES, DEPTS
WHERE EMPLOYEES.DEPTID=DEPTS.DEPTID and
EMPLOYEES.EMPNO=DEPTS.MANAGERID;

1 MARK ON EACH CORRECT ANSWER.


SECTION D
33. Radha wants to plot a line chart for each student from following data as per the given instruction: 4
SName English BST Accounts Economics IP
Manya 88 96 65 81 92
Rajnish 92 83 73 75 88

Help her to create appropriate data structures to hold above values, plot lines in respect of each
student in different colors, show the legend with the names of students, show the plot and save
with the name “Score.pdf”

import matplotlib.pyplot as plt


manya =[88,96,65,81,92]
rajnish =[92,83,73,75,88]
subjects=["English","BST","Accounts","Economics","IP"]
plt.plot(subjects,manya,label="Manya")
plt.plot(subjects,rajnish, label="Rajnish")
plt.show()
plt.savefig("Score.pdf")

½ MARK ON EACH CORRECT LINE

34. a. Consider following table Employees and write SQL statements for the question is 4
given below:
Empid EmpName Designation Salary Benefits
110 e
Ravi Manager 75000 15000
105 Harry Manager 65000 15000
152 Sam Director 80000 25000
215 Sarah Manager 75000 12500
244 Manila Clerk 50000 12000
300 Robert Clerk 45000 10000
335 Ritu Clerk 40000 10000
400 Rachel Salesman 32000 7500
441 Peter Salesman 28000 7500

a. To display the Designation and sum of salary designation wise.


Select Sum(Salary), Designation from Employees Group by Designation;
b. To display the designation and number of employees working on each
designation.
Select count(Designation), Designation from Employees Group by Designation;

c. To display the Designation for which the average benefits are less than 12000.
Select avg(Benefits), Designation from Employees Group by Designation
having avg(Benefits) <12000;

d. To find the average salary paid to Salesman.


Select avg(Salary) from employees where Desgination=”Salesman”

1 mark on each correct answer.

OR
b. Consider the following table “Teachers” write the output of each of SQL
statement as given :
No. Name Age Department DateofJoin Salary Sex
1 Jugal 34 Computer 1997-01-10 12000 M
2 Sharmila 31 History 1998-03-24 20000 F
3 Sandeep 32 Maths 1996-12-12 30000 M
4 Sangeeta 35 History 1999-07-01 40000 F
5 Rakesh 42 Maths 1997-09-05 25000 M
6 Shyam 50 History 1998-06-27 30000 M
7 Shivam 44 Computer 1997-02-25 21000 M
8 Shalakha 33 Maths 1997-07-31 20000 F

i. SELECT LENGTH(NAME) FROM TEACHERS WHERE SALARY<20000;


LENGTH(NAME)
5

ii. SELECT NAME,DEPARTMENT FROM TEACHERS WHERE


MONTH(DATEOFJOIN)=6
Name Department
Shyam History

iii. SELECT SUM(SALARY), DEPARTMENT FROM TEACHERS GROUP BY


DEPARTMENT
SUM(Salary) Department
33000 Computer
90000 History
75000 Maths
iv. SELECT AVG(AGE),SEX FROM TEACHERS WHERE DEPARTMENT =
“History” GROUP BY SEX

AVG(AGE) SEX
33 F
50 M
1 MARK ON EACH CORRECT OUTPUT
SECTION E
35 a. Any suitable similar layout (with proper justification) 1mark 5
b. The most suitable place to house the server is the Science Block as it has a
maximum number of computers. Thus, reducing the cabling cost and
increasing efficiency of the network.
c. (ii) Switch is the device to be installed in each of the blocks to connect all the
computers.
d. Satellite connection.
e. Voice Over Internet Protocol

36. Consider the given dataframe DF and write Python code for the following 5
DF
QTR1 QTR2
A 30 40
B 28 75
C 54 39
a. Add a new column QTR3 with value 35,63, & 42 for A,B & C respectively
DF[„QTR3‟] =[35,63,42]

b. Add a new row D with values 75, 67 and 83 for QTR1, QTR2 and QTR3 respectively.
DF.loc[„D‟]=[75,67,83]

c. Delete the newly added column QTR3


del DF[„QTR3]

d. Delete the newly added row D


DF.drop(label= „D‟, axis=0, inplace=True)

e. Save the content of dataframe to a CSV file “DFdata.CSV”


DF.to_csv(“DFdata.CSV”)

1 mark on each correct answer.

37. a. Write suitable SQL query for the following: 5


i. Extract 4 characters from the letter „H‟ from string „INDIA SHINING‟.
select substr('INDIA SHINING',8,4);
ii. Display the position of string „COME‟ in the string „WELCOME WORLD‟
select instr("WELCOME WORLD", "COME");
iii. Round off the value 78.779 to 2nd decimal place.
Select Round(78.779,2);
iv. Display the remainder of 149 divided by 6.
Select Mod(149,6);
v. Remove all the expected leading and trailing spaces from a column userid of
the table „USERS‟ and convert to lowercase.
SELECT LOWER(TRIM(USERID)) FROM USERS;

1 MARK ON EACH CORRECT ANSWER.

OR

b. Explain the following SQL functions using suitable examples.


i. LENGTH()
Length function returns the length of given string.
Eg. Select length(“computer”);
Output : 8
ii. TRIM()
Trim function removes the leading and trailing spaces from the given string
Eg. Select TRIM(“ PYTHON ”);
Output : PYTHON

iii. NOW()
Now() function returns the current system date and time.
Eg. Select Now() ;
Output : 2024-10-25 21:00:50 (it may be any date and time)
iv. DAYNAME()
This function returns the name of weekday from the date given.
Eg. select dayname('2024-11-1');
Output : Friday

v. POWER()
This function returns the value of x to the power y where the x and y are
passed as arguments to the function.
Eg. Select Power(2,3);
Ouput : 8

½ mark on each explanation and ½ mark on example or correct syntax.

You might also like