0% found this document useful (0 votes)
15 views

Practical File Questions Updated

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)
15 views

Practical File Questions Updated

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/ 5

Practical File Questions

(12 IP)

1. Create a Series object using the python sequence with 5 elements.

2. Create a Series object ‘Apple’ to store all vowels individually. Its index should
be 1,2,3,4 and 5.

3. WAP to create a Series object using ndarray that has 5 elements in the range
50 and 100.

4. WAP to create a Series using list.

5. WAP to create a series using following two different lists:


a. Months = [“Jan”, “Feb”, “Mar”, “Apr”, “May”, “June”, “July”]
b. No_days = [31,28,31,30,31,30,31]

6. WAP to create a Series using numerical Scalar Values.


Take the index from “a to f” and the value as 55.

7. WAP to create a series from a dictionary.

8. WAP to create dataframe from list.

9. WAP to create dataframe from nested lists by passing column names and
index values
Data1 = [[‘Ravi’,25], [‘Tanush’,28], [‘Ravindra’,30], [‘Dharmendra’,29]]
Idx = [‘emp1’, ‘emp2’, ‘emp3’, ‘emp4’]

10. WAP to create Dataframe using dictionary of Series


Name Hindi IP Maths
0 Rahul 85 89 75
1 Dinesh 59 78 65
2 Lakshya 89 67 59
3 Manish 90 87 78

11. WAP to create dataframe using numpy ndarray

Name Age Grade


0 Alice 20 85
1 Bob 22 90
2 Charlie 21 88
3 David 23 92
4 Eve 20 95

12. WAP to create a Series object using a dictionary that stores the number of
students in each section of class 12th.

13. You are working with a DataFrame that contains information about a group of
students. The DataFrame includes the following columns:
● Name
● Age
● Grade
Write a Python program using Pandas to find the datatype of each column in
the DataFrame.
Name Age Grade
0 Alice 20 85
1 Bob 22 90
2 Charlie 21 88
3 David 23 92
4 Eve 20 95

14. Write a program to create a series using list of marks of 10 student’s and
display first 5 student’s marks and last 2 students marks from series
object.(using head() and tail()).

15. Write a program that reads students marks from a ‘Result.csv’ file and
displays the percentage of each student.

16. Write a program to store the details of Employees such as Empno, Name,
Salary into a Employee.csv file. Also, write a code to read employee details
from csv file.

17. Write a Python program to plot a Line chart to depict the changing weekly
Rice and Wheat prices for four weeks. Also, give appropriate axes labels,
title, and keep the marker style as Square and marker edge color as ‘green’
for Rice.
Wheat = [45,25,32,,80]
Rice = [16,18,45,50]

18. Write a python program to display a horizontal bar chart of the number of
students in a class.
Sample Data:
Class: I, II, III, IV, V, VI, VII, VIII, IX, X
Strengths: 40,43,50,46,36,42,40,61,50,48

19. Plot a histogram of a class text of 40 students based on random sets of marks
obtained by the students (MM = 100)

20. Write a program to plot a multiple bar chart From CSV file using matplotlib for
subject wise score of Class A, Class B and Class C. Different colors represent
each class, and subjects include English,Accountancy,Economics,BST and IP.
Proper labels, a title and a legend are displayed on the chart.
21. —----
22. —----

DBMS SQL Queries

23. Write a query to Create a new database in the name of “University”.

24. Write a query to open the database “University”.

25. Write a query to create the below table called: Student

id Name Gender Age Subject DOB Fees City

26. Write a query to list all the existing database names.

27. Write a query to list all the tables that exist in the current database.

28. Write a query to insert all the rows of the following table inside the Student
table.

1 Ravi M 18 Commerce 2005-06-08 20000 Jaipur

2 Gungun F 19 Commerce 2004-05-16 20000 Udaipur

3 Om M 19 Science 2004-11-18 25000 Jodhpur

4 Prateek M 19 Science 2004-05-18 25000 Jaipur

5 Diwanshu M 18 Science 2005-12-30 25000 Bikaner

6 Himanshu M 20 Humanities 2003-01-10 21000 Jaipur


7 Payal F 19 Humanities 2004-05-21 21000 Jaipur

29. Write a query to display all the details of the student from the Student table.

30. Write a query to list all the products in descending order by their product
name from the following Product table.

Product
id ProductName Category Price StockQuantity

1 Laptop Electronics 50000 50

2 Phone Electronics 30000 60

3 Coffee Maker Home Appliances 2000 150

4 Shampoo Personal Care 500 600

5 Headphone Electronics 5500 500

31. Write a query to find total stock quantity from Product Table.

32. Write a query to display the MAX(StockQuantity) and MIN(StockQuantity)


from the Product table.

33. Write a query to count the number of products which have a price more than
5000 in the Product table.

Q34 - 38 - To write Queries for the following Questions based on the given
table -"STUDENT":
34. Write a Query to Display the square of age for students who got admission in
the month of May.
35. Write a Query to display Student names and their Percentage in round figure.
36. Write a Query to display Department name in lower case letters.
37. Write a Query to display department name and its respective number of
characters in Dept column.
38. Write a Query to display student name and month of date of admission of all
Students.
Q39 - 42 Write the SQL query for questions
Consider the following relations MobileMaster and MobileStock:
Table: MOBILEMASTER
M_Id M_Company M_Name M_Price M_Mf_Date

MB001 Samsung Galaxy 4500 2013-02-12

MB003 Nokia N1100 2250 2011-04-15

MB004 Micromax Unite3 4500 2016-10-17

MB005 Sony XperiaM 7500 2017-11-20

MB006 Oppo SelfieEx 8500 2010-08-21


Table: MOBILESTOCK
S_Id M_Id M_Qty M_Supplier

S001 MB004 450 New Vision

S002 MB003 250 Praveen Gallery

S003 MB001 300 Classic Mobile Store

S004 MB006 150 A-one Moviles

S005 MB003 150 The Mobile

S006 MB006 50 Mobile Centre

39. Display the mobile company, mobile name and price in descending order of
their manufacturing date.
40. List the details of mobiles whose name starts with "S".
41. Display the mobile supplier and quantity of all mobiles except "MB003".
42. To display the names of mobile companies having price between 3000 and
5000.

You might also like