Hi,
Please do. Thanks.
Cheers,
Wen Shih
Hi,
I'll just give a little guidance, so you could get started.
From the problem description, the following entities are necessary:
STORE,
PRODUCT,
COMPONENT,
VENDOR,
CUSTOMER.
With these, we can establish relationships between them:
STORE - sells - PRODUCT (1-many),
PRODUCT - has - COMPONENT (many-many),
VENDOR - supplies - COMPONENT (many-many),
CUSTOMER - buys - PRODUCT (many-many),
STORE - buys - COMPONENT (1-many).
These tables may be possible:
PRODUCT (Prod #, ...),
COMPONENT (Comp #, Vendor #, ...),
VENDOR (Vendor #, ...),
CUSTOMER (Cust #, ...),
CUST_SALE (Sale #, Cust #, Prod #, ...),
STORE_PURCHASE (Purchase #, Store #, Comp #, ...).
Hope all these pointers will help you to complete your assignment! Thanks.
P.S. ERD is not difficult:
1. The main thing is to identify the main players (i.e. entities) and establish appropriate relationships between them.
2. For relationships, one should know that there are several types, i.e. 1:1, 1:many, many:many.
3. For a table specific to an entity, one should always have a unique serial number, plus some logical attributes.
4. For a table related to two entities, like CUST_SALE, the table must capture the keys of both entities.
Cheers,
Wen Shih
Thanks wee_wrs for the explaination. i came out with:
Im not too sure about the attributes, i got the connections correctly i guess. can you help me with it? gotta do it on MySQL so i gotta get the diagram right. TIA
Hi,
Good work, it looks alright and practical at first glance :)
However, when you start working on SQL, there may be a need for you to tweak the ERD design to make database queries as optimised as possible. It is also important to look at the query requirements for your case study.
Additionally, you might want to ask if there is need for you to have your tables normalised to 3NF.
Database design, as with programming, is always about going back and forth. Jiayou!
Cheers,
Wen Shih
Ahh thanks! what do you mean by tables normalised to 3NF? im just a week into this so i've got no idea.. Thanks
Hi,
Perhaps you will encounter the concept of normalisation later in your course. In any case, normalisation seeks to make all database table attributes depend solely on the primary key.
This site provides you with the basics through an example:
http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html
Enjoy learning! Thanks.
Cheers,
Wen Shih