# CBSE XII Informatics Practices 065 Practical Question Paper Set 1 – Download Word Document

AISSCE XII Informatics Practices 065 – Practical Question Paper Set #1 – Download Word File

All India Senior Secondary Certificate Examination
XII Informatics Practices 065- Practical Question Paper Set #1

### Answer Key of Set 1 Practical Examination Question Paper

Q1.      Problem Solving using PYTHON                         [5 + 3 = 8]

1. Write the code to create the series ‘serObj’ and answer the questions followed.                   (5)

Jan            31

Feb            28

Mar           31

Apr           30

1. Write the command to add one row: ‘May’ – 31
2. Write the command to update Feb to 29
3. Write the command to change index to 1,2,3,4,5 in place of Jan, Feb, Mar, Apr and May.
4. Write a command to print a month name having number of days less than 31.
5. Write the output:
1. print(serObj < 30)
2. print(serObj + 3)

Answer: import pandas as pd                                                                            # importing pandas

serObj = pd.Series([31,28,31,30], index=[‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’])          # creating series

>>>      serObj

Jan    31

Feb    28

Mar    31

Apr    30

dtype: int64

(i) serObj[‘May’] = 31                                                                           # Adding one more row

>>>      serObj

Jan    31

Feb    28

Mar    31

Apr    30

May    31

dtype: int64

(ii) serObj[‘Feb’] = 29                                                                           # Updating value of Feb

>>>      serObj

Jan    31

Feb    29

Mar    31

Apr    30

May    31

dtype: int64

(iii)       serObj.index = [1, 2, 3, 4, 5]                                          # to change the month name

>>>      serObj

1    31

2    29

3    31

4    30

5    31

dtype: int64

(iv)       serObj.index = [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’]                           # to change the month name

serObj[serObj < 31].index

Index([‘Feb’, ‘Apr’], dtype=’object’)

(iv) Output

(a) print(serObj < 30)

Jan       False

Feb       True

Mar      False

Apr       False

May      False

dtype: bool

(b) print(serObj + 3)

Jan       34

Feb       32

Mar      34

Apr       33

May      34

dtype: int64

(b) Write a Python program to display a BAR CHART of the number of students in a school.                (3)

• Use different colors for each bar.
• Title for x axis should be ‘Groups’ and title for y axis should be ‘Number of Students’
• Ensure the title of chart is “Group wise Students” and grid line must be shown.

Sample data:  Group: I, II, III, IV and Strength: 38, 30, 45, 49

import matplotlib.pyplot as plt

Group = [‘I’, ‘II’, ‘III’, ‘IV’]

Strength = [38,30,45,49]

plt.bar(Group, Strength, color=[‘red’, ‘green’, ‘blue’, ‘black’])

plt.xlabel(‘Group’)

plt.ylabel(‘Number of Students’)

plt.title(“Group wise Students”)

plt.grid(True)

plt.show()

Output:

Q2       SQL Queries:                                                                                                                            [2+5=7]

1. Create a table DRUGDB with the fields given in above table and assuming data type of your own.
2. Consider the table DRUGDB. Write the SQL commands for queries given below:
3. To increase the price of “Paracetamol” by 35.
4. To display the drugid, Rxid and pharmacy name of all records in descending order of their price.
5. Display all the details of the drugs where name starts with ‘C’ and has ‘sh’ somewhere in the name.
6. Display the drug name in lower case along with price rounded off to nearest interger.
7. Delete the field name loc from drugdb table.

(a) CREATE TABLE DRUGDB (

RxID CHAR(10) PRIMARY KEY,

DrugID INTEGER,

Drugname VARCHAR(30),

Price DECIMAL(10,2),

PharmacyName VARCHAR(40),

Loc  VARCHAR(20)

);

(b)  SQL Commands

(i) UPDATE DRUGDB SET price = price + 35 WHERE Drugname = ‘PARACETAMOL’;

(ii) SELECT DRUGID, RXID, PHARMACYNAME

FROM DRUGDB

ORDER BY PRICE DESC;

(iii) SELECT * FROM DRUGDB WHERE DRUGNAME LIKE ‘C%SH%’ ;

(iv) SELECT LOWER(DRUGNAME), ROUND(PRICE, 0) FROM DRUGDB ;

(v)  ALTER TABLE DRUGDB DROP LOC;