View Single Post
  #1 (permalink)  
Old 02-29-04, 18:06
kram66 kram66 is offline
Registered User
 
Join Date: Feb 2004
Posts: 86
Entity Relationship Diagram

I need to draw a single Entity Relationship Diagram (ERD) to represent the following situation, which is described by means of text and a relational data model.


Situation
A relational database has been designed for a company which sells merchandise through magazine advertising. Customers who want to place an order call a toll-free telephone number and place an order for the items that they require. This order is entered through an on-line terminal and is later filled and shipped by the stock room. The customer may pay for the purchase by credit card or pay ‘collect’ (that is, they pay at the time the goods are delivered).
Each table is described below, with the primary key underlined and foreign keys defined.


Table structure:

CUSTOMER
customer_number (PK)
name
address
phone_number
credit_rating

ORDER
order_no (PK)
customer_number (FK)
order_date
shipping_address
credit_card_type
credit_card_number
foreign key (customer_number) references Customer


ITEM
stock_no (PK)
description
weight
colour
unit_price

ORDERED_ITEM
order_no (PK)
stock_no (FK)
quanity_required
unit_price
foreign key (order_no) references Order
foreign key (stock_no) references item

MAGAZINE
magazine_code (PK)
name
address
phone_number

EDITION
magazine_code (PK, FK)
issue_date
foreign key (magazine_code) references magazine

ADVERTISED_ITEM
magazine_code (PK, FK)
issue_date (FK)
stock_no (FK)
page_no
advertised_price
foreign key (stock_no) references Item
foreign key (Magazine_code, Issue_date) references Edition
Reply With Quote