/**/ Python & MySQL: February 2021

Friday, February 26, 2021

IP PRACTICAL QUESTIONS FOR CLASS XII (2020-21) (SET -3)

To get latest sample paper for class XII (IP) 2021 

PRACTICAL QUESTIONS FOR CLASS XII (2020-21)

SUBJECT – INFORMATICS PRACTICES

MM – 30                                        TIME – 3 HOURS

SET – 3

 

Q.1 Takshila Academy School celebrated volunteering week where each section of class XI dedicated a day for collecting amount for charity being supported by the school. Section A volunteered on Monday, B on Tuesday, C on Wednesday and so on. There are six sections in class XI. Amount collected by sections A to F are 9000, 13000, 8900, 12200, 14500, 6500.

(a) Create a bar chart showing collection amount.

(b) Plot the collected amount vs. days using a bar chart.


Q.2

Consider the following table FURNITURE. Write SQL commands for the statements (i) to (Viii) and write output for SQL queries (ix) and (x).

Table: FURNITURE

FCODE

NAME

PRICE

MANUFDATE

WCODE

10023

Coffee table

4000

10-Dec-2016

W03

10001

Dining table

20500

12-JAN-2017

W01

10012

Sofa

35000

06-JUNE-2016

W02

10024

Chair

2500

07-APR-2017

W03

10090

Cabinet

18000

31-MAR-2015

W02

(i) To display FCODE, NAME and PRICE of items that have Price less than Rs. 5000.

(ii) To display NAMES and PRICE of those Furniture Items that have table anywhere in their names.

(iii) To display WCode of Furniture Items. There should be no duplicate values.

(iv) To display the NAMES and PRICE increased by 500.00 of all the furniture items. (Price should only be displayed as increased; there should be no increase in the data in the table).

(v) To display FCODE and NAME of each Furniture Item in descending order of FCODE.

(vi) To display the details of all the Furniture Items which have Manufacturing date (MANUFDATE) between 01-JAN-2016 and 15-JUNE-2017 (inclusive of both the dates).

(vii) To display the average PRICE of all the Furniture Items, which are made of Wood with WCODE  as W02.

(viii) To display WCODE along with highest price of Furniture Items.

(ix) SELECT SUM(PRICE) FROM FURNITURE WHERE WCODE = ‘W03’;

(x) SELECT COUNT(DISTINCT PRICE) FROM FURNITURE;


SOLUTION:

Answer-1

(i)

import numpy as np

import matplotlib.pyplot as plt

col = [9000, 13000, 8900, 12200, 14500, 6500]

X=np.arange(6)

plt.title("Takshila Volunteering Week Collection")

plt.bar(X, col, color = 'g', width = 0.50)

plt.show()

OUTPUT


(ii)

import numpy as np

import matplotlib.pyplot as plt

col = [9000, 13000, 8900, 12200, 14500, 6500]

X=np.arange(6)

plt.title("Takshila Volunteering Week Collection")

plt.bar(X, col, color = 'Red', width = 0.50)

plt.xticks(X,['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'])

plt.xlabel("Days")

plt.ylabel("Collection")

plt.show()

OUTPUT



Answer - 2

1. SELECT FCODE, NAME, PRICE FROM FURNITURE WHERE PRICE < 5000;

2. SELECT NAME, PRICE FRON FURNITURE WHRERE NAME LIKE ‘%TABLE%’;

3. SELECT DISTINCT WCODE FROM FURNITURE;

4. SELECT NAME, PRICE+500 FROM FURNITURE;

5. SELECT FCODE, NAME FROM FURNITURE ORDER BY FCODE DESC;

6. SELECT * FROM FURNITURE WHERE MANUFDATE BETWEEN ’01-JAN-2016’ AND ’15-JUNE-2016’;

7. SELECT AVG(PRICE) FROM FURNITURE WHERE WCODE = ‘W02’;

8. SELECT WCODE, MAX(PRICE) FROM FURNITURE;

Output for SQL queries (ix) and (x)

9. 

SUM(PRICE)

6500



10.

COUNT(DISTINCT PRICE)

5

 

To get latest sample paper for class XII (IP) 2021

Continue to visit the blog....



Thank You !!!











Tuesday, February 23, 2021

PRACTICAL QUESTIONS FOR CLASS XII (2020-21) (SET -2)

 SUBJECT – INFORMATICS PRACTICES

MM – 30                                            TIME – 3 HOURS

SET-2

Q.1 Write a python program to generate a bar chart for the following information


Country

Population

India

130

China

140

USA

33

Indonesia

22

Bangladesh

16


  1. The bar Chart should have different Colours for each Country
  2. There Should be proper labels for X and Y axis
  3. The Title of the chart should be ‘World Population’
  4. Draw the Chart generated in your PC in the Answer Paper


Q.2  Consider the table PROJECTWORK given below. Write commands in SQL for (i) to (iv).

Table: PROJECTWORK

ID

ProjectName

Size

StartDate

EndDate

Price

P1

Payroll-M

Medium

2010-03-17

2010-09-16

60000

P2

Payroll-I

Large

2012-02-12

2013-01-11

50000

P3

Mgmt-L

Large

2012-06-13

2013-05-21

30000

P4

Recruit-L

Medium

2012-03-18

2012-06-01

50000

P5

Mgmt-M

Small

2009-01-15

2009-01-20

20000

P6

Recruit-I

Medium

2012-03-01

2012-06-28

50000

Questions:

  1. To display all information about projects of medium size.
  2. To list the size of projects whose ProjectName ends with L.
  3. To list ID, ProjectName, Size and Price of all the projects in descending orders of StartDate.
  4. To count the number of projects of price less than 100000.


SOLUTION:

(I)

import matplotlib.pyplot as plt

country = ['India', 'China', 'USA', 'Indonesia', 'Bangladesh']

population = [130, 140, 33, 22, 16]

plt.bar(country, population, color=['red', 'black', 'green', 'blue', 'yellow'])

plt.xlabel("Country")

plt.ylabel("Population")

plt.title("World Population")

plt.show()

(II)

  1. SELECT * FROM PROJECTWORK WHWER SIZE = “Medium”;
  2. SELECT * FROM PROJECT WORK WHERE PROJECTNAME LIKE “L”;
  3. SELECT ID, PROJECTNAME, SIZE, PRICE FROM PROJECTWORK ORDER BY STARTDATE DESC;
  4. SELECT COUNT(*) FRP, PROJECTWORK WHERE PRICE<100000;


I will provide the many sets of practical question papers. I hope everyone follow my blog.


Thank You !!!




PRACTICAL QUESTIONS FOR CLASS XII (2020-21)

 SUBJECT – INFORMATICS PRACTICES

MM – 30                                           TIME – 3 HOURS

                                                        SET-1

Q.1

Salesman

SNo

SName

Sale1

Sale2

101

George

15

20

102

Sulivan

17

18

103

Teresa

14

19

104

Peter

12

13


Write a program in Python Pandas to create the following DataFrame salesman from a Dictionary:

  • Create and display the DataFrame
  • Display the average score of Sale1 column.
  • Show the sales of sulivan only.


Q.2

Consider the following table named “GYM” with details about fitness items being sold in the store. Write command of SQL for (i) to (iv).

Table : GYM

ICODE

INAME

PRICE

BRADNAME

G101

Power Fit Exerciser

20000

Power Gymea

G102

Aquafit Hand Grip

1800

Reliable

G103

Cycle Bike

14000

Ecobike

G104

ProtonerExexteme Gym

30000

Coscore

G105

Message Belt

5000

Message Expert

G106

Cross Trainer

13000

GTC Fitness


Questions:

  1. To display the name of all the items whose name starts with “A”.
  2. To display ICODes and INAMEs of all items, whose Brandname is Reliable or Coscore.
  3. To change the Brandname to “Fit Trend India” of the item, whose ICODE is “G101”.
  4. To add a new row for new item in GYM with the details:

“G107”,  “Vibro exerciser”,  21000,  “GTCFitness”

SOLUTION

(I)

Import pandas as pd

df = {‘SNo’ : [102, 102, 103,104],

‘SName’: [‘George’, ‘Sulivan’, ‘Teresa’, ‘Peter’],

‘Sale1’ :[ 15, 17, 14, 12],

‘Sale2’: [20, 18, 19, 13]}

Salesman=pd.DataFrame(df)

(i) print(salesman)

(ii) salesman.Sale1.mean()             or      salesman[‘Sale1’].mean()

(iii)salesman[salesman[‘SName’]==’Sulivan’]

or

salesman[salesman[‘SName’]==’Sulivan’]

(II)

  1. SELECT INAME FROM GYM WHERE INAME LIKE “A%”;
  2. SELECT ICODE, INAME FROM GYM WHERE BRANDNAME = “RELIABLE” AND “COSCORE”;
  3. UPDATE GYM SET BRANDNAME = “FIT TREND INDIA” WHERE ICODE = “G101”;
  4. INSERT INTO GYM VALUES(“G107”, “VIBRO EXERCISER”, 21000, “GTCFITNESS”;


I will provide many sets of practical sample papers for class XII (IP)

Continue to visit the blog.


Thank You !!!








CLASS XI HALF YEARLY QP WTH MS 2024

  Half Yearly Examination: 2024-25 Informatics Practices (065) Class- XI       Time Allowed: 3hrs                                     ...