Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013
    Posts
    1

    ER diagram confusion

    Consider the following set of requirements to maintain a warehouse store database:

    You should record the store with store ID, store name and location. There are more than one stores in a city, one store is a supervise store.
    Stores sell products. You should record each product as product code, name and price. Different stores may supply different price for same product.
    The database should also maintain customer information. You should record the name, address, phone number of each customer.
    An invoice is written for a single customer, but a customer can have many invoices. You should record invoice number, the date of an invoice issued.
    You should record items of each invoice which describe the products bought by the customer. You should record the quantity of each product.

    According to the information above, draw a corresponding ER diagram. Please note:
    a) You can decide the names for entities, attributes and relations, but you should use UPPERCASE to name your entities and use Capitalisation to name attributes of entities.
    b) Underline all primary key attributes, and put (f.k) next to all the foreign key attributes.
    c) Clearly indicate participation and cardinalities between entities.


    answer:
    i did draw the following diagram, only issue is how to links invoice-customer-product ?

    you should record items of each invoice which describers the products brought by the customer .record quantity?


    For this i tried to make a table "invoice/customer" but then how to add product when it has no link with product?
    Attached Thumbnails Attached Thumbnails f1.jpg  

  2. #2
    Join Date
    Apr 2013
    Posts
    9
    about link bet invoice and customer but the customer_code as a foreign key in invoice because the relation bet them many to one

    about link bet invoice and products you can create new table put the customer_code and invoice_code as foreign keys in that table

    I think this is the solution but I don't know it is right or wrong , I just want to help ^^

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •