Practical File IP Class 12 2024 25 Sharing
Practical File IP Class 12 2024 25 Sharing
UR M
O
E
Y
SCHOOL LOGO
AISSCE 2024-25
PRACTICAL FILE
ON
INFORMATICS PRACTICES
SEBJECT CODE- 065
I <Your Name>, bearing roll no <your rno>, a student of Class XII, <Your School Name>
hereby declare that I own the full responsibility for the information, results etc. provided in
this Practical File. It has been created successfully by using the Database Tool MySQL and
SQL commands at <Your School name> in complete fulfillment of practical (curriculum of
Central Board of Secondary Education CBSE of Informatics Practices(065) conducted by
CBSE, New Delhi for the academic session 2024-25.
<Your Name>
Roll No: <Your Rno>
Class 12
<Your School Name>
2
ACKNOWLEDGEMENT
I take this opportunity to express my deep sense of gratitude to all those who have
been instrumental in preparation of this project.
I am also sincerely grateful to <Your Teacher Name> PGT (CS), <Your School Name>
for his encouragement and valuable guidance during the entire period of work.
I would also thank all of my parents and friends for their whole hearted support and
encouragement without with this project would not have been successful.
I could not forget Internet, Textbooks which provided me with sufficient matter for
reference.
3
Practicals
Data Handling
https://imojo.in/N8IEdw
4
PRATICAL 1
Problem statement: 1. Create a Series object using the python sequence with 5 elements:
Solution:
Source Code:
import pandas as pd
L = [12,23,34,45,56]
S= pd.Series(S)
print(S)
Screenshot:
Output
5
PRATICAL 2
Problem statement: 1. Create a Series object ‘vowel’ to store all vowels individually. Its
index should be 1,2,3,4 & 5.:
Solution:
Source Code:
import pandas as pd
vowels = pd.Series(['a','e','i','o','u'], index = [1,2,3,4,5])
print(vowels)
Screenshot:
Output
6
PRATICAL 3
Problem statement: No of students in class 11 and class 12 in three streams (science,
commerce and humanities) are stored in 2 series object class 11 and class 12. write code to
find total no of students in class 11 & class 12 stream wise:
Solution:
Source Code:
import pandas as pd
D1= {'Science':32,'Commerce':36,'Humanities':20}
D2= {'Science':28,'Commerce':34,'Humanities':22}
Class11 = pd.Series(D1)
Class12 = pd.Series(D2)
print(Class11)
print(Class12)
print('Total Students')
print(Class11 + Class12)
Screenshot:
techtipnow.i
n
Output
7
PRACTICAL FILE (40 Practicals)
Download Complete Practical @119rs and you will get:
https://imojo.in/N8IEdw
Source Code:
import pandas as pd
population = pd.Series([400000, 25400, 301100, 100500,505000],
['Mumbai','Kolkata','Delhi','Chennai','Bangluru'])
print(population)
print('Poplulation more than 300000')
print(population[population>300000])
Screenshot:
Output
9
PRATICAL 5
Problem statement: Create a series ‘temp’ that stores temperature of seven days in it. Its
index should be ‘Sunday’, ‘Monday’ ….
Write script to
1. Display temp of first 3 days.
2. Display temp of last 3 days.
3. Display all temp in reverse order like Saturday, Friday,….
4. Display temp from Tuesday to Friday.
5. Display square of all temperature.:
Solution:
Source Code:
import pandas as pd
temp = pd.Series([45,42,40,46,39,38,40],
['Sunday','Monday','Tuesday','wednesday','Thursday','Friday','Saturday']
)
print(temp)
print("Temp of first three days\n",temp.head(3))
print("Temp of last three days\n",temp.tail(3))
print("Temp in reverse order\n", temp[::-1])
print("Temp from Tuesday to Friday\n",temp['Tuesday':'Friday'])
print("Square of all Temprature\n",temp*temp)
Screenshot:
10
Output
https://imojo.in/N8IEdw
11
PRATICAL 6
Problem statement: Create a Series object ‘employee’ that stores salary of 7 employees.
Write script to print
1. Total no of elements
2. Series is empty or not
3. Series consist NaN value or not
4. Count Non-NA elements
5. Axis labels:
Solution:
Source Code:
import pandas as pd
D =
{'ram':34000,'hari':42000,'suman':30000,'chandan':45000,'raghu':23000}
employee = pd.Series(D)
print(employee)
print("Total no of Employees",employee.size)
if employee.empty:
print("Series is empty")
else:
print("Series is not empty")
if employee.hasnans:
print("Series contains NaN elements")
else:
print("Series does not contains NaN elements")
print("Total no of Non NA elements ",employee.count())
print("Axis labels\n", employee.axes)
Screenshot:
www.techtipnow.in
12
Output
13
PRATICAL 7
Problem statement: Consider two series object staff and salaries that stores the number of
people in various office branches and salaries distributed in these branches respectively.
Write a program to create another Series object that stores average salary per branch and
then create a dataframe object from these Series object.
After creating dataframe rename all row labels with Branch name.
Solution:
Source Code:
import pandas as pd
staff = pd.Series([20,24,30,18])
salary = pd.Series([240000,336000,450000,270000])
avg = salary/staff
org = {'Employees':staff,'Amount':salary,'Average':avg}
df = pd.DataFrame(org)
print("Without Row Label")
print(df)
df.index = ['sale','store','marketing','maintenence']
print("With Row Label")
print(df)
Screenshot:
14
Output
https://imojo.in/N8IEdw
15
PRATICAL 8
Problem statement: Create the following dataframe ‘sales’ containing year wise sales figure
for five sales persons in INR. Use the year as column labels, and sales person names as row
labels.
2014 2015 2016 2017
Madhu 1000 2000 2400 2800
Kusum 1500 1800 5000 6000
Kinshuk 2000 2200 7000 7000
Ankit 3000 3000 1000 8000
Shruti 4000 4500 1250 9000
Source Code:
import pandas as pd
D = {2014:[1000,1500,2000,3000,4000],2015:[2000,1800,2200,3000,4500],
2016:[2400,5000,7000,1000,1250],2017:[2800,6000,7000,8000,9000]}
sale = pd.DataFrame(D,['Madhu','Kusum','Kinshuk','Ankit','Shruti'])
print("----DataFrame----")
print(sale)
print("----Row Labels----")
print(sale.index)
print("----Column Labels----")
print(sale.columns)
print("----Bottom two Rows----")
print(sale.tail(2))
print("----Top two Rows----")
print(sale.head(2))
16
Screenshot:
Output
17
PRATICAL 9
Problem statement: Create a dataframe ‘sales2’ using dictionary as given below and write a
program to append ‘sales2’ to the dataframe ‘sales’ created in previous practical 14.
2018
Madhu 1600
Kusum 1100
Kinshuk 5000
Ankit 3400
Shruti 9000
Solution:
Source Code:
import pandas as pd
D = {2014:[1000,1500,2000,3000,4000],2015:[2000,1800,2200,3000,4500],
2016:[2400,5000,7000,1000,1250],2017:[2800,6000,7000,8000,9000]}
sale = pd.DataFrame(D,['Madhu','Kusum','Kinshuk','Ankit','Shruti'])
print("----DataFrame----")
print(sale)
sale2 =
pd.DataFrame({2018:[1600,1100,5000,5400,9000]},['Madhu','Kusum','Kinshuk
','Ankit','Shruti'])
print(sale2)
sale = sale.join(sale2)
print(sale)
Screenshot:
www.techtipnow.in
18
Output
19
PRATICAL 10
Problem statement: Create a dataframe ‘cloth’ as given below and write program to do
followings:
• Change the name of ‘Trouser’ to ‘pant’ and Jeans to ‘Denim’
• Increase price of all cloth by 10%
• Rename all the indexes to [C001, C002, C003, C004, C005]
• Delete the data of C3 (C003) from the ‘cloth’
• Delete size from ‘cloth’
CName Size Price
C1 Jeans L 1200
C2 Jeans XL 1350
C3 Shirt XL 900
C4 Trouser L 1000
C5 T-Shirt XL 600
Solution (Code):
www.techtipnow.in
20
Output
21
Practicals
Matplotlib
• बिना Watermark के प्रैक्टिकल
फाइल डाउनलोड करे
• प्रैक्टिकल फाइल में अपना नाम,
स्कूल और िीचर का नाम अपने
अनुसार चेंज करें
• इसमें आपको पूरे 40 प्रैक्टिकल
ममलेंगे सभी topics के
• Rs. 119 में आप इसे purchase कर
सकते है , purchase मलिंक नीचे है
https://imojo.in/N8IEdw
22
PRATICAL 11
Problem statement: Collect and store total medals won by 10 countries in Olympic games
and represent it in form of bar chart with title to compare an analyze data.
Solution:
Source Code:
import matplotlib.pyplot as plt
medals = [213,224,300,59,100,140,256,98,60,24]
country = ['Ger','Itly','USA','Jamca','Japan',
'India','China','Aus','Arg','Ethopia']
plt.bar(country, medals)
plt.title('Olympics Medal Tally')
plt.show()
Screenshot:
Output
23
PRATICAL 12
Problem statement: Techtipnow Automobiles is authorized dealer of different Bikes
companies. They record the entire sale of bikes month wise as give below:
Jan Feb Mar Apr May Jun
Honda 23 45 109 87 95 100
Suzuki 45 57 75 60 50 30
Tvs 97 80 84 68 80 108
To get proper analysis of sale performance create multiple line chart on a common plot
where all bike sale data are plotted.
Display appropriate x and y axis labels, legend and chart title.
Solution:
Source Code:
import matplotlib.pyplot as plt
month = ['jan','feb','mar','apr','may', 'jun']
honda = [23,45,109,87,95,100]
suzuki = [45,57,75,60,50,30]
tvs = [97,80,84,68,80,108]
plt.plot(month,honda, label = 'honda')
plt.plot(month,suzuki, label = 'suzuki')
plt.plot(month,tvs, label = 'tvs')
plt.title('Techtipnow Automobiles Sale Analysis')
plt.xlabel('Month')
plt.ylabel('No of Bikes')
plt.legend(loc = 'lower center')
plt.show()
24
PRACTICAL FILE (40 Practicals)
Download Complete Practical @119rs and you will get:
https://imojo.in/N8IEdw
Output
www.techtipnow.in
26
PRATICAL 13
Problem statement: The following seat bookings are the daily records of a month
December from PVR cinemas:
124,124,135,156,128,189,200,150,158, 150,200,124,143,142,130,130, 170,
189,200,130, 142,167,180,143,143, 135,156,150,200,189,189,142
Construct a histogram from above data with 10 bin..
Solution:
Source Code:
import pandas as pd
import matplotlib.pyplot as plt
L = [124,124,135,156,128,189,200,150,158,
150,200,124,143,142,130,130, 170,
189,200,130, 142,167,180,143,143,
135,156,150,200,189,189,142]
plt.hist(L)
plt.title("Booking Records @ PVR")
plt.show()
Screenshot:
27
Output
28
MySQL
Practicals
• बिना Watermark के प्रैक्टिकल
फाइल डाउनलोड करे
• प्रैक्टिकल फाइल में अपना नाम,
स्कूल और िीचर का नाम अपने
अनुसार चेंज करें
• इसमें आपको पूरे 40 प्रैक्टिकल
ममलेंगे सभी topics के
• Rs. 119 में आप इसे purchase कर
सकते है , purchase मलिंक नीचे है
https://imojo.in/N8IEdw
29
PRATICAL 14
Problem statement: Create a student table with the student id, name, and marks as
attributes where the student id is the primary key.
Solution:
Source Code:
create table student
( -> studid int primary key,
-> name varchar(30),
-> marks int
-> );
Screenshot:
30
PRATICAL 15
Problem statement: In the table ‘student’ created in practical 26, insert the details of new
students.
Solution:
Source Code:
insert into student values(1, 'sanjay', 67);
mysql> insert into student values(2, 'surendra', 88);
mysql> insert into student values(3, 'Jamil', 74);
mysql> insert into student values(4, 'Rahul', 92);
mysql> insert into student values(5, 'Prakash', 78);
Screenshot:
31
PRATICAL 16
Problem statement: Write SQL command to get the details of the students with marks
more than 80.
Solution:
Source Code:
select * from student where marks >=80;
Screenshot:
32
PRATICAL 17
Problem statement: Write SQL command to Find the min, max, sum, and average of the
marks in a student marks table..
Solution:
Source Code:
select min(marks) as Min_marks, max(marks) as Max_Marks, sum(marks) as
Total_Marks, avg(marks) as Average_Marks from student;
Screenshot:
33
PRATICAL 18
Problem statement: Find the total number of customers from each country in the table
(customer ID, customer Name, country) using group by.
Solution:
Source Code:
select country, count(cname) as 'Total_Customers' from customer
group by country;
Screenshot:
https://imojo.in/N8IEdw
34
PRATICAL 19
Problem statement: for the given table ‘Hospital’ write SQL command to display name all
patient admitted in month of May.
PID PNAME ADMITDATE DEPT FEES
AP/PT/001 Rahil Khan 21/04/2019 ENT 250
AP/PT/002 Jitendal Pal 12/05/2019 Cardio 400
AP/PT/003 Suman Lakra 19/05/2019 Cardio 400
AP/PT/004 Chandumal Jain 24/06/2019 Neuro 600
.
Solution:
Source Code:
select * from hospital where monthname(admitdate) = 'May';
Screenshot:
www.techtipnow.in
35
PRATICAL 20
Problem statement: for the given table ‘Hospital’ write SQL command to Display patient
name in upper case with year of admission.
PID PNAME ADMITDATE DEPT FEES
AP/PT/001 Rahil Khan 21/04/2019 ENT 250
AP/PT/002 Jitendal Pal 12/05/2019 Cardio 400
AP/PT/003 Suman Lakra 19/05/2019 Cardio 400
AP/PT/004 Chandumal Jain 24/06/2019 Neuro 600
.
Solution:
Source Code:
Select UPPER(pname) as ‘patient name’, YEAR(admitdate) as ‘admit year’
From hospital;
Screenshot:
36
PRATICAL 21
Problem statement: For given string “techtipnow computer education”, Write SQL
command to display the position of “education”.
.
Solution:
Source Code:
Select INSTR(“techtipnow computer education”, “education”);
Screenshot:
https://imojo.in/N8IEdw
37
PRACTICAL FILE (40 Practicals)
Download Complete Practical @119rs and you will get:
https://imojo.in/N8IEdw
39