Professional Documents
Culture Documents
XII IP - Practical Program Lists - Students
XII IP - Practical Program Lists - Students
XII IP - Practical Program Lists - Students
ACADEMY
e. Write a query to display all the records with all the columns.
f. Write a query to display ename and salary of employees whose salary are
greater than or equal to2200.
g. Write a query to display employee name and salary of those employees who
don‟t have their salary range of 2500 to 4000.
h. Write a query to display employee name and salary of those employees
whose name contains “I” as third alphabet in ascending order of employee
names.
i. Write a query to display the ename and salary with 50% of salary as DA.
j. Write a query to display the employee details whose name contains “M” as
first and “H” as third alphabet.
k. Display the distinct job titles offered by the Organization.
l. Display the employee details who are working as Manager or Analyst.
m. Display the names of employees who joined the organization on or after
10/05/1991.
n. Write the command to display the system date.
o.Write the command to display the name of current month.
19. SQL program - the use of DML commands
Open MySQL and create database Std and a table named student. Write and execute the
commands for the following queries.
No Name Stipend Stream Avgmark Grade Class Date of join
1 Karan 400.00 Medical 78.5 B XI B 2009-05-06
2 Divakar 450.00 Commerce 89.2 A XI C 2009-07-05
3 Divya 300.00 Commerce 68.6 C XII C 2011-11-05
4 Arun 350.00 Humanities 73.1 B XII C 2012-12-08
5 Sabina 500.00 Non -Medical 90.6 A XI A 2012-01-08
6 John 400.00 Medical 75.4 B XII B 2008-09-29
7 Robert 250.00 Humanities 64.4 C XI A 2009-10-08
8 Rubina 450.00 Non-Medical 88.5 A XII A 2011-04-08
9 Vikas 500.00 Non-Medical 92.5 A XII A 2011-04-08
10 Mohan 300.00 Commerce 67.5 C XII C 2007-03-10
a. Write the command to display the system date.
b. Write the command to display the name of current month.
c. Write the command to print the day of the week of your birthday in the year 2015.
d. Write a query to display student names in lower case from student table.
e. Write a query to display last 3 characters from all the names of students from student
table.
f. Write a query to display student name along with the position of „N‟ character in
student column from student table.
g. Write a query to display name and two characters from 2nd position in Stream column
from student table.
h. Write a query to display name and weekday on which they joined from student table.
i. Write a query to find out the result of 6³.
j. Write a query to find out the result of 30 ½ (square root of 30).
k. Write the command to display the name and its length from student table.
l. Write the command to round off value 15.193 to nearest ten‟s i.e. 20.
m. Write a query to display name concatenated by stream from student table.
Write a query to display students name, class and number of years since they joined
20. SQL program – the use of DDL Commands
Write and execute the MySQL commands for the following queries
1. Write a Python program to create and display a series of even numbers 2, 4, 6, 8, 10, 12,
14, 16, 18, 20 with index value a, b, c, d, e, f, g, h, I, j using Pandas module. Also do the
following:
a. Display the first 5 index values.
b. Display the last 5 index values.
c. Display the values of index 4,6,and 8.
d. Display the first four index values.
e. Display the index 3 to 7.
f. Display the index 6 to end.
g. Change the element in index 3 to 50
h. Delete the 4th element from the series.
2.Write a Python program to create a series of list [ 34, 29, 65, 57, 42] and do the following:
give the index as [v,w,x,y,yz]
a. Raise to power 2 of values
b. Add 1000
c.. Subtract 500
d. Multiply by 2
e. Divide by 20
f. Display all the values greater than 50
g. Change the index of the series to [I, j, k, l, m]
h. arrange the elements of the series in the descending order
3 i). Write a pandas program to show the attributes of the series based on series of list [ 34,
29, 65, 57, 42].
[index,values,dtype,shape,nbytes, ndim,size, hasnans, empty]
ii). Write a pandas program to create the above dataframe show the attributes of the
DataFrame.
[index,columns,values, axes, dtype,shape,nbytes, ndim,size, hasnans, empty]
4.Create a DataFrame of dictionary consists of Name, Sub1, Sub2, Sub3, Sub4, Sub5 of five
students.
a. Display the DataFrame
b. Change the index to S01, S02, S03, S04, S05
c. Change the index to Name column
d. Change the index to default value
e. Change the column heading from Name to Stuname
f. Add a column Total which is Sub1+Sub2+Sub3+Sub4+Sub5
g. Display only the column Total
h. Delete the column total using del.
i. Delete the column Sub5 using pop().
j. Delete the column Sub4 using drop().
1 Delhi 40 24 24.1
2 Bengaluru 31 25 36.2
3 Chennai 35 27 40.8
4 Mumbai 29 21 35.2
5 Kolkata 39 23 41.8
i).Write down the command that will give the following output
(a) Find all rows with the label ”Pen ”.Extract all columns
(b) List only columns 0 and 2 using iloc
(c) List 2nd ,3rd and 4th rows
(d) List only the columns Count and Price using loc.
(e) Delete columns with label „Color‟ and „Count‟
7. Write a program that reads from a CSV file named product.csv where the separator
character is „$‟. Read only the first 5 rows in your dataframe. Give column headings as
ItemName, Quantity, Price. Make sure to read the first row as data and not as column
headers.
8. Write a program to plot two data sets on the same bar graph. First data set
represents the marks of Boys and second data set represents marks of girls
in a class
Boy_mark=[34,67,87,90,34]
Girl_mark=[45,80,23,56,99]
Proper labels, title and legends should be given to the plot.
Column Qtr1
containing :
Abu Dhabi 4500
Dubai 4000
RAK 7000
SHARJAH 6000
Name: Qtr1, dtype: int64
Column Qtr2
containing :
Abu Dhabi 8000
Dubai 4500
RAK 6000
SHARJAH 5000
Name: Qtr2, dtype: int64
Column Qtr3
containing :
Abu Dhabi 5000
Dubai 6500
RAK 7500
SHARJAH 7500
Name: Qtr3, dtype: int64
Column Qtr4
containing :
Abu Dhabi 9000
Dubai 6000
RAK 5000
SHARJAH 6500
Name: Qtr4, dtype: int64
13. Consider the given dataframe object salesdf ,
Write python program to display Employee wise sale in the given format :
The sales of EMP1 is :
containing :
Sales1 2000
Sales2 1000
Sales3 4000
Name: EMP1, dtype: int64
The sales of EMP2 is :
containing :
Sales1 4500
Sales2 5600
Sales3 1200
Name: EMP2, dtype: int64
The sales of EMP3 is :
containing :
Sales1 4300
Sales2 6700
Sales3 2500
Name: EMP3, dtype: int64
14 .WAPP to create a series „sair‟ of flightno. And flightname stored in a dictionary or key
value pair.
1101 Air Arabia
1102 Lufthansa
1103 Air India
1104 Lufthansa
1105 Etihad Airways
A) Add 106 Emirates airlines to services
B) Make a copy of „sair‟
C) Delete Air India
D) Update Lufthansa to Air Lufthansa
E) Display original and copied series