12th IP Project
12th IP Project
3. 15 SQL Queries
PROGRAMS USING PANDAS
Practical 1:Create a Series object using the python sequence with 5 elements:
Solution:
Output:
Practical 2: Create a Series object ‘vowel’ to store all vowels individually.Its index should
be 1,2,3,4 & 5:
Solution:
Output:
Practical 3: Create a Series object using ndarray that has 5 elements in the range 50
and 100:
Solution:
Output:
Practical 4: Create a Series object using Dictionary to that stores that no of students in each
section of class 12th of your school:
Solution:
Output:
Practical 5: Total no of students to be admitted is 350 in yojana School every year.Write
code to create a Series object ‘School’ that stores these total no of students for the year
2015 to2022:
Solution:
Output:
Practical 6:Create a Series object ‘item’ that stores rate of each product as given below:
Soap 54
Salt 20
Sugar 39
Write code to modify rate of soap to 44 and sugar to 42. print the changed rate.
Solution:
Output:
Practical 7: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:
Output:
Practical 8:Write a Pandas program to append a list of dictionaries or series to an existing DataFrame
and display the combined data.
Solution:
Output:
Practical 9:Write a Pandas program to add some data to an existing Series.
Solution:
Output:
Practical 10:Create a pandas series from a dictionary of values and an ndarray.
Solution:
Output:
Practical 11:Locate the 3 largest values in a data frame.
Solution:
Output:
Practical 12:Replace all negative values in a data frame with a 0.
Solution:
Output:
Practical 13:Given a Series, print all the elements that are above the 75th percentile.
Solution:
Output:
Practical 14: Write a program to generate a series of these numbers: 33,55,65,29,19,23. Find the sum of those values which
ends with 3 or 5.
Solution:
Output:
Practical 15:Write a program to generate a series of 5 elements of multiples of 7 starting with 35 with index multiply by
3.
Solution:
Output:
PROGRAMS USING MATPLOTLIB
Practical 1:Given the school result data, analyses the performance of the students on different
parameters, e.g subject wise or class wise.
Solution: Output:
Practical 2:Write a program to plot a bar chart in python to display the result of a school for five
consecutive years.
Solution: Output:
Practical 3: Observe the given data for monthly views of one of the youtube channels for 6 months. Plot them on
the line chart.
Solution: Output:
Practical 4:Write a program to plot a range from 1 to 30 with step value 4. Use the following algebraic
expression to show data.
y = 5*x+2
Solution: Output:
SQL QUERIES
1. Create a student table with the student id, name, and marks as attributes where the student id is the primary key.
5. Find the min, max, sum, and average of the marks in a student marks table.
6. Find the total number of customers from each country in the table (customer ID, customer
Name, country) using group by.
7. Write a SQL query to order the (student ID, marks) table in descending order of the marks.
8.Write a SQL query to display the marks without decimal places, display the reminder after diving marks by 3 and display
the square of marks.
9.Write a SQL query to display names into capital letters, small letters, display frist 3 letters of name, display last 3
letters of name, display the position the letter A in name.
10. Remove extra spaces from left, right and both sidesfrom the text – “ Informatics Practices Class XII” .
To write Queries for the following question based on the given table:
Output:
(b) Write a Query to Display all details of Employees who are living in Chennai.
Output:
(c) Write a query to update increase 10% Salary of an employee whose City is ‘CHENNAI’ and Gender is ‘MALE’.
Output(After Updating):