PRACTICAL LIST CLASS-XII (INFO. PRACTICALS - fINAL PDF
PRACTICAL LIST CLASS-XII (INFO. PRACTICALS - fINAL PDF
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, np.NaN, 5.9, np.NaN],
'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, np.nan, 5.9, np.nan],
'age': [11, 23, 22, 33, 22]
19. Consider the following DataFrame
23. The number of bed-sheets manufactured by a factory during five consecutive weeks
is given below.
24. The number of students in 7 different classes is given below. Represent this data on
the bar graph.
25. The Production (in Tone) by Factory in Years is shown below Represent this data on
the scatter graph.
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 FARE.xii) 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
Create Table
Simple Select
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”.
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.
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.
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.
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)
26. Display the details of all the employees whose salary is between 32000 and 38000.
27. Display the details of all the employees whose grade is between ‘A’ and ‘C’.
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.
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.
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.
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.
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.
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