Xii Infomatics Practices

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

No.

of pages - 10 (E)
MARKING SCHEME
MID-TERM EXAMINATION (2023-24)
CLASS : XII
SUBJECT : INFORMATICS PRACTICES (065)
Time Allowed : 3 hours Maximum Marks : 70

SECTION-A

1. (c) Wes McKinney (1)

2. (d) All (1)

3. (b) pip install pandas (1)

4. (b) DDL (1)

5. (b) average() (1)

6. (b) 3 (1)

7. (b) bar() (1)

8. (d) matplotlib (1)

9. (b) lineheight (1)

10. (c) 2 (1)

11. (a) 4 (1)

12. (b) Len() (1)

13. (a) Structured Query Language (1)

14. (a) MAX() (1)

15. (c) Mod() (1)

16. (b) Mutable, Mutable (1)

17. (a) Both the assertion and reason are correct, and the reason is the correct explanation
for the assertion. (1)

1 XII-INFORMATICS PRACTICES-E
18. (a) Both the assertion and reason are correct, and the reason is the correct explanation
for the assertion. (1)

SECTION-B

19. 02 Mark for the following output (2)

0 False

1 False

2 True

3 True

dtype: bool

01 Mark for correct all 4 values of any Data column or Index

OR

02 Mark for the following code or any other valid code

import pandas as pd

X=[4, 6, 8, 10]

S=pd.Series(X)

print(S)

½ mark for import statement, 1 mark for assign list and Create list statement and ½ mark
for print Series object.

20. (2)

Series Data Frame

Series is 1 Dimensional DataFrame is 2 Dimensional

Series is Homogeneous DataFrame is Heterogeneous

Series is Value Mutable and Size DataFrame is Value Mutable as well a Size
Immutable Mutable

02 Marks for any two valid differences (01 mark for any valid difference)

2 XII-INFORMATICS PRACTICES-E
21. (i) The index of the DataFrame df is the list of subjects: (2)

['IP', 'Bio', 'Chemistry', 'Physics', 'English']

01 Marks for the correct Answer. Quote or format can be ignored.

(ii) The column names of the DataFrame of are the years:

['2018', '2019', '2020']

01 Marks for the correct Answer. Quote or format can be ignored.

22. Subject Marks (2)

0 IP 70

1 CS 82

2 Maths 73

02 Marks for the correct Output.

23. count(column_name) is used to count the number of non-null values in the specified
column.

count(*) is used to count the total number of rows in a result set, regardless of whether
there are null values.

02 Marks for any valid difference. 01 Mark for each count(column_name) and count(*)

24. Aggregate function of SQL: (2)

SUM()

COUNT()

MAX()

MIN()

AVG()

½ Mark for any valid Aggregate function. Total 02 Marks for 04 valid aggregate
functions.
3 XII-INFORMATICS PRACTICES-E
25. (2)

Primary Key Candidate Key

A table can have only one primary key A table can have one or more Candidate
Keys

A primary key is a specific candidate key Candidate key are those attributes of the
that is chosen to uniquely identify each row relation which are eligible to become the
in a table. primary key.

02 Marks for any valid difference

OR

01 mark for define Primary Key and 01 mark for define candidate key

SECTION-C

26. (a) pd.read_csv('filename.csv') (3)

01 Mark for the valid statement.

(b) df.to_csv('filename.csv')

01 Mark for the valid statement.

(c) skiprows=5

01 Mark for the valid statement.

OR
import pandas as pd

data = {'RollNo':[25,29,34],'CLASS': [11,12,11], 'Section': ['A','A', 'B']}

students=pd.DataFrame(data)

print(students)

½ marks for import statement, 1 Marks for create dataframe object and attribute and ½
mark for display dataframe, Also consider any other valid code
4 XII-INFORMATICS PRACTICES-E
27. (a) SELECT * FROM EMPLOYEE WHERE commission is null; (3)

01 Mark for correct query

(b) truncate emp;

or

truncate table emp;

or

delete from emp;

02 Mark for correct query

28. (a) plt.title("Line Chart") (3)

01 Mark for correct statement

(b) plt.savefig("Line.png")

01 Mark for correct statement

(c) plt.show()

01 Mark for correct statement

29. (a) min (3)

01 Mark for correct output

(b) 3

01 Mark for correct output

(c) 11

01 Mark for correct output

OR

(a) 25

01 Mark for correct output

5 XII-INFORMATICS PRACTICES-E
(b) 5

01 Mark for correct output

(c) 8

01 Mark for correct output

30. (a) print(DF.head(3)) (3)

or

print(DF.head(n=3))

Or any other valid code

01 Mark for correct code

(b) print(DF.tail(2))

or

print(DF.tail(n=2))

Or any other valid code

01 Mark for correct code

(c) print(DF.rename(index={'July':'J', 'August':'A', 'September':'S', 'October': 'O','N


ovember': 'N','December': 'D'}))

Or any other valid code 01 Mark for correct code

SECTION-D

31. (a) select min(PRICE) from PRODUCT; (4)

01 Mark for correct query

(b) Degree =3 and cardinality = 4

01 Mark for correct answer

(c) select avg(PRICE) from PRODUCT;

01 Mark for correct query

6 XII-INFORMATICS PRACTICES-E
(d) select upper(P_NAME) from PRODUCT;

or

select ucase(P_NAME) from PRODUCT;

01 Mark for correct query

32. (a) import matplotlib.pyplot as plt (4)

1 mark for write correct statement

(b) plt.bar(Games, Rating)

1 mark for write correct function

(c) plt.ylabel("Rating")

1 mark for write correct function

(d) plt.show()

1 mark for write correct function

OR

import matplotlib.pyplot as plt

A=[10,20,30,40]

B=[15,18,28,45]

X1=[1,5,10,15]

X2=[3,7,12,17]

plt.bar(X1,A,color='r', label='Section-A')

plt.bar(X2,B, color='b', label='Section-B')

plt.xlabel('X-Axis')

plt.ylabel('Y-Axis)

plt.title('Bar Chart')

7 XII-INFORMATICS PRACTICES-E
plt.legend()

plt.show()

Or any other valid code

½ mark for import library, 1 mark for assign values, 1 mark for write bar() statements, ½
mark for label statement, ½ mark for title statement, ½ mark for legend()

SECTION-E

33. (a) b 20 (5)

c 30

d 40

dtype: int64

1 mark for write correct output

(b) b 20

c 30

d 40

dtype: int64

1 mark for write correct output

(c) c 30

dtype: int64

1 mark for write correct output

(d) 30

1 mark for write correct output

(e) c 30

dtype: int64

8 XII-INFORMATICS PRACTICES-E
1 mark for write correct output

OR

(a) (9,)

1 mark for write correct output

(b) 9

1 mark for write correct output

(c) 1

1 mark for write correct output

(d) 72

1 mark for write correct output

(e) Index(['a', 'b', 'c, 'd', 'e', 'f, 'g', 'h', 'T'], dtype='object')

1 mark for write correct output

34. (a) 01 Mark for option (D) i.e. (i), (ii) and (iv)

(b) 01 Mark for option (D) i.e. DF.iat[2,4]=35

(c) 01 Mark for option (B) i.e. columns

(d) 01 Mark for option (B) i.e. inner dictionary's keys

(e) 01 Mark for option (A) i.e. df.sort_values(by='D', ascending=False)

35. (a) 01 Mark for option (A) (5)

(b) 01 Mark for option (A)

(c) 01 Mark for option (A)

(d) 01 Mark for option (B)

(e) 01 Mark for option (C)

OR

9 XII-INFORMATICS PRACTICES-E
(a) 01 Mark for option (A)

(b) 01 Mark for option (A)

(c) 01 Mark for option (A)

(d) 01 Mark for option (B)

(e) 01 Mark for option (A)

10 XII-INFORMATICS PRACTICES-E

You might also like