Presentation is loading. Please wait.

Presentation is loading. Please wait.

ER MODEL Lecture 3.

Similar presentations


Presentation on theme: "ER MODEL Lecture 3."— Presentation transcript:

1 ER MODEL Lecture 3

2 ENTITY Entity is a thing in the real world with an independent existence Physical existence: person, car, house or employee Conceptual existence: company, job or university

3 Attributes Each entity has attributes—the particular properties that describe it. For example, an EMPLOYEE entity may be described by the employee’s name, age, address, salary, and job.

4 Symbol

5 SAMPLE

6 ER MODEL

7 Composite Attributes Attributes that is divided into subpart or sub attributes Attributes are not dividable are called atomic or simple attribute

8

9 ER Diagram An Entity Relationship Diagram (ERD) is a visual representation of different data using conventions that describe how these data are related to each other. For example, the elements writer, novel, and consumer may be described using ER diagrams this way:

10 An inventory software used in a retail shop will have a database that monitors elements such as purchases, item, item type, item source and item price. Rendering this information through an ER diagram would be something like this:

11 HISTORY Entity-Relationship model initially proposed by Peter Chen in 1976 to create a uniform convention that considers both relational database and network views. Chen envisioned the ER model as a conceptual modeling approach that views real world data as systems of entities and relationships. Entities are data objects that maintain different relationships with each other.

12

13 Weak Entity A weak entity is an entity that depends on the existence of another entity. In more technical terms it can defined as an entity that cannot be identified by its own attributes. It uses a foreign key combined with its attributed to form the primary key. An entity like order item is  a good example for this. The order item will be meaningless without an order so it depends on the existence of order.

14 Composite Attribute Attributes can also have their own specific attributes

15 Multivalued Attribute
If an attribute can have more than one value it is called an multivalve attribute. It is important to note that this is different to an attribute having its own attributes. For example a teacher entity can have multiple subject values.

16 Derived Attribute An attribute based on another attribute. This is found rarely in ER diagrams. For example for a circle the area can be derived from the radius.

17

18

19 Recursive Relationships

20 Cardinality Ratios for Binary Relationship
At any point in time—an employee can manage one department only and a department can have one manager only

21 N:1 Relationship N 1

22 M:N Relationship An employee can work on several projects and a project can have several employees.

23 Participation constraint
The participation constraint specifies whether the existence of an entity depends on its being related to another entity via the relationship type There are two types of participation constraints—total and partial If a company policy states that every employee must work for a department, then an employee entity can exist only if it participates in at least one WORKS_FOR relationship instance. Thus, the participation of EMPLOYEE in WORKS_FOR is called total participation, meaning that every entity in the total set of employee entities must be related to a department entity via WORKS_FOR… displayed as a double line We do not expect every employee to manage a department, so the participation of EMPLOYEE in the MANAGES relationship type is partial, meaning that some or part of the set of employee entities are related to some department entity via MANAGES, but not necessarily all

24 recursive relationships

25

26

27

28 Requirement "The system will manage author's and loaner's information, and keep track of books loaned. The borrower's information include name, address, , and phone. The author's information include name, address and . New books, authors and clients are entered into the system. When a client checks out a book, the system will register the date the book was loaned and calculate the days the book can be loaned. It will also calculate the date the book is due to be returned. If the borrower returns the book late, he must pay a fine based on the number of days overdue."

29 Requirement "I would like my customers to be able to browse my catalog of books and place orders over the Internet. Currently, I take orders over the phone. I have mostly corporate customers who call me and give me the ISBN number of a book and a quantity; they often pay by credit card. I then prepare a shipment that contains the books they ordered. If I don't have enough copies in stock, I order additional copies and delay the shipment until the new copies arrive; I want to ship a customer's entire order together. My catalog includes all the books I sell. For each book, the catalog contains its ISBN number, title, author, purcha.se price, sales price, and the year the book was published. Most of my customers are regulars, and I have records with their names and addresses. New customers have to call me first and establish an account before they can use my website. On my new website, customers should first identify themselves by their unique customer identification number. Then they should be able to browse my catalog and to place orders online."


Download ppt "ER MODEL Lecture 3."

Similar presentations


Ads by Google