INFORMATICS
PRACTICES
PRACTICAL
FILE
NAME:- MEHUL SEHRAWAT
CLASS:- 12 D
ROLL NO:-
MOUNT CARMEL SCHOOL
Name:- Mehul Sehrawat
Class:- 12 D
Admission No:-
Subject:- Information
Practices (065)
School:- Mount Carmel
School Dwarka, New
Delhi, 110075
INDEX
1. Certificate
2. Acknowledgement
3. Series
4. DataFrames
5. Matplotlib
Line Chart
Bar Chart
Histogram
6. MySQL
CERTIFICATE
This is to certify that Mehul Sehrawat
student of class XII-D has completed
this IP practical file successfully
under the guidance of Ms. Puja
Gupta, during the academic year
2024-2025 in partial fulfillment of the
informatics practices practical
examination conducted by CBSE.
TEACHER’S SIGNATURE
ACKNOWLEDGEMENT
I would like to express my sincerest
gratitude to my Informatics
Practices teacher, Mrs.Puja Gupta,
for her vital support, guidance and
encouragement that has enabled
me to complete this practical File. I
would also like to thank our
respected Principal, Dr.Rajeev Tyagi
and our respected Vice Principal
Academics,
Mrs.Anjali Washington for providing
me with this opportunity of choosing
Informatics Practices under my will
and interest.
PANDAS SERIES
CODE 1
OUTPUT
CODE 2
OUTPUT
CODE 3
OUTPUT
CODE 4
OUTPUT
CODE 5
OUTPUT
DATAFRAMES
CODE 1
OUTPUT
CODE 2
OUTPUT
CODE 3
OUTPUT
CODE 4
OUTPUT
CODE 5
OUTPUT
CODE 6
OUTPUT
CODE 7
OUTPUT
CODE 8
OUTPUT
CODE 9
OUTPUT
CODE 10
OUTPUT
MATPLOTLIB
CODE 1
OUTPUT
CODE 2
OUTPUT
CODE 3
OUTPUT
CODE 4
OUTPUT
BAR GRAPH
CODE 1
OUTPUT
CODE 2
OUTPUT
CODE 3
OUTPUT
HISTOGRAM
CODE 1
OUTPUT
CODE 2
OUTPUT
CODE 3
OUTPUT
MYSQL
DATABASE 1
(a) Write a Query to Create a new database in the name of
"EMPS".
CREATE DATABASE EMPS;
(b) Write a Query to Open the database EMPS.
USE EMPS;
(c) Write a Query to create the above table called: Info
CREATE TABLE INFO (EmpID int primary key, Name varchar(15), Gender
varchar(3),Age int,Dept varchar(15),DOJ date, Salary int, City
varchar(10));
(d) Write a Query to list all the existing database names
SHOW DATABASES;
(e) Write a Query to List all the tables that exists in the current
database.
Show Tables;
(f) Write a Query to insert all the rows of above table into Info
table.;
INSERT INTO INFO VALUES (1,'Praveen','M', 25,'Sales','1989-06-08',
'20000','Chennai');
INSERT INTO INFO VALUES(2,'Arun','M',29,'Marketing','1989-09-26',
22000,'Chennai');
INSERT INTO INFO VALUES(3,'Usha','F',27,'Finance','1994-08-09',
25000,'Bangalore');
INSERT INTO INFO VALUES(4,'Bala','M',31,'Sales','1990-03-23',
27000,NULL);
INSERT INTO INFO VALUES(5,'Rani','F',28,'Marketing','1990-04-23',
27000,'Mumbai');
INSERT INTO INFO VALUES (6,'Nisha','F', 26, NULL,'1991-02-24',
18000,'Bangalore');
INSERT INTO INFO VALUES (7,'Manoj','M', 32,'Finance','1982-05-06',
30000,'Goa');
(g) Write a Query to display all the details of the Employees from
the above table
'INFO'. SELECT * FROM INFO;
DATABASE 2
(a) Write a Query to Display Employees’ name and City from the
above table.
SELECT NAME, CITY FROM INFO;
(b) Write a Query to Display all details of Employees who are
living in Chennai.
SELECT * FROM INFO WHERE CITY='CHENNAI';
(c) Write a Query to get the name and salary of the employee
whose salary is above 15000 and gender is not male.
SELECT NAME,SALARY FROM INFO WHERE SALARY >15000 AND
GENDER<>'M';
(d) Write a query to update increase 10% Salary of an employee
whose City is 'CHENNAI' and Gender is 'MALE'.
UPDATE INFO SET SALARY=SALARY+ (SALARY*0.10) WHERE
CITY='CHENNAI' AND GENDER='MALE';
(e) Write a Query to delete the details of Employee Id 6.
DELETE FROM INFO WHERE EMPID=6;LE';
DATABASE 3
(a) Write a Query to Display square of age that got admission in
the month of August.
SELECT POWER(AGE,2) FROM STU WHERE DOA LIKE '%-08-%';
(b) Write a Query to display Remainder of column Percentage
divide by 3.
SELECT MOD(MARKS,3) FROM STU;
(c) Write a Query to display Student names and their Percentage
in round figure.
SELECT NAME, ROUND(PERCENTAGE,0) FROM STU;
(d) Display Name, Percentage and round up the remainder marks
up to 2 decimal places.
SELECT NAME, ROUND(MOD(PERCENTAGE,3),2) FROM STU;
DATABASE 4
(a) Write a Query to display student name and month of date of
admission of all students.
SELECT NAME, MONTH(DOA) FROM STU;
Output:
(b) Write a Query to display Student name and day name of the
students’ DOA of the table
STU. SELECT NAME, DAYNAME(DOA) FROM STU;
(c) Write a query to display the joining year of IP students.
SELECT YEAR(DOA) FROM STU WHERE DEPT='IP'
(d) Write a Query to Display the month for the date_of_birth of all
students.
SELECT NAME, MONTHNAME(DOA)FROM STU;
DATABASE 5
(a) Write a Query to display Department name in lower case
letters.
SELECT LCASE(DEPT) FROM STU;
(b) Write a Query to display department name and its respective
number of characters in Dept column.
SELECT DEPT,LENGTH(DEPT) FROM STU;
(c) Write a Query to display first 2 characters of the column Name.
SELECT LEFT(NAME,2) FROM STU;
(d) Write a Query to display first 2 characters of the column Name.
SELECT RIGHT(NAME,2) FROM STU;
DATABASE6
To write Queries for the following questions based on the given
tables – “STU” and “CUSTOMER” :
Create table stu(SNo varchar(3), Sname varchar(10), Gender char(1),
Age int(2));
Create table customer (PNo varchar(3), Pname varchar(10), Gender
char(1), Dept varchar(10));
Insert into stu values("s1","Ankit", "M",16), ("s2", "Priya", "F",17), ("s3",
"Rahul", "M", 15);
Insert into customer values("p1", "Anil", "M", "Sales"), ("p2", "Vivek",
"M", "Marketing"), ("p3", "Arun", "M", "Finance");
To Join:-
SELECT * from stu,customer where stu.gender=customer.gender;
THANK
YOU