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 |
- The bar Chart should have different Colours for each Country
- There Should be proper labels for X and Y axis
- The Title of the chart should be ‘World Population’
- 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:
- To display all information about projects of medium size.
- To list the size of projects whose ProjectName ends with L.
- To list ID, ProjectName, Size and Price of all the projects in descending orders of StartDate.
- 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)
- SELECT * FROM PROJECTWORK WHWER SIZE = “Medium”;
- SELECT * FROM PROJECT WORK WHERE PROJECTNAME LIKE “L”;
- SELECT ID, PROJECTNAME, SIZE, PRICE FROM PROJECTWORK ORDER BY STARTDATE DESC;
- 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 !!!
No comments:
Post a Comment
Please do not any spam in the comment box.