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

Set 1 4

The document consists of multiple sets of questions related to Python Pandas and SQL queries, focusing on data manipulation and visualization. Each set includes tasks such as creating DataFrames, adding/removing data, plotting charts, and executing SQL commands for data retrieval and modification. The total marks for each set are specified, indicating the importance of each task.

Uploaded by

PERFECT GAMING
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 views4 pages

Set 1 4

The document consists of multiple sets of questions related to Python Pandas and SQL queries, focusing on data manipulation and visualization. Each set includes tasks such as creating DataFrames, adding/removing data, plotting charts, and executing SQL commands for data retrieval and modification. The total marks for each set are specified, indicating the importance of each task.

Uploaded by

PERFECT GAMING
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/ 4

SET-1

Q.NO. Python Pandas and Data Visualization Marks


Q.1-
A) Create a CSV file named 'stu.csv' and then write Python code to create a DataFrame using 2
this CSV file.

Student_Name Gender Class Sec Percentage


1 Priya Sharma F XI A 78.75
2 Neha Khurana F XI B 93.87
3 Lakshya M X A 75.45
4 Hemant M X A 63.93
5 Nikhil M XI B 92.65

B) Display only those records from Data Frame where percentage is more than 90. 2

C) Remove the record of Hemant form given Data Frame 2

D) Now plot a line chart depicting the Student name and Percentage, with appropriate titles. 2

Total = 8
SQL Queries

Q.2- Answer the following SQL queries. 1x7=7

I. Create the above table (shown in question 1) as " Student " and set the first column as
Rollno with the primary key constraint.
II. Display the details of all students whose Class is XI and Gender is Male.
III. Display detail of students in the descending order of their name.
IV. Display the details of only those students in whose name the second letter is ‘e’.
V. Display maximum Percentage gender wise.
VI. Count the number of record in every class.
VII. Display Name and percentage after round off it by zero decimal place.
SET-2
Q.NO. Python Pandas and Data Visualization Marks
Q.1- A) Write a program in python to create the following dataframe named “emp” 2

Dname Job salary department


1001 Amit Manager 90000 Accounts
1002 Sumit Clerk 34000 Admin
1003 Rohit Clerk 32000 Admin
1004 Pankaj Salesman 40000 Sales
1005 Mohan Manager 85000 Sales
1006 Raj Salesman 43000 Sales
1007 Priya Clerk 30000 Accounts

B) Add a new column named Bonus which is 20% of their salary.


2
C) Add a new row with given values [1008,Ankit,Manager,12000,Sales]
2
D) Now plot a line chart depicting the employee name on x-axis and their corresponding
salary on y-axis, with appropriate title. 2

Total = 8
SQL Queries

Q.2- Answer the following sql queries. 1x7=7

I. Create the above table as " employee " and first column is ID as primary key

II. Display all employee detail whose name start with R.

III. Delete the record of Sumit.

IV. Add Rs 500 in Salary column to all employees.

V. Display all records of admin and sales column

VI. Display detail of employees in descending order of their salary

VII. Display maximum salary of each type of job for Clerk and Manager only.
SET-3
Q.NO. Python Pandas and Data Visualization Marks
Q.1- A) Write a program in python to create the following data frame named “Coach” .
2
COACHNAME AGE SPORTS PAY GENDER
C001 Suman Sharma 35 Karate 10000 F
C002 Ravina Khurana 34 Karate 12000 M
C003 Karan Singh 34 Squash 20000 M
C004 Tarun Goswami 33 Basketball 15000 M
C005 Zubina Ahmed 36 Swimming 7500 F

B) Save this data frame data to csv file name abc.csv on drive D.
2
C) Rename column Sports as Games
2
D) Now plot a line chart depicting the coach name and Pay, with appropriate title.
2

Total = 8
SQL Queries

Q.2- Consider the above table as " Coach “and write command for given question 1x7=7

I. Create the above table as " Coach " and first column is ID as primary key.
II. Display the detail of all Coach whose pay in range 12000 to 18000
III. Change age of Karan Singh from 34 to 43
IV. Display name and first occurrence of character ‘a’ in their name.
V. Delete the record whose id is C005.
VI. Display average pay gender wise.
VII. Display number of coach for each sports.
SET-4

Q. Python Pandas and Data Visualization Marks


NO.
Q.1- A) Write a program in Python to create the following dataframe named “Player”: 2

PlayerName Game Age Stipend Gender


1001 Anita Shooting 16 12630.40 F
1002 Aryan Cricket 16 8742.90 M
1003 Subhash Tennis 18 6000.50 M
1004 Ayushi Shooting 17 10000.00 F
1005 Raj Tennis 16 7000.70 M
1006 Sunita Tennis 18 8000.80 F
1007 Riya Shooting 17 11000.90 F
2
B) Add a new column named “City” and set the value to Jaipur for all players.
2
C) Add a new row with the given values [1008,Arjun,Cricket,17,9000,M,’Jaipur’]
2
D) Now plot a bar chart depicting the Player name on x-axis and their corresponding stipends
on y-axis, with appropriate titles.
Total = 8
SQL Queries
Write SQL command to perform the following tasks:
Q.2- 1x7=7
I. Create the above table (shown in question 1) as "Player" and set the first column as ID
with the primary key constraint.
II. Display all Player details whose name starts with the letter “S”.
III. Display the records of Female cricket players.
IV. Display player name with first three character of every game name.
V. Display details of all players in the descending order of their names.
VI. Display the maximum stipend for each game.
VII. Show all player name in upper case letter and game in lowercase letter.

You might also like