0% found this document useful (0 votes)
17 views2 pages

Practical Exam Practice Questions

The document contains two sections: Python and SQL exercises involving DataFrames and database management. In Python, tasks include creating DataFrames, adding rows and columns, sorting data, and generating graphs. The SQL section involves creating tables, displaying and updating records, and performing queries related to student and athlete data.

Uploaded by

AmazingGamer HQ
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)
17 views2 pages

Practical Exam Practice Questions

The document contains two sections: Python and SQL exercises involving DataFrames and database management. In Python, tasks include creating DataFrames, adding rows and columns, sorting data, and generating graphs. The SQL section involves creating tables, displaying and updating records, and performing queries related to student and athlete data.

Uploaded by

AmazingGamer HQ
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/ 2

PYTHON

Q1. Consider the following DataFrame std and answer the following :
​ ​ ​ IP ​ Eco ​ Eng
Rohit​ ​ ​ 45 ​ 39 ​ 48
Suman ​ ​ 23 ​ 29 ​ NaN
Nitish ​​ ​ 30 ​ 32 ​ 36
Ramesh ​ ​ 41 ​ 45 ​ 42
I.​ Create the given dataframe.
II.​ Add a new row for a student who joined as a new admission and enter the 3 set of marks.
III.​ Add a new column Average with the average of IP, Eco & Eng marks.
IV.​ Print details in the descending order of Average marks.
V.​ Display the subject-wise maximum marks scored.
VI.​ Display the number of dimensions in the DataFrame.
VII.​ Store the dataframe contents in a csv file.
VIII.​ Generate a bar graph for the above dataframe.

Q2. Consider the following DataFrame ndf and answer the following :
​ ​ Basic ​ HRA ​ ​ DA
​ Arun ​ ​ 15000​ ​ 8000 5000
​ Anu ​ ​ 20000 ​​ 7500 ​ ​ 4500
​ Benit​ ​ 15000​ ​ NaN ​ ​ 6000
​ Cilona​ ​ 18000 ​​ 7800 ​ ​ 5500
I.​ Create the given dataframe.
II.​ Add a new row for an employee appointed later and enter the Basic Salary, HRA & DA.
III.​ Add a new column Total Salary with sum of Basic, HRA & DA.
IV.​ Print details in the ascending order of Total Salary.
V.​ Display the minimum Basic, HRA & DA.
VI.​ Remove the record that belongs to Benit.
VII.​ Store the dataframe contents in a csv file.
VIII.​ Generate a line graph for the above dataframe.

SQL

Q1. A School in Delhi uses a database management system to store student details. The school
maintains a database 'school_record' under which there are two tables.
Student Table - Maintains general details about every student enrolled in school.
StuLibrary Table - To store details of issued books.
BookID is the unique identification number issued to each book.
Minimum issue duration of a book is one Day.

I.​ Create the above tables with 5 suitable records in both tables.
II.​ Display the data of StuLibrary table in ascending order of BookID.
III.​ Fetch StudentID, BookID, StuName of the book issued most recently as per the records.
IV.​ Display StuName of those who belong to Delhi region as per the StuAddress.
V.​ Update the StuAddress of StuID 4 to any other address.
VI.​ Delete records which belong to StuID 3.
VII.​ Display the count of records with Issued_date in the month of January.
Q2. Consider the following two tables - ATHLETE, which stores AthleteID, Name, Country and MEDALS,
which stores AthleteID, Sport, and Medals. This table displays the number of medals won by each athlete
in their respective sports.

I.​ Create the above tables with the given data.


II.​ Display the data of the Medals table in ascending order of Medals count.
III.​ Fetch AthleteID of those who have received more than 5 medals.
IV.​ Display the sports-wise total number of medals won from Medals table.
V.​ Update the Sport of AthleteID 104 to any other sport.
VI.​ Delete records which belong to Denmark.
VII.​ Display the AthleteID, Name, Sport of those whose Country begin with letter ‘U’.

********

You might also like