Page 23 - IPP-12-2025
P. 23

plt.xlabel('Months')
                    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 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 graph and fill in the blank against Statement 4 with a suitable Chart Title.
                Ans.  (a)  import matplotlib.pyplot as plt
                     (b) plt.plot(months, temperature, color='blue', marker='o', label='Temperature')
                     (c) plt.ylabel('Temperature (°C)')
                     (d) plt.title('Monthly Temperature Trend')
                 34. A restaurant maintains a database to track its orders. The database includes a table named ORDERS with
                    the following attributes:                                                                 [4]

                    ORDER_ID:          Shows the unique identifier for each order
                    CUSTOMER_NAME:  Indicates the name of the customer who placed the order
                    ITEM_NAME:         Specifies the name of the item ordered
                    ORDER_DATE:        Indicates the date when the order was placed
                    TOTAL_AMOUNT:      Lists the total amount of the order
                                                          Table: ORDERS

                           ORDER_ID      CUSTOMER_NAME      ITEM_NAME      ORDER_DATE      TOTAL_AMOUNT
                             O1201      Nitya Chauhan       Pizza         2024-12-20     550
                             O1202      Shreya Sharma       Burger        2024-12-13     250
                             O1203      Manish Chawla       Pasta         2024-12-01     350
                             O1204      Anjali Goyal        Salad         2024-12-05     195
                             O1205      Namrata Singh       Burger        2024-12-17     379
                     (a) Write an SQL query to display the total amount of all orders placed before 2024-12-25.
                     (b) Write an SQL query to find the most expensive item ordered.
                     (c) Write an SQL query to display the order ID and customer names on the basis of items ordered.
                     (d) Write an SQL query to calculate the total revenue from all orders placed by customers having order ID
                         below O1203.
                                                               Or
                    A  school  maintains  a  database  of  teachers.  The  database  includes  a  table  named  TEACHERS  with  the
                    following attributes:
                    TEACHER_ID:  Shows the unique identifier for each teacher
                    NAME:        Indicates the name of the teacher
                    SUBJECT:     Specifies the subject taught by the teacher
                    EXPERIENCE:  Indicates the years of teaching experience
                    SALARY:      Specifies the monthly salary of the teacher

                                                         Table: TEACHERS
                         TEACHER_ID           NAME               SUBJECT        EXPERIENCE     SALARY
                            T1221      Ms Neelam Singh     Hindi               5            45000
                            T1222      Mr Mohit Sharma     Computer Science    10           75000
                            T1223      Ms Meena Wahi       Sanskrit            3            25000
                            T1224      Ms Vandana Gupta    English             8            55000
                            T1225      Mr Santosh Yadav    Physics             6            50000




                                                                                    Model Test Paper         M.20
                                                                                                             39
   18   19   20   21   22   23   24   25   26   27   28