MySQL Forums
Forum List  »  MySQL Workbench

theoretical question on modeling relationship sets
Posted by: Anup Joshi
Date: May 20, 2009 08:31AM

Greetings from a datamodeler/database newbie,

Prologue:

I have a theoretical question. I am currently learning database design on my own using the book "Database System Concepts" by silberschatz, korth and sudarshan ( see www.db-book.com ). At the same time I am also using mysql workbench as a tool for implementing the concepts that I learn.

The question:

In this book the authors specify 3 artifacts viz. entity sets, relationship sets and attributes as the canonical elements for modeling data. They use rectangles for modeling entity sets and diamonds for relationship sets. To state an example consider the two entity sets:

[1] entity "customer" with attributes (customer_name,customer_street, customer_city) with customer_name as the primary key

[2] entity "loan" with attributes (loan_number,branch_name,amount) with loan_number as the primary key

[3] connecting the above two entities is the relation "borrower" with attributes (customer_name,loan_number) ..(notice the use of foreign keys in the borrower relation).

The cardinality constraints from customer to loan is one-to-many.

Given the above ,

my question is, how to model the above artifacts in mysqlworkbench? my guess is to create 3 tables , one called customer, another called loan and another called borrower and link them up using the relationships toolbar ( am I right here?) ..and further here in lies the question pertaining how to model the cardinality constraints...if I link up any two tables mysql automatically places 1:n,m:n etc cardinality between the two.
I only want to model a one to many relationship between customer and loan through the borrower relation. How do I get this?
Further, say I have linked the customer table to the borrower table and the borrower table to the loan table. MySQL WOrkbench as aforementioned places cardinality constraints between customer and borrower and between borrower and loan. How do I ensure that these cardinality constraints indeed model a one-to-many relation between customer and loan?

I would appreciate any insight that experienced people in this forum can provide.

Options: ReplyQuote


Subject
Views
Written By
Posted
theoretical question on modeling relationship sets
3191
May 20, 2009 08:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.