Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

Sanskriti School, Pune

(Bhukum Campus)

Lab Report File

For
CBSE 2023-24 Examination
[Informatics Practices (065)]

SUBMITTED BY:
Arjun Ghadge

1
CERTIFICATE
This is to certify that Arjun Ghadge of class XII has successfully
completed his Lab Report in Informatics Practices (065) as prescribed
by CBSE in year 2023-24.

Name of the Student :

Class : XII

Roll No. :

Name of the School : SANSKRITI SCHOOL, PUNE

Subject Teacher : Ms. ANAGHA WARE

Principal : Ms. DAMINI JOSHI

External Examiner :

2
INDEX
Python Pandas
P. No. Content Page No.
1 Pandas series creation from dictionary and nd-array 6
2 Program to convert a Series to Python’s list 7
3 Program to compare the elements of 2 Pandas Series 8
4 Program to get the basic attributes of the Series 10
5 Program to perform Binary Operations on two Series 11
6 Program to sort the values of the Series 13
7 Program to display basic attributes like row labels, column 14
labels, data type and dimensions of each column in a data frame
8 Program to create a dataframe and find the name of items 15
having highest price.
9 Program to get the rows from a database having NaN values 16
10 Program to get rows from a database where height is between 17
5.0 and 5.5 units
11 Locate the 3 largest values in data frame 18
12 Program to filter the rows of data frame based on duplicate 19
rows
13 Replace all negative values of a data frame with 0 20
14 Sorting a dataframe on given column 21
15 Replace missing values of a dataframe by 999 22
16 Program for importing and exporting data between pandas and 23
csv files

Python Matplotlib
P. No. Content Page No.
1 Program to plot Student’s Performance Analysis, Bar Chart 25
and Horizontal Bar Chart
2 Program to plot Bar Chart creation for the average percentage 26
obtained by the students of class IX-A, IX-B, IX-C in English,
Hindi, Maths and saving result in pdf format

3 Program to plot Histogram for yearly production of wheat 27


(using pyplot’s hist() and pandas plot()
4 Program to plot a line chart : sin- cos wave 29
5 Program to plot line chart for x as integer values between 1 to 30
25 and for the equation y=x2 – 2x + 0.5

3
INDEX

MySQL Queries
P. No. Content Page No.
1 Create a student table with the student id, name and marks as 32
attributes where the student id is the primary key.
2 Insert the details of a new student in table student. 32
3 Delete the details of a student in the above table. 33
4 Use the select command to get the details of the students with 33
marks more than 80.
5 Find the minimum, maximum and average marks in each 34
subject from student table.
6 Find the sum and average of the marks in student marks table. 35
7 Find and display percentage of marks with 2 decimal point 35
values using round() function
8 Find the total number of customers from each country in the 36
table (customer ID, customer Name, country) using group by.
9 Write SQL query to display the (student ID, marks) from 37
Student table in the descending order of the marks.
10 To display today’s date, date and time, Day, Day name, Month, 37
month name and year using appropriate functions.
11 To display current time and hour, minutes and seconds 38
separately from current time.
12 Convert the given string in lower and uppercase letters. 38
13 To find length and position of ‘@’ character from email column 39
in table Guardian(Gno, Name, email, ContactNo)
14 To extract the domain name from the email. 40

4
PYTHON’S
PANDAS
(Series &DataFrame)
PROGRAMS

5
1. Pandas series creation from dictionary and nd-array:
Code:

OUTPUT:

6
2. Program to convert a Series to Python’s list:

OUTPUT:

7
3. Program to compare the elements of Pandas Series:

OUTPUT:

8
9
4.Program to get the basic attributes of the Series:

OUTPUT:

10
5.Program to perform Binary Operations on two Series:

OUTPUT:

11
12
6.Program to sort values in a Series:

OUTPUT:

13
7.Program to display basic attributes of a dataframe:

14
OUTPUT:

8.Program to create a dataframe and find the name of items having


highest price:

15
OUTPUT:

9.Program to get rows of a dataframe having NaN values:

OUTPUT:

16
10.Program to get the rows from dataframe where height is between
5.0 and 5.5 units:

OUTPUT:

17
11.Locate the 3 largest values in a data frame:

18
OUTPUT:

19
12. Program to filter the rows of dataframe based on duplicate
rows:

OUTPUT:

20
13. Replace all negative values of a data frame with 0:

OUTPUT:

21
14. Program to sort the dataframe in ascending and descending
order:

OUTPUT:

22
15. Program to replace missing values of a dataframe by 999:

OUTPUT:

23
16. Program for importing and exporting data between pandas and
csv files:

OUTPUT:
Data imported from .csv file:

Data exported to .csv file:

24
PYTHON’S
MATPLOTLIB
(PyPlot)
PROGRAMS

25
1. Program to plot Student’s performance Analysis, Bar Chart and
Horizontal Bar Chart:

26
OUTPUT:

27
2. Program to plot Bar Chart creation for the average percentage
obtained by the students of class IX-A,IX-B,IX-C in
English,Hindi,Maths and saving result in pdf format:

28
OUTPUT:

29
3. Program to plot Histogram for Yearly Production of wheat
using pyplot’s hist() ans Pandas plot():

OUTPUT:

30
31
4. Program to plot a line chart: sin-cos wave:

OUTPUT:

32
5. Program to plot a line chart for x as integer values between 1 to
25 and for the equation y=x2-2x+0.5:

OUTPUT:

33
MySQL
QUERIES

34
1. Create a student table with the student id, name and marks as attributes
where the student id is the primary key.
Ans–
Query :

2.WriteSQL query to insert and retrieve data from STUDENT


Table.
Ans –
Query:

Query :

35
Output :

3. Delete the details of a student named ‘Anita’ in the above table.


Ans –
Query:

Output:

36
4. Use the select command to get the details of the students with marks
more than 80 in maths.
Ans –
Query:

Output:

5. Find the minimum and maximum and average marks in each subject
from Student table.
Ans –
Query for minimum marks in each subject:

Output:

37
Query for maximum marks in each subject:

Output:

Query for average marks in each subject:

Output:

38
6. Write SQL query to retrieve the records from student table
based on some condition.

7. Write SQL query to create and view the description of a table


that has a foreign key:

39
8. Write SQL query to insert and retrieve the records from table
having foreign key constraint.

40
9. Find the total and average marks scored by each student.
Query:

OUTPUT:

10. Find and display student details with percentage of marks


with 2 decimal point values using round() function:

OUTPUT:

41
11. Find the total number of customers from each country in the
table (Customer ID, Customer Name,Country) using GROUP
BY:

Query to display number of customers from each country:

OUTPUT:

42
12. Write SQL Query to display the(Roll No,Marks) from
student table in the descending order of the marks:

OUTPUT:

13. To display today’s date, date and time, Day, Day Name,
Month, Month Name and year using appropriate functions:

OUTPUT:

43
14. To display current time and hour, minutes and seconds
separately from current time.

OUTPUT:

15. Convert the name of all customers in upper case and name
of countries in lower case from table customer:

OUTPUT:

44
16. To create a table guardian (GNo, Name, Email, ContactNo)
to find length and position of’@’ character from email column:
Query to create table Guardian and insert records into it:

Query to find length and position of @ character from email


column:

OUTPUT:

45
17. To extract the domain name from column email.

OUTPUT:

46

You might also like