Problem

Figure 2-28 shows two diagrams (A and B), both of which are legitimate ways to represent...

Figure 2-28 shows two diagrams (A and B), both of which are legitimate ways to represent that a stock has a history of many prices. Which of the two diagrams do you consider a better way to model this situation and why?

Step-by-Step Solution

Solution 1

Better Entity-Relationship (E-R) diagram for Stock Price Situation

The one type of diagrammatic representation for stock price situation is shown below:

C:\Users\300889\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\XNEWY8E1\10943-2-14PE_fig1.jpg

Diagram A

Explanation:

In the above E-R diagram:

• The “STOCK” is an entity type.

• The entity contains the identifier of “Stock ID”.

• The entity contains the multivalued attribute of “Price History” and composite attributes of “Price” and “Effective Date”.

Another type of diagrammatic representation for stock price situation is shown below:

C:\Users\300889\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\XNEWY8E1\10943-2-14PE_fig2.jpg

Diagram B

Explanation:

In the above E-R diagram:

• The “STOCK” is an entity type and the “STOCK PRICE” is a weak entity type.

• The STOCK entity contains the identifier of “Stock ID”.

• The STOCK PRICE entity contains the attributes of “Price” and “Effective Date”.

• The cardinality relationship between the entity STOCK and weak entity STOCK PRICE is mandatory one to mandatory many and it has a weak relationship.

Best Entity-Relationship (E-R) diagram from solution A and solution B:

The better E-R diagram is usually chosen by how the diagram reaches the end users to refer it for their own concept.

• If the organization, the end users have the stock price term then the Diagram B is the better way for modelling this situation.

• This is because,

o The Diagram B expands itself as a two entity types with a relationship between them such as STOCK and STOCK PRICE.

o This will makes the instructors to easily understand the demonstration of an issue.

• But, the Diagram A needs for discussion with end users to get the clear ideas about the attributes present in the STOCK entity.

• In the Diagram B ,

o STOCK PRICE entity instances are added.

o The STOCK PRICE will be occurred for each STOCK entity instances.

o The weak entity is STOCK PRICE that depends on the STOCK entity instance.

Therefore, the “Diagram B” is a best way to model the Entity-Relationship diagram for stock price situation.

Add your Solution
Textbook Solutions and Answers Search