Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any Suggestion on Cyclic Entity Relationship?!
Message
From
24/03/1998 20:58:52
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00085989
Message ID:
00086876
Views:
44
>>But as you know, there are too many rows in Orderlines(Chooseit) and really
>>hard to control. The second thing is: Currently, our company clients only
>>completely repeat the previous order, use spprice will save much time on
>>entering new orders.
>>
>>)_(' sorry for write too long!
>
>Justok,
>
>I am having trouble understanding what you are saying, it may be the language barrier. Are you saying that Spprice is NOT a look up to find out the price for a particular item for a particular customer? Is Spprice actually where the price for a specific order line item is stored?



Well, the current Spprice is to carry the Special Price of item according to
each customer. So, PK is (Cust_no, Itemkey)

But I was suggesting my boss to make the 'SPPrice' to be another Relationship to avoid cyclic directly!! MayBe Here I used another name, 'ActualPrice' So, 'ActualPrice' will be a weak entity.
For C++, it would be inheritance the Orderline(Chooseit) and add more
fields such as reason_for_Different_Price, Production_Remark, Adjusted_Price...

Which is totally different from original scenario but really avoid the cyclic
problem!

Owing my boss fail to accept the concept, I need to use original Scenario to do.
i.e. 'Spprice' is a table carry the Special Price for each Customer with
itemkey for match!

>
>If the second is true then Spprice is NOT related to customers or items but is related to order lines and through order lines it is related to items and orders and through orders it is related to customer. Storing customer ID and order ID in Spprice, in this situation, may speed up finding those entities but it also introduces a possible data consistency problem, that is when the spprice points to a different customer than the related order points to.

You are right, original Spprice.itemkey is linked to Orderline.itemkey!!
But also linked to customer.cust_id.... Where statement:

Orders.Cust_id = Customer.Cust_id AND
Orderline.itemkey = Spprice.itemkey AND
Spprice.Cust_id = Orders.Cust_id AND
Orderline.itemkey = item.itemkey


Actually, this joining make me confuse as all are equal sign... +_+"

>
>Also in this scenario you would ahve to manage the extra foreign keys in spprice yourself as they are violations of normalization, you would not diagram these into the E-R diagram because they are things you have chosen to add for performance and are violations of normalization.

Well, if I use my suggested scenario, of cos, totally different ERD!!
As not change the current relationship, the only concern is:
which link(s) is needed or should be erase....
because the Spprice PK (cust_id, itemkey) can match to many tables!!
such as:
Customer.cust_id
Order.cust_id
Orderline.itemkey
item.itemkey

To make it firm on selecting row, both cust_id and itemkey should be joined!!
Thus, the cyclic relationship will appear!! ~~'.'~~
Please give advise on above joining...

Thanks a lot. I need to think a lot on ERD....
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform