210 likes | 224 Views
Create an information system for online sales of movies in DVD and videotape format. Customers can register, update their information, purchase videos, and receive receipts by email.
E N D
Example • BigHit Video Inc. wants to create an information system for online sales of movies in both DVD and videotape format. People will be allowed to register as customers of the online site and to update their stored information. Information must be maintained about customers’ shipping addresses, e-mail addresses and credit cards. In a single sale, customers will be allowed to purchase any quantity of videos. The items in a single sale will be shipped to a single address and will have a single credit card charge. • A customer will be provided with a virtual shopping cart to store items to be purchased. As each item is selected, it is added to the shopping cart. When the customer finishes shopping, he will be directed to a checkout area where payment and shipping information is entered. Once the sale is complete, the customer will be sent a receipt by e-mail.
Example Entities:Customer (key: account , last name, first name, address, email, credit card, password)Movie (key: id, title, genre, length) Sale (key: id, cost, date, credit card)Shopping Cart (key: id, date)
Data Modeling with E-R Diagram • An Entity-Relationship (E-R) model is a high-level conceptual model • E-R models are best described using graphical diagrams • This model provides designers with an accurate and useful model that avoids confusion and is understandable by users
E-R model • An E-R model includes • Entity classes • Attributes of each class • Relationship types between classes • Constraints • Types of attributes • Designation of key attributes • Cardinalities of relationship types • An E-R Model is typically represented graphically using an E-R diagram
E-R model • E-R models cannot describe everything in the real-world application • Not all information about the attributes appears in the E-R diagram. Most of the information is maintained in the data dictionary • The process of designing the E-R diagram is iterative
E-R Diagrams: Entity Classes • Entity classes are represented by rectangleswith the name inside • Attributes are represented by ovals. • key attributes are underlined • Multi-valued attributes are double-lined • Derived attributes are dashed
E-R diagrams: Relationships • A relationship is represented by a rhombus (diamond) with the name inside • The name of a relationship is a verb describing it • Additional symbols of a relationship: • Cardinality • Optional/mandatory participation • Attributes of a relationship
Modeling relations as entity classes • A relationship can be modeled as an entity class
Modeling relations as entity classes • Note cardinalities and participation constraints • A Rental entity cannot exist without being related to both a customer and a video • Problem occurs because Rental has no key attribute
Weak and Strong entities • A weak entity class is • An entity class with no key of its own • An entity class whose entities cannot exist without being related to other entities • An identifying relationship type is • A relationship type that determines the keys of the weak entities
More on Weak Entities and Relations • An entity that is identified by its relationship to other entities is called a weak entity and its class a weak entity class Ssn Name EMPLOYEE 111111 1 DEPENDENTS_OF N DEPENDENT Name Relation Bdate
More on Weak Entities and Relations • The stronger entity class is called the identifying or owner entity class • The relationship that relates the weak entity class to its owner is called: identifyingrelationship • A partial key of a weak entity is a set of attributes that uniquely identifies weak entities related to the same owner entity
Example Entities:Customer (key: account , last name, first name, address, email, credit card, password)Movie (key: id, title, genre, length) Sale (key: id, cost, date, credit card)Shopping Cart (key: id, date)