LIST OF PRACTICAL
CLASS-XII
INFORAMATICS PRACTICS (065)
1. Write a NumPy program to create an array of 10 Zeroes, 10 ones, 10 fives.
2. Write a NumPy program to create a 3x3 matrix with values ranging from 2 to 10.
3. Write a NumPy program to extract all odd numbers from an array.
4. Write a NumPy Program to replace all odd numbers NaN array with -1 without
changing it.
5. Write a NumPy program to generate six random integers between 25 and 55.
6. Write a Pandas program to convert a Panda module Series to Python list and it’s type.
7. Write a Pandas program to compare the elements of the two Pandas Series?
8. Write a Python program to convert a dictionary to a Pandas series. Sample Series:
9. Dictionary:
{'a': 100, 'b': 200, 'c': 300,’d’: 400, 'e': 800}
Converted series:
a. a 100
b. b 200
c. c 300
d. d 400
e. e 800
f. dtype: int64
10. Write a Pandas program to add, subtract, multiple and divide two Pandas Series
11. Write a Program to sort the element of Series S1 into S2
12. Write a NumPy program to reverse an array Ar
13. Write a NumPy program to create a 8x8 matrix and fill it with a checkerboard
pattern. Checkerboard pattern:
[[0 1 0 1 0 1 0 1]
[1 0 1 0 1 0 1 0]
[0 1 0 1 0 1 0 1]
[1 0 1 0 1 0 1 0]
[0 1 0 1 0 1 0 1]
[1 0 1 0 1 0 1 0]
[0 1 0 1 0 1 0 1]
[1 0 1 0 1 0 1 0]]
14. Write a NumPy program to append values to the end of an array. Expected Output:
Original array:
i. [10, 20, 30]
b. After append values to the end of the array:
i. [10 20 30 40 50 60 70 80 90]
15. Write a NumPy program to test whether each element of a 1-D array is also present in
a second array.
16. Write a NumPy program to find the number of elements of an array, length of one
array element in bytes and total bytes consumed by the elements.
17. Write a Pandas program to select the rows where the height is not known, i.e. is
NaN.
'name': ['Asha', 'Radha', 'Kamal', 'Divy', 'Anjali'],
'height': [ 5.5, 5, [Link], 5.9, [Link]],
'age': [11, 23, 22, 33, 22]
18. Write a Pandas program to select the name of persons whose height is between 5 to
5.5 (both values inclusive)
'name': ['Asha', 'Radha', 'Kamal', 'Divy', 'Anjali'],
'height': [ 5.5, 5, [Link], 5.9, [Link]],
'age': [11, 23, 22, 33, 22]
19. Consider the following DataFrame
Name Age Score
0 Scachin 26 87
1 Dhoni 25` 67
2 Virat 25 89
3 Rohit 24 55
4 Shikhar 31 47
a. Write a program sort the Pandas Dataframe on the basis of a single column in
Descending order.
20. Draw the histogram based on the Production of Wheat in different Years
Year:2000,2002,2004,2006,2008,2010,2012,2014,2016,2018
Production':4,6,7,15,24,2,19,5,16,4
21. Write a program to create dataframe for 3 student including name and roll numbers.
and add new columns for 5 subjects and 1 column to calculate percentage. It should
include random numbers in marks of all subjects.
22. The table shows passenger car fuel rates in miles per gallon for several years. Make a
LINE GRAPH of the data. During which 2-year period did the fuel rate decrease?
YEAR: 2000 2002 2004 2006
RATE: 21.0 20.7 21.2 21.6
23. The number of bed-sheets manufactured by a factory during five consecutive weeks
is given below.
Week First Second Third Fourth Fifth
No. of Bed Sheets 600 850 700 300 900
Draw the bar graph representing the above data
24. The number of students in 7 different classes is given below. Represent this data on
the bar graph.
Class VI VII VIII IX X XI XII
Number of 130 120 135 130 150 80 75
Students
25. The Production (in Tone) by Factory in Years is shown below Represent this data on
the scatter graph.
Year 2000 2005 2010 2015
No. of Bed Sheets 50 40 30 60
26. Consider the Following set of Data 34,18,100,27,54,52,93,59,61,87,68,85,78,82,9.
Create a box plot and add title as Horizontal Boxplot and y-axis title as “Value
Range”.
27. Give the following set of data
Weight measurement in 14 values of muffins (in grams)
[Link].[Link].[Link].79,80
a. Create a Simple Histogram for the above data.
b. Create a Horizontal histogram from the above sent of data.
c. Create a cumulative histogram for the above data.
28. Write the python code to create the following output using matplotlib.
29. Write the python code to create the following output using matplotlib.
30. Write the python code to create the following output using matplotlib.
31. Consider the FLIGHTS and FARES Table. Write the SQL
i) Display flight number & number of flights from Mumbai from the table flights.
ii) Arrange the contents of the table flights in the descending order of destination.
iii) Increase the tax by 2% for the flights starting from Delhi.
iv) Display the flight number and fare to be paid for the flights from Mumbai to Kochi using the tables,
Flights & Fares, where the fare to be paid =fare+fare*tax/100.
v) Display total no of source stations (eliminate duplicate) present in the table.
vi) Display the fare for the flight for MUMBAI to BANGLORE
vii) Display the records of source stations started with letter ‘B’.
viii) Display the flight no. for which fare to be paid is less than 3000.
ix) Display total no. of flights available for each Airlines x) Add a new column Dep_Time in the table
Flight.
x) Delete the record of flight no. IC301 from the table [Link]) increase the size of the column ‘source’
to 30 in the Table FLIGHT.
32. Consider the tables given below and answer the questions that follow:
Table: Department
Dept DName MinSal MaxSal HOD
10 Sales 25000 32000 1
20 Finance 30000 50000 5
30 Admin 25000 40000 7
Write SQL commands to:
Create Table
1. Create the table Employee.
2. Create the table Department.
Insert data in a table
3. Insert data in the table Employee
4. Insert data in the table Department.
Simple Select
5. Display the details of all the employees.
6. Display the Salary, Zone, and Grade of all the employees.
7. Display the records of all the employees along with their annual salaries. The Salary column of
the table contains monthly salaries of the employees.
8. Display the records of all the employees along with their annual salaries. The Salary column of
the table contains monthly salaries of the employees. The new column should be given the
name “Annual Salary”.
Conditional Select using Where Clause
9. Display the details of all the employees who are below 30 years of age.
10. Display the names of all the employees working in North zone.
11. Display the salaries of all the employees of department 10.
Using NULL
12. Display the details of all the employees whose Grade is NULL.
13. Display the details of all the employees whose Grade is not NULL.
Using DISTINCT Clause
14. Display the names of various zones from the table Employee. A zone name should appear only
once.
15. Display the various department numbers from the table Employee. A department number
should be displayed only once.
Using Logical Operators (NOT, AND, OR)
16. Display the details of all the employees of department 10 who are above 30 years of age.
17. Display the details of all the employees who are getting a salary of more than 35000 in the
department 30.
18. Display the names and salaries of all the employees who are not working in department 20.
19. Display the names and salaries of all the employees who are working neither in West zone nor
in Centre zone.
20. Display the names of all the employees who are working in department 20 or 30.
21. Display the details of all the employees whose salary is between 32000 and 38000.
22. Display the details of all the employees whose grade is between ‘A’ and ‘C’.
23. Display the details of all the employees aged above 30 in West zone.
Using IN Operator
24. Display the names of all the employees who are working in department 20 or 30. (Using IN
operator)
25. Display the names and salaries of all the employees who are working neither in West zone nor
in Centre zone. (Using IN operator)
Using BETWEEN Operator
26. Display the details of all the employees whose salary is between 32000 and 38000.
(Using BETWEEN operator)
27. Display the details of all the employees whose grade is between ‘A’ and ‘C’.
(Using BETWEEN operator)
Using LIKE Operator
28. Display the name, salary, and age of all the employees whose names start with ‘M’.
29. Display the name, salary, and age of all the employees whose names end with ‘a’.
30. Display the name, salary, and age of all the employees whose names contain ‘a’
31. Display the name, salary, and age of all the employees whose names do not contain ‘a’
32. Display the details of all the employees whose names contain ‘a’ as the second character.
Using Aggregate functions
33. Display the sum and average of the salaries of all the employees.
34. Display the highest and the lowest salaries being paid in department 10.
35. Display the number of employees working in department 10.
Using ORDER BY clause
36. Display the details of all the employees in the ascending order of their salaries.
37. Display the details of all the employees in the descending order of their names.
38. Display the details of all the employees in the ascending order of their grades and within
grades in the descending order of their salaries.
Using GROUP BY clause
39. Display the total number of employees in each department.
40. Display the highest salary, lowest salary, and average salary of each zone.
41. Display the average age of employees in each department only for those departments in
which average age is more than 30.
Using UPDATE, DELETE, ALTER TABLE
42. Put the grade B for all those whose grade is NULL.
43. Increase the salary of all the employees above 30 years of age by 10%.
44. Delete the records of all the employees whose grade is C and salary is below 30000.
45. Delete the records of all the employees of department 10 who are above 40 years of age.
46. Add another column HireDate of type Date in the Employee table.
JOIN of two tables
47. Display the details of all the employees who work in Sales department.
48. Display the Name and Department Name of all the employees.
49. Display the names of all the employees whose salary is out of the specified range for the
corresponding department.
50. Display the name of the department and the name of the corresponding HOD for all the
departments.
33. Design a Django Based Application to obtain a search criteria and fetches record
based on that from Books Table.
34. Design a Django based application that fetches all records from student table of
School database.
35. Design a Django based application that fetches all records of those employees who
are ‘Salesman
36. Design a Python application based on the menu to demonstrate dour major
connectivity to perform following operations in student table
a. Insert a new record into table student
b. Update the student record
c. Delete the record from student table
d. Display the records of student table
Date of Submission: 30/ November/2019 (Saturday)