Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Desing Database Systems. 2 Hierarchy database The structure of data is like a tree Parent-children relationship Pointers Central depot West depotEast.

Similar presentations


Presentation on theme: "1 Desing Database Systems. 2 Hierarchy database The structure of data is like a tree Parent-children relationship Pointers Central depot West depotEast."— Presentation transcript:

1 1 Desing Database Systems

2 2 Hierarchy database The structure of data is like a tree Parent-children relationship Pointers Central depot West depotEast depot GyőrPécsSzegedDebrecen

3 3 Net database Dairy collection Centre Area of FótArea of Tata Kiss János Nagy Béla Tóth Elek The data are connected to each other like a ring, and these rings are the net model. (graph)

4 4 Relations database You use databases to organize and relate tables You use databases to organize and relate tables Databases provide the architecture for storing your data and have additional benefits as well. Databases provide the architecture for storing your data and have additional benefits as well. More details in the next lecture More details in the next lecture

5 5 Goals of the database design process: understand your data and why you’re tracking it understand your data and why you’re tracking it eliminate duplication of data eliminate duplication of data eliminate redundant data eliminate redundant data eliminate meaningless data or data we don’t care about eliminate meaningless data or data we don’t care about promote accuracy of data promote accuracy of data promote consistency of data promote consistency of data make sure we can retrieve the information we need from the database make sure we can retrieve the information we need from the database support the business functions that use the database support the business functions that use the database build a database that lends itself to future growth build a database that lends itself to future growth

6 6 Entity Relationship Diagrams (ERD) What is an ERD? What is an ERD? An entity-relationship diagram is a data modeling technique that creates a graphical representation of the entities, and the relationships between entities, within an information system. data modelingdata modeling

7 7 Base Feaures of the ERD Simple, visual, graphical device Simple, visual, graphical device The models most important parts are the entities and the relationships The models most important parts are the entities and the relationships It is built from the attributes of the entities It is built from the attributes of the entities

8 8 Entity An An entity is an object or concept about which you want to store information.

9 9 The common description of the entity is a rectangle, which contains the name of the entity: Owner Dog Description of the Entities

10 10 Type of the Entities Entity An entity is an object or concept about which you want to store information Weak Entity A weak entity is dependent on another entity to exist.

11 11 Attributes Attributes Attributes are the properties or characteristics of an entity.

12 12 We can describe the attributes of the entity with a connecting ellipse: Person Name Date of birth Place of birth Sex Description of the Attributes

13 13 Types of the Attributes Attributes Attributes are the properties or characteristics of an entity. Attributes Attributes are the properties or characteristics of an entity. Key attribute A key attribute is the unique, distinguishing characteristic of the entity. For example, an employee's social security number might be the employee's key attribute. Key attribute A key attribute is the unique, distinguishing characteristic of the entity. For example, an employee's social security number might be the employee's key attribute.

14 14 Types of the Attributes A multivalued attribute can have more than one value. For example, an employee entity can have multiple skill values. A multivalued attribute can have more than one value. For example, an employee entity can have multiple skill values. Derived attribute A derived attribute is based on another attribute. For example, an employee's monthly salary is based on the employee's annual salary. Derived attribute A derived attribute is based on another attribute. For example, an employee's monthly salary is based on the employee's annual salary.

15 15

16 16 Relationships Relationships Relationships illustrate how two entities share information in the database structure.

17 17 We can describe the relationship of the entity with a rhombus. We can mark the type of the relationship as well. Man Dog has 1N If an entity takes part in a connection only partly, we describe it with single line, (Not all men have dogs), if it takes part totally we describe it with a bold line. ( We don’t respect the stray dogs) Description of the Relationships

18 18 Types of the Relationship Relationships Relationships illustrate how two entities share information in the database structure. Relationships Relationships illustrate how two entities share information in the database structure. Weak relationship To connect a weak entity with others, you should use a weak relationship notation. Weak relationship To connect a weak entity with others, you should use a weak relationship notation.

19 19 Cardinality Cardinality specifies how many instances of an entity relate to one instance of another entity.

20 20 Cardinality »1:1(wife-husband) »1: N(mother-children) »N:M(grandparents-grandchildren)

21 21 Examples - Relationship 1 Department may employ Many Employees 1 Employee only has one department Department Employees Employs 1N The diagram changes according to your real situation. Department Employees Employs MN You may also allow 1 Employee to work for Many Departments

22 22 Participation »Total participation Every child has a mother Every child has a mother »Partial participation Not every woman has a child Not every woman has a child

23 23 Example - Participation Every department must have at least one employee. An employee need not work for any department. Indicate partial participation by using Department Employees Employs 1N

24 24 Recursive relationship In some cases, entities can be self-linked. For example, employees can supervise other employees. Recursive relationship In some cases, entities can be self-linked. For example, employees can supervise other employees.

25 25 Students Courses ID LName FNameAddress CNumCName Description Relationship Take Entity Attributes

26 26 Simplified car selling model Car Type Years Price buy 1 Customer Address Name Driving licence N

27 27 Data Problems:- don’t give back the relationships - repeating data… We have to study….

28 28 buy 1 Car Type Years N Price sell 1 Extension of the model Customer Name Address Selling Customer Car N Date Driving licence


Download ppt "1 Desing Database Systems. 2 Hierarchy database The structure of data is like a tree Parent-children relationship Pointers Central depot West depotEast."

Similar presentations


Ads by Google