Practical Exam Practice Questions
Practical Exam Practice Questions
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.
********