Isbssjksa
Isbssjksa
NO: 1
DATE:
CREATING A PYTHON PROGRAM TO CREATE A
SERIES USING A DICTIONARY.
AIM:
To write a Python program to create a Series to store 5 students Percentage Using
dictionary and print all the elements that are above 75 percentage.
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
SAMPLE OUTPUT:
************************************************************************************************
3
EX.NO: 2
DATE:
CREATING A PYTHON PROGRAM TO CREATE A
SERIES USING SCALAR VALUE
AIM:
To write a Python program to create a Series object that stores the Initial budget
allocated (50000/- each) for the four quarters of the year: Qtr1, Qtr2, Qtr3 and Qtr4.
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
SAMPLE OUPUT:
4
EX.NO: 3
DATE:
CREATING A PYTHON PROGRAM TO CREATE A
SERIES USING NUMPY ARRAY
AIM:
To write a Python program to create a Series object that stores the Employee names
as index and their Salary as values
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
SAMPLE OUTPUT:
*************************************************************************************************
5
EX.NO: 4
DATE:
Source Code:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
Sample Output:
****************************************************************************************
6
EX.NO: 5
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
SAMPLE OUTPUT:
**************************************************************************************************
7
EX.NO: 6
DATE:
Source Code:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
Sample Output:
***************************************************************************************
8
EX.NO: 7
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
SAMPLE OUTPUT:
*************************************************************************************************
9
EX.NO: 8
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
SAMPLE OUTPUT:
**************************************************************************************************
10
EX.NO: 9
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
SAMPLE OUTPUT:
**************************************************************************************************
11
EX.NO: 10
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
12
SAMPLE OUTPUT:
*************************************************************************************************
13
EX.NO: 11
DATE:
AIM:
To write a Python program to create a panda’s DataFrame called DF for the following
table Using Dictionary of List and perform the following operations:
(i) Insert a new column “Bags” with values as [5891, 8628, 9785, 4475].
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
14
SAMPLE OUTPUT:
**************************************************************************************************
15
EX.NO: 12
DATE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
16
Sample Output:
*************************************************************************************
17
EX.NO: 13
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
SAMPLE OUTPUT:
*******************************************************************************************
18
EX.NO: 14
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
*******************************************************************************************
19
EX.NO: 15
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
20
SAMPLE OUTPUT:
**********************************************************************************************
21
EX.NO: 16
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed successfully, and the output has
been verified.
SAMPLE OUTPUT:
**********************************************************************************************
22
EX.NO: 17
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed and verified successfully, and its
respective chart has been generated successfully.
SAMPLE OUTPUT:
*********************************************************************************************
23
EX.NO: 18
DATE:
Source Code:
RESULT:
Thus, the above Python program has been executed and verified successfully, and its
respective chart has been generated successfully.
Sample Output:
***********************************************************************************************
24
EX.NO: 19
DATE:
Source Code:
RESULT:
Thus, the above Python program has been executed and verified successfully, and its
respective chart has been generated successfully.
Sample Output:
*****************************************************************************************************
25
EX.NO: 20
DATE:
SOURCE CODE:
RESULT:
Thus, the above Python program has been executed and verified successfully, and the
respective chart has been generated successfully.
SAMPLE OUTPUT:
******************************************************************************************
26
PRATICAL 26
Problem statement: Create a student table with the student id, name, and marks as
attributes where the student id is the primary key.
Solution:
Source Code:
create table student
( -> studid int primary key,
-> name varchar(30),
-> marks int
-> );
Screenshot:
PRATICAL 27
Problem statement: In the table ‘student’ created in practical 26, insert the details of new
students.
Solution:
Source Code:
insert into student values(1, 'sanjay', 67);
mysql> insert into student values(2, 'surendra', 88);
mysql> insert into student values(3, 'Jamil', 74);
mysql> insert into student values(4, 'Rahul', 92);
mysql> insert into student values(5, 'Prakash', 78);
Screenshot:
PRATICAL 28
Problem statement: Write SQL command to get the details of the students with marks
more than 80.
Solution:
Source Code:
select * from student where marks >=80;
Screenshot:
PRATICAL 29
Problem statement: Write SQL command to Find the min, max, sum, and average of the
marks in a student marks table..
Solution:
Source Code:
select min(marks) as Min_marks, max(marks) as Max_Marks, sum(marks) as
Total_Marks, avg(marks) as Average_Marks from student;
Screenshot:
PRATICAL 30
Problem statement: Delete the details of a student table created in Practical 26.
Solution:
Source Code:
Delete from student;
Screenshot:
PRATICAL 31
Problem statement: Find the total number of customers from each country in the table
(customer ID, customer Name, country) using group by.
Solution:
Source Code:
select country, count(cname) as 'Total_Customers' from customer
group by country;
Screenshot:
PRATICAL 32
Problem statement: Write a SQL query to order the (student ID, marks) table in descending
order of the marks.
Solution:
Source Code:
select * from student Order By name DESC;
Screenshot:
PRATICAL 33
Problem statement: for the given table ‘Hospital’ write SQL command to display name all
patient admitted in month of May.
PID PNAME ADMITDATE DEPT FEES
AP/PT/001 Rahil Khan 21/04/2019 ENT 250
AP/PT/002 Jitendal Pal 12/05/2019 Cardio 400
AP/PT/003 Suman Lakra 19/05/2019 Cardio 400
AP/PT/004 Chandumal Jain 24/06/2019 Neuro 600
.
Solution:
Source Code:
select * from hospital where monthname(admitdate) = 'May';
Screenshot:
PRATICAL 34
Problem statement: for the given table ‘Hospital’ write SQL command to Display patient
name in upper case with year of admission.
PID PNAME ADMITDATE DEPT FEES
AP/PT/001 Rahil Khan 21/04/2019 ENT 250
AP/PT/002 Jitendal Pal 12/05/2019 Cardio 400
AP/PT/003 Suman Lakra 19/05/2019 Cardio 400
AP/PT/004 Chandumal Jain 24/06/2019 Neuro 600
.
Solution:
Source Code:
Select UPPER(pname) as ‘patient name’, YEAR(admitdate) as ‘admit year’
From hospital;
Screenshot:
PRATICAL 35
Problem statement: for the given table ‘Hospital’ Create sql query to display first four
letters of the patient name along with length of their name who admitted before may.
PID PNAME ADMITDATE DEPT FEES
AP/PT/001 Rahil Khan 21/04/2019 ENT 250
AP/PT/002 Jitendal Pal 12/05/2019 Cardio 400
AP/PT/003 Suman Lakra 19/05/2019 Cardio 400
AP/PT/004 Chandumal Jain 24/06/2019 Neuro 600
.
Solution:
Source Code:
Select LEFT(pname,4) as ‘pname’, length(pname) as ‘length’
From hospital
Where month(admitdate) < 5;
Screenshot:
PRATICAL 36
Problem statement: To display student id, Name, DOB, Marks, Email of those male students
in ascending order of their names.
STUDENT ID NAME DOB MARKS EMAIL
SCS101101 Rahil Khan 21/04/2000 450 [email protected]
SCS101102 Jitendal Pal 12/05/2001 499 [email protected]
SCS101103 Suman Lakra 19/05/2002 460 [email protected]
SCS101104 Chandumal Jain 24/06/2002 489 [email protected]
Solution:
Source Code:
SELECT STUDENT_ID, NAME, DOB, MARKS, EMAIL FROM STUDENT WHERE GENDER='M'
ORDER BY NAME;
Screenshot:
PRATICAL 37
Problem statement: Describe the below table
STUDENT ID NAME DOB MARKS EMAIL
SCS101101 Rahil Khan 21/04/2000 450 [email protected]
SCS101102 Jitendal Pal 12/05/2001 499 [email protected]
SCS101103 Suman Lakra 19/05/2002 460 [email protected]
SCS101104 Chandumal Jain 24/06/2002 489 [email protected]
Solution:
Source Code:
DESC STUDENT;
Screenshot:
PRATICAL 38
Problem statement: Display student name whose marks above 470.
STUDENT ID NAME DOB MARKS EMAIL
SCS101101 Rahil Khan 21/04/2000 450 [email protected]
SCS101102 Jitendal Pal 12/05/2001 499 [email protected]
SCS101103 Suman Lakra 19/05/2002 460 [email protected]
SCS101104 Chandumal Jain 24/06/2002 489 [email protected]
Solution:
Source Code:
SELECT NAME FROM STUDENT WHERE MARKS>470;
Screenshot:
PRATICAL 39
Problem statement: To display student id, Name, DOB of those students who are born
between ‘2000- 04-21’ and ‘2002-06-24’.
STUDENT ID NAME DOB MARKS EMAIL
SCS101101 Rahil Khan 21/04/2000 450 [email protected]
SCS101102 Jitendal Pal 12/05/2001 499 [email protected]
SCS101103 Suman Lakra 19/05/2002 460 [email protected]
SCS101104 Chandumal Jain 24/06/2002 489 [email protected]
Solution:
Source Code:
SELECT STUDENT_ID, NAME, DOB FROM STUDENT WHERE DOB BETWEEN '2000-04-21'
AND '2002-06-24';
Screenshot:
PRATICAL 40
Problem statement: To display student id, Gender, Name, DOB, Marks, Email in descending
order of their marks.
STUDENT NAME GENDER DOB MARKS EMAIL
ID
SCS101101 Rahil Khan M 21/04/2000 450 [email protected]
SCS101102 Jitendal Pal M 12/05/2001 499 [email protected]
SCS101103 Suman Lakra M 19/05/2002 460 [email protected]
SCS101104 Chandumal Jain M 24/06/2002 489 [email protected]
Solution:
Source Code:
SELECT STUDENT_ID, GENDER, NAME, DOB, MARKS, EMAIL FROM STUDENT ORDER BY
MARKS DESC;
Screenshot: