Page 36 - PYTHON-12
P. 36

Table: PROJECTS
                   PROJECT_ID      EMP_ID             PROJECT_NAME           DURATION (In Months)
                  P1110          E4001         Learning Management System   6
                  P1111          E4006         University Management System 5
                  P1112          E4001         Banking Management System    12
                  P1113          E4003         Billing System               4
                  P1114          E4002         Inventory Management System 3
                  P1115          E4001         Attendance Marking System    7
                  (i)  To display complete details (from both the tables) of those Employees whose salary is more than 20000.
                 (ii)  To display the details of projects whose duration is in the range of 3 to 12 months (both values included).
                 (iii)  To decrease the duration of all projects that contain the letter ‘i’ in their names by 2 months.
                  (iv)  (a)  To display names (FirstName and LastName) of employees whose date of joining is before
                         ‘2010-01-20’.
                                                            OR
                      (b)  To display the degree and cardinality of both the tables (EMPLOYEES and PROJECTS).
              35.  A table named FLORIST in FLOWERS database has the following structure:                   (4)

                        Field           Type
                  Flower_Name      Varchar (20)
                  Flower_Color     Varchar (15)
                  Price            Decimal(5,2)
                  Quantity         Int(10)
                  Write the following Python function to perform the specified operation:
                  Show() to input details of flowers and store them in the table FLORIST. The function should then retrieve and
                 display all records from FLORIST table where the Price is greater than 150.
                  Assume the following for Python-Database connectivity:
                  Host: localhost
                  User: root
                  Password: Flora

                                                         Section E
              36.  Vinita is a librarian working in a private school. She needs to manage the records of various books. For this,
                 she wants the following information of each book to be stored:                             (5)
                   •  Book_ID – Integer
                   •  Book_Name – String
                   •  Purchase_date – Date
                   •  Price – Float
                   •  Subject – String
                  As a programmer of the school (IT Department), you have been assigned to do this job for Vinita.
                  (a)  Write a function to input the data of books and append it in a binary file.
                  (b)  Write a function to update the data of books whose price is more than 350 and change their ID to ‘B101’.
                  (c)  Write a function to read the data from the binary file and display the data of all those books which are of
                     ‘English’.
              37.  Heels Private Limited is a footwear company. It is planning to set up its India campus in Hyderabad with
                 its head office in Noida. The Hyderabad campus will have five blocks—ADMIN, SALES, MATERIAL, TARGET
                 AUDIENCE and PRODUCT CATEGORIES. As a network expert, you need to suggest the best network-related
                 solutions to resolve the issues mentioned in points (a) to (e), keeping in mind the distances between various
                 blocks and other given parameters.                                                         (5)



                       Appendices                                                                          A.51
   31   32   33   34   35   36   37   38   39   40   41