0% found this document useful (0 votes)
5 views

Raj Verma Practical File

This practical file for MySQL and Pandas is prepared for the AISSCE 2024-25 examination by Raj Verma under the guidance of Mrs. Sudha Shrivastava. It includes a comprehensive index of topics covering Numpy arrays, DataFrames, data visualization techniques, and SQL queries for various tables. The document outlines specific tasks and programming exercises related to data manipulation and analysis using Python and SQL.

Uploaded by

lakshyakumar7076
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Raj Verma Practical File

This practical file for MySQL and Pandas is prepared for the AISSCE 2024-25 examination by Raj Verma under the guidance of Mrs. Sudha Shrivastava. It includes a comprehensive index of topics covering Numpy arrays, DataFrames, data visualization techniques, and SQL queries for various tables. The document outlines specific tasks and programming exercises related to data manipulation and analysis using Python and SQL.

Uploaded by

lakshyakumar7076
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

RASHTRA SHAKTI VIDYALAYA SR. SEC.

UTTAM NAGAR, NEW DELHI-110059

PRACTICAL FILE

ON

MySQL and Pandas

FOR

AISSCE 2024-25 EXAMINATION

As a part of the Informatics Practices (065)

SUBMITTED BY:

NAME : RAJ VERMA

BOARD ROLL NO: __________________

UNDER THE GUIDANCE OF:

Mrs. SUDHA SHRIVASTAVA


INDEX
Table of Contents
Sr Table of Contents
Teacher
No.
Sign

Numpy Array
Creating numpy array with different methods
1.

Numpy array and its attributes

Create series vowels with index [a ,e ,i , o, u]


2. and value = 0 and perform different operations
on it.
Create series Eng Alph having 26 elements
3. with alphabet as value.
and perform different operations on it
4. Create series Monthsdays from numpy array
having number of days of the 12 months of the
year label should be the month number from 1
to 12 and perform different operations on it

5. Creating series with S1 and S2


DATA FRAME
6. Creating DataFrame with different methods.

7. Write a program to consider the dataframe and display


a menu to show the following information regarding
the dataframe. Transpose, Column names, Indexes,
datatypes of individual columns, size and shape of the
dataframe. Your program must keep on displaying as
per the menu till the user’s choice.

8. Write a menu based program to perform the following


operations on columns of the above defined dataframe
based on user specified inputs:
a) Insert a new column at the end
b) Insert a new column at a specified position
c) Delete a column permanently
d) Delete a column temporarily
e) Display the DataFrame

9. Considering the given dataframe write code to insert


more records as per choice of the user.

10. Consider a csv file named ‘student’ and write a menu


driven program to create dataframe from given csv and
perform various functions:

head()
tail()

Also draw a line chart ,bar chart of the given data.


11.
Visualization of Data
(a) Draw Point Chart

(b) Draw Line chart

(c) Draw two Line Chart

(d) Draw Line Chart

(e) Draw Bar Chart

(f) Draw Bar Graph

(g) Draw Horizontal Bar Chart

(H) Draw Multiple bar Chart

(i) Draw Bar Chart Using Data Frame

(c) Draw Histogram Bar Chart

12.
MY SQL
(a) Create Table Charity and perform various
queries.

(b) Create Table Teacher and perform various


queries.

(c) Create Table Marks and perform various


queries.

(d) Create Table Salesman and perform various


queries.
(e) Create Table Product and Client and perform
various queries.

(f) Consider table Store and Item and answer the


queries.
NUMPY ARRAY
Creating numpy array with different methods

# array() function

# arange() function
Q Create a Series with index a,e,I,o,u, and value=0

OUTPUT:

Q- Set all the values to 10 and display the vowels

Q- Divide all the values of vowels by 2 and display the Series


Q-Create another Series vowels1 having 5 elements with index labels ‘a’,’e’,’I’,’o’,’u’
having values [2,5,6,3,8]

Q-Add vowels and vowels1 and assign the result to vowels3

Q-Subtract,Multiply,Divide,vowels by vowels1
Q-Change the labels of vowels to ['A','E','I','O','U']
1. EngAlph having 26 elements with alphabet as values
Q-Display the alphabet ‘c’ to ‘p’

Q-Display the first 10 values of EngAlph


Q-Display the last 10 values of EngAlph

Q-Find the Dimensions, Size, and Values of Series


# Dimensions:

#Size:

#Values:
Q-Rename the Series as Alphabets
Q Create following Series:
a. MonthDays from numpy array having numbers of days of the 12months of the
year, labels should be the month number from 1to12

Q-Display the name of month from 3to7 from Series

Q- Display the Series in reverse order


Q Consider a given Series, Series1:
200 700
201 700
202 700
203 700
204 700
Write a program in python Pandas to create the Series and Display it.

Q Consider the following Series object:


IP 95
PHYSICS 89
CHEMISTRY 92
MATH 95

A)Write the python syntax which will display only IP.


B) write Python syntax to increase marks of all subjects by 10.

Q Given are two Series S1 and S2:

a) Display first two indices of multiplied by 100 of series S1

b) Display Cartesian product of series S1 and S2.


c) Display series S2 in reverse order having elemnts multiplied by 10.

Q. Consider the following series S1:

a) Write a Python code to add 1 to all the elements.

b) Write a command to replace all NaN with 0.


DATAFRAME
Different methods to create dataframe
Ques WAC to create empty dataframe.

Ques WAC to create the dataframe from the given data from different
methods..
Creating dataframe with list of lists
Creating dataframe with list of dictionary.

Creating dataframe with list of series.

Creating dataframe with dictionary of lists.


Ques WAC to display the ename from the employee.

Ques WAC to display the ename and salary from the employee
Ques WAC to display the record of 2nd index from the employee

Ques WAC to display the record from 2nd to 4th index from the employee.
Ques.. Write a program to consider the dataframe and display a menu to show
the following information regarding the dataframe. Transpose, Column names,
Indexes, datatypes of individual columns, size and shape of the dataframe. Your
program must keep on displaying as per the menu till the user’s choice.
Ques. Write a menu based program to perform the following operations on
columns of the above defined dataframe based on user specified inputs:
1. Insert a new column at the end
2. Insert a new column at a specified position
3. Delete a column permanently
4. Delete a column temporarily
5. Display the DataFrame
Ques. Considering the given dataframe write code to insert more records as per
choice of the user.
Ques. Consider a csv file named ‘student’ and write a menu driven programto
create dataframe from given csv and perform various functions:
head()
tail()
Also draw a line chart ,bar chart of the given data.
DATA
VISULISATION
Draw point chart
Draw line chart
Draw two Line chart
Draw line chart
Draw a bar chart
Draw bar chart or bar graph
Draw Horizontal bar chart
Draw Multiple bar chart
Draw Bar chart using data frame
Draw a Histogram bar chart
Sql
Q Create table charity.

Table:
1.Display all first name in Lower case.

2.Display all the lastname of people of Mumbai city in upper


case.

3. Display person id along with the first 3 characters of


his/her name.
4. employees.Display Firstname concatenated with last name
for all

5. Display length of address along with person id.

6. Display last 2 characters of city and person id.


7. Display Lastname, Firstname of people who have ‘at’ in the
second or third position in their last name.

8. Display the position of ‘a’ in the Last name in every row.

9. Display Lastname and First name of people who have ‘a’ as


the last character in their first name.
10. Display Person id, Lastname and Contribution rounded off
to the zero decimal places.

Q11 Display person id,Lastname and contribution with


decimal of all person.
Q2 Create table Teacher.

1.Add column address.


2. Add column fathername in the table Teacher.

3. Delete the column Fname.

4. Increase the size of column address by 50.

5. Change the datatype of column salary as float.

6. Change the column ‘name’ as ‘tname’.


7. Add primary key on the column id.

8. Add column named loc varchar (30).

9. Modify the size of column loc as 20.

10. Delete the primary key of the table.

11. Change the column name loc as location.


12. Update category of disha sehgal as tgt.

13. Increase the salary of female teachers by 10%.

14. Increase salary male teachers by 1500.

15. Display id, name and salary of all the teachers


16. Display teacher name, department and hire date.

17. Display name, gender and salary of all the teachers.

18. Display the details of female teachers.

19. Display teacher name, salary, category of math teacher.


20. Display details of TGT teachers.

21. WAC to delete record where id is 2.

22. WAC to display teacher name, department and salary


whose name ends with ‘a’.
23. WAC to display the details of teacher name, category,
gender and department whose department starts with ‘a’.

24. WAC to display name, department of female teachers in


descending order.

25. WAC to display tname, id ,hiredt and salary of male


teachers in ascending order of their salary.

26. Display details of teachers having salary between 25000


to 30000
27. WAC to delete table records without actually deleting the
table.

28. WAC to delete the table.

2. Create table marks.

(A) WAC to select distinct marks

(B) WAC to count all the data from the table


(C) WAC to count all the roll numbers from the table

(D) WAC to count all the marks from the table

(E) WAC to count distinct marks from the table

(F) WAC to display the increase in marks by 5


(G) WAC to display column name marks as marks obtained

(H) WAC to display details of students whose marks are not


mentioned

(I) WAC to display details of students whose marks are


mentioned

(J) WAC to substitute the null values with 0


Q. Table ‘salesman’

1. Display salesman name and bonus after rounding off to 0


decimal places

2. Display the position of occurrence of string ‘ta’


3. Display 4 characters from salesman name starting from
2nd position

4. Display the month name for date of joining of salesman

5. Display the name of weekday for the date of joining of


salesman
6. Display all the salesman name whose bonus is null in
uppercase

Q Table ‘product’ and ‘client’

1. Display details of those clients whose city is Delhi


2. Display product name, price, and corresponding client
name whose price is greater than 40

3. Display client name, city, product name, price and pid in the
ascending order of their price

4. WAQ to increase the price of facewash by rupees 10

Give o/p:
1. select manufacturer,max(price),min(price),count(*) from
product group by manufacturer;
2. select cname,manufacturer from product,client where
client.pid=product.pid;

3. select pname, cname,price from product,client where


product.pid=client.pid and city=’delhi’;

4. select distinct city from client;

Q. Table ‘store’ and ‘item’


1. Display iname and price in descending order of their price

2. Display sno, sname, iname, price whose store is located in


CP

3. Display min price and max price for each iname from the
table item whose min price should be greater than 300
4. Display iname, average price, sum of price, and their
respective sname of item which ends with ‘d’ whose sum of
the price should be greater than 800

5. Write O/P
A. select distinct iname from item where price>5000;

B. select area,count(*) from store groupby area;

C. select count(distinct area) from store;

D. select iname, price*0.05 as discount from item where


sno=’s02’ or sno=’s03’;

You might also like