-------------------------------------------------
Top of Form
Bottom of Form
Database Design
Goal of design is to generate a formal specification of the database schema
Methodology:
1. Use E-R model to get a high-level graphical view of essential components of enterprise and how they are related 2. Then convert E-R diagram to SQL DDL, or whatever database model you are using
E-R Model is not SQL based. It 's not limited to any particular DBMS. It is a conceptual and semantic model – captures meanings rather than an actual implementation
The E-R Model: The enterprise is viewed as set of * Entities * Relationships among entities
Symbols used in E-R Diagram * Entity – rectangle * Attribute – oval * Relationship – diamond * Link - line
Entities and Attributes
Entity: an object that is involved in the enterprise and that be distinguished from other objects. (not shown in the ER diagram--is an instance) * Can be person, place, event, object, concept in the real world * Can be physical object or abstraction * Ex: "John", "CSE305"
Entity Type: set of similar objects or a category of entities; they are well defined * A rectangle represents an entity set * Ex: students, courses * We often just say "entity" and mean "entity type"
Attribute: describes one aspect of an entity type; usually [and best when] single valued and indivisible (atomic) * Represented by oval on E-R diagram * Ex: name, maximum enrollment * May be multi-valued – use double oval on E-R diagram * May be composite – attribute has further structure; also use oval for composite attribute, with ovals for components connected to it by lines * May be derived – a virtual attribute, one that is computable from existing data in the database, use dashed oval. This helps reduce redundancy
Entity Types
An entity type is named and is described by set of attributes * Student: