Page 288 - IT-802_class_12
P. 288

//with id commodity_id

               //SQL command to be used: select

                   QUESTION
                   Identify at least two other functionalities that should be supported by class Commodities and
                   write routines for them.


        5.   The commodity inserted above contain the vendor_id of the vendor offering the commodity for selling. So, we also
           need to specify information regarding all the vendors in the table vendors. This may be achieved using the function
           insert_vendor of class Vendor.
        6.   Further, functions delete_vendor and modify_vendor may be used to delete or modify any seller’s information,
           as and when required. If the customer selects any product on the website, then the function display_vendor may
           be used to display the details of seller offering the product. Suppose the same product is offered by more than
           one seller. In such case, you need to list all the sellers along with their details. Here, declaring Commodity_id and
           Vendor_id as the composite key will serve the purpose.

          package shopping_appllcation;

          public class Vendor{ public void insert_vendor (string vendor_tuple[])
               //Add functionally to insert a row of vendor named / /vendor_tuple

               //SQL command to be used: insert
          public void delete_commodity (int commodity_id)

               / ‘Add functionally to delete a vendor with id vendor_id
               / ‘SQL comnnand to be used: delete

          public void modify_vendor(int vendor_id, String actr, String new)
                //Add functionally to change value of attribute attr //of product with id
               vendor_id to new

               //SQL command to be used: update
          public void display_vendor(int commodity_id)

          {
               //Add functionally to display details of the vendor

               //with id vendor_id
               //SQL command to be used: select

          }
          }

                   QUESTION

                   Suppose a buyer want to provide rating to a vendor. Is there any need of special routine for
                   that? Specify how can you achieve this.







          286   Touchpad Information Technology-XII
   283   284   285   286   287   288   289   290   291   292   293