Page 41 - IPP-12-2025
P. 41
import __________ as plt # Statement 1
products = ['Product A', 'Product B', 'Product C', 'Product D']
sales = [50, 75, 100, 60]
plt.bar(products,__________ , color='green', label='Sales') # Statement 2
plt.xlabel('Products')
plt.ylabel(' _________ ') # Statement 3
plt.legend()
plt.title(' _________ ') # Statement 4
plt.show()
(a) Write a suitable code for the import statement in the blank space against Statement 1.
(b) Refer to the given graph and fill in the blank against Statement 2 with a suitable Python code.
(c) Fill in the blank against Statement 3 with a suitable label for the y-axis.
(d) Refer to the given graph and fill in the blank in Statement 4 with a suitable Chart Title.
34. A sports academy maintains a database to track the performance of its players. The database includes a
table named PLAYER whose column (attribute) names are mentioned below: [4]
PLAYERID: Shows the unique identifier for each player
NAME: Indicates the name of the player
SPORTS: Specifies the sports played by the player
AGE: Indicates the age of the player
SCORE: Lists the total score achieved by the player
Table: PLAYER
PLAYERID NAME SPORTS AGE SCORE
P2001 Lavanya Cricket 20 1500
P2002 Shobit Badminton 22 1800
P2003 Pankaj Tennis 25 2300
P2004 Rehansh Cricket 19 1200
P2005 Geetanjali Football 23 1900
(a) Write an SQL query to display the names of all the players in uppercase.
(b) Write an SQL query to find the youngest player in the database.
(c) Write an SQL query to display the total score of players for each sport.
(d) Write an SQL query to display player names and scores, sorted in descending order of scores.
Or
Aditi, a librarian, has developed a database to manage books in a library. The database includes a table
named LIBRARY_BOOKS with column (attribute) names as mentioned below:
BOOK_ID: Shows the unique code for each book
TITLE: Specifies title of the book
AUTHOR: Specifies author’s name
COPIES: Indicates the number of copies available
PUB_DATE: Specifies publication date of the book
Table: LIBRARY_BOOKS
BOOK_ID TITLE AUTHOR COPIES PUB_DATE
B001 The Alchemist Paulo Coelho 150 2005-06-15
B002 To Kill a Mockingbird Harper Lee 50 1960-07-11
B003 The Great Gatsby F. Scott Fitzgerald 100 1925-04-10
B004 1984 George Orwell 200 1949-06-08
B005 Pride and Prejudice Jane Austen 75 1813-01-28
P.14 Informatics Practices with Python–XII