0% found this document useful (0 votes)
4 views8 pages

practice_test

The document outlines a series of tasks related to data manipulation and visualization using Python and SQL. It includes creating and modifying DataFrames, plotting graphs, and executing SQL commands on various tables such as Movie, Cast, Supplier, and Product. Additionally, it specifies practical assignments and assessments for a course in Informatics Practices.

Uploaded by

Sonit Karnad
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)
4 views8 pages

practice_test

The document outlines a series of tasks related to data manipulation and visualization using Python and SQL. It includes creating and modifying DataFrames, plotting graphs, and executing SQL commands on various tables such as Movie, Cast, Supplier, and Product. Additionally, it specifies practical assignments and assessments for a course in Informatics Practices.

Uploaded by

Sonit Karnad
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/ 8

Sub – Informatics Practices (065)

SET – I

1. Create the Dataframe ‘df’ 4

i) Display name and the age of 2nd row and 3rd row
ii) Display the row 2 in the dataframe.
iii) Change the height to values [160,175,170]
iv) Add a new member ‘JOHN’ to the Dataframe.

2. For the above Dataframe, plot the Name against the age. 1
hint: d1=df[“name]
d2=df[“age”]
plt.bar(d1,d2)
3. Draw the following bar graph representing the uses of programming language. 3
Plot with appropriate title,x-axis title,y-axis title .

4. Create a table MOVIE and CAST, insert the values and write SQL 7
commands for the following:
TABLE: Movie
Movie
M_Name Type PID
Id
M001 Gone with the Wind Drama P01
M002 Doctor Do Little Comedy P02
M003 Coyote Ugly Action P03

TABLE: Cast
PID Price Cast
P01 200 Clark Gable
P02 230 Eddie Murphy
P03 268 Piper Perabo

i) To display the no. of movies for each type of movie where the number of movies
is more than 2.
ii) Movies starting with letter ’G’.
iii) Display the Movie name, type of movie in the decreasing order of their movie
name..
iv) Update the price by 5% and display the table cast.
v) Display the movie name, no of characters in the movie name.
vi) Display the position of the string “ie” in the field cast.
vii) Display the moviename, type and the corresponding cast of the movies.

5. Practical file 5
6. Viva-Voce 5
7. Project 5
Sub – Informatics Practices (065)
SET – II

1. A DataFrame fdf stores data about passenger’s flights and years. 4


First few rows of the DataFrame are shown below ( using list of Series)

• Add April month with 130 passengers for year 2009.


• Add indexes ‘I’, ‘II’, ‘III’, ‘IV’.
• Add a new column Country with the value ‘India’,
• Drop the column “Passengers” and row 4.

2. Write a python program to plot a line chart based on the given data to depict the 4
changing medal tally between four Houses in school. Plot with appropriate title,
x-axis tile,y-axis tile .
House = ['Varun', 'Prithvi', 'Agni', 'Trishul']
Medal = [50,70,90,110]

3. Create a table Supplier and Product, insert the values and write SQL commands for 7
the following

TABLE: Supplier
Sno Sname Qty Price PID
S1 Britannia 150 40 P01
S2 Britannia 250 90 P01
S3 Amul 170 50 P03
S4 Cadbury 380 70 P04

TABLE: Product
PID Pname City
P01 Bread Delhi
P02 Coffee Mumbai
P03 Milk Mumbai
P04 Chocolate Bangalore

i)To display sum of products of each supplier where the sum of products is more
than 60.
ii) Display Sname, price sorted in the descending order of their quantity.
iii) To give an increase of 10% for the price and show the table.
iv) Display product name, no. of characters for the products in Delhi or Mumbai.
v) Display the least price.
vi) Display the two characters from supplier Name starting from third character.
vii) Display the Supplier name, Product name with their corresponding city.
4. Practical file 5
5. Viva-Voce 5
6. Project 5
SET III

1. Write a Python code for following questions


on dataframe ‘df’ using dictionary of Series: 4

• Display only column “country” from the dataframe.


• Display only rows 0 and 1 from the dataframe.
• Rename column 0 to “countries” and row 0 to “a”
• Drop row 2.

2. Write a program to generate a histogram with the following values 4


X=[25,28,35,46,57,68,73]
Include the following arguments along with histogram.
a. It should be a horizontal histogram.
b. Number of bins should be 20.

3. Create a table, insert the values and write SQL commands for 7
the following

TABLE: Voter
Vno Vname Gender Vid
1 Diwaker M V01
2 Rajiv M V02
3 Smitha F V03
4 Arpit M V04

Table: List
Vid Age city
V01 22 Bangalore
V02 23 Delhi
V03 26 Mumbai
V04 23 Bangalore

i) To count the no. of voters for each gender where the number of voters is more than 2.
ii) Display the voters in the ascending order of name.
iii)To display the name and gender of voters whose name contain letter ‘S’.
iv) Display the name, no. of characters in name of voters.
v) Display 4 characters extracted from Voters Name starting from 5th right character.
vi) Display the year and month name of today’s date.
vii) Display the Voter name, Gender and their corresponding age.
4. Practical file 5
5. Viva-Voce 5
6. Project 5
SET – IV

1. Write a Python code for following questions on dataframe’df’


using list of dictionary: 4

i) Display Ename of the first two rows.


ii) Display the row 2 in the dataframe.
iii) Change the Salary to values [80000,50000,90000]
iv) Add a new Employee ‘Sofia’ with Post Analyst and Salary 85000.

2. Write Python code to plot a bar chart as shown below: 4

Plot with appropriate Graph title, x-axis title, y-axis title etc.

3. Create a table, insert the values and write SQL commands for 7
the following.
TABLE: Product

id pname price category_id


1 Smart watch 235.00 2
2 Bricks 26.70 3
3 Lamp 128.00 2
4 Sofa 3200.00 1
TABLE:Category
category_id cname
1 furniture
2 electronics
3 toys

i) To count the no. of products under each category where the number of products is
more than 1.
ii) Display the products in the ascending order of price.
iii) To display the name and price whose name contain letter ‘S’.
iv) Display the name, no. of characters in name of product.
v) Display the position of letter ‘a’ in products name.
vi) Display the year and month name of today’s date.
vii) Display the name, price and their corresponding category name.

4. Practical file 5
5. Project 5
6. Viva-Voce 5

*********************

You might also like