Database Systems - Part 3 & 4
lượt xem 9
download
A data model is an integrated collection of concepts for describing and manipulating data, relationships between data, and constraints on the data in an organization. • A model is a representation of “real world” objects and events, and their associations. It is an abstraction that concentrates on the essential, inherent aspects of an organization and ignores accidental properties. • A data model must provide the basic concepts and notations that will allow database designers and end-users unambiguously and accurately to communicate their understanding of the organizational data....
Bình luận(0) Đăng nhập để gửi bình luận!
Nội dung Text: Database Systems - Part 3 & 4
- COP 4710: Database Systems Spring 2004 Introduction to Data Modeling BÀI 3&4, 2 ngày Instructor : Mark Llewellyn markl@cs.ucf.edu CC1 211, 823-2790 http://www.cs.ucf.edu/courses/cop4710/spr2004 School of Electrical Engineering and Computer Science University of Central Florida COP 4710: Database Systems (Day 4) Page 1 Mark Llewellyn
- Data Models • A data model is an integrated collection of concepts for describing and manipulating data, relationships between data, and constraints on the data in an organization. • A model is a representation of “real world” objects and events, and their associations. It is an abstraction that concentrates on the essential, inherent aspects of an organization and ignores accidental properties. • A data model must provide the basic concepts and notations that will allow database designers and end-users unambiguously and accurately to communicate their understanding of the organizational data. COP 4710: Database Systems (Day 4) Page 2 Mark Llewellyn
- Data Models (cont.) • A data model can be thought of as comprising three components: 1. A structural part, consisting of a set of rules according to which databases can be constructed. 2. A manipulative part, defining the types of operations that are allowed on the data (this includes operations that are used for updating or retrieving data from the database and for changing the structure of the database). 3. Possibly a set of integrity rules, which ensures that the data is accurate. COP 4710: Database Systems (Day 4) Page 3 Mark Llewellyn
- Data Models (cont.) • Looking at the three level architecture, we can identify three different, related data models. 1. An external data model to represent each user’s view of the organization. 2. A conceptual data model to represent the logical (or community view) that is DBMS independent. 3. An internal data model to represent the conceptual schema in such a way that it can be understood by the DBMS. COP 4710: Database Systems (Day 4) Page 4 Mark Llewellyn
- Data Models (cont.) • There have been many different data models which have been theorized, utilized, developed, and implemented over the years. They fall into three broad categories: object-based, record- based, and physical. • There are three principle record-based models: the relational data model, the network data model, and the hierarchical data model. Our focus will be on the relational data model in this course. COP 4710: Database Systems (Day 4) Page 5 Mark Llewellyn
- Introduction to Data Modeling • Semantic data models attempt to capture the “meaning” of a database. Practically, they provide an approach for conceptual data modeling. • Over the years there have been several different semantic data models that have been proposed. • By far the most common is the entity-relationship data model, most often referred to as simply the E-R data model. • The E-R model is often used as a form of communication between database designers and the end users during the developmental stages of a database. COP 4710: Database Systems (Day 4) Page 6 Mark Llewellyn
- Introduction to Data Modeling (cont.) • The E-R model contains an extensive set of modeling tools, some of which we will not be concerned with as our primary objective is to give you some insight into conceptual database design and not learning all of the ins and outs of the E-R model. • Another conceptual modeling which is becoming more common is the Object Definition Language (ODL) which is an object-oriented approach to database design that is emerging as a standard for object-oriented database systems. COP 4710: Database Systems (Day 4) Page 7 Mark Llewellyn
- Introduction to Data Modeling (cont.) • The database design process can be divided into six basic steps. Semantic data models are most relevant to only the first three of these steps. 1. Requirements Analysis: The first step in designing a database application is to understand what data is to be stored in the database, what applications must be built on top of it, and what operations are most frequent and subject to performance requirements. Often this is an informal process involving discussions with user groups and studying the current environment. Examining existing applications expected to be replaced or complemented by the database system. COP 4710: Database Systems (Day 4) Page 8 Mark Llewellyn
- Introduction to Data Modeling (cont.) 2. Conceptual Database Design: The information gathered in the requirements analysis step is used to develop a high- level description of the data to be stored in the database, along with the constraints that are known to hold on this data. 3. Logical Database Design: A DBMS must be selected to implement the database and to convert the conceptual database design into a database schema within the data model of the chosen DBMS. COP 4710: Database Systems (Day 4) Page 9 Mark Llewellyn
- Introduction to Data Modeling (cont.) 4. Schema Refinement: In this step the schemas developed in step 3 above are analyzed for potential problems. It is in this step that the database is normalized. Normalization of a database is based upon some elegant and powerful mathematical theory. We will discuss normalization later in the term. 5. Physical Database Design: At this stage in the design of a database, potential workloads and access patterns are simulated to identify potential weaknesses in the conceptual database. This will often cause the creation of additional indices and/or clustering relations. In critical situations, the entire conceptual model will need restructuring. COP 4710: Database Systems (Day 4) Page 10 Mark Llewellyn
- Introduction to Data Modeling (cont.) 6. Security Design: Different user groups are identified and their different roles are analyzed so that access patterns to the data can be defined. • There is often a seventh step in this process with the last step being a tuning phase, during which the database is made operational (although it may be through a simulation) and further refinements are made as the system is “tweaked” to provide the expected environment. • The illustration on the following page summarizes the main phases of database design. COP 4710: Database Systems (Day 4) Page 11 Mark Llewellyn
- Introduction to Data Modeling (cont.) COP 4710: Database Systems (Day 4) Page 12 Mark Llewellyn
- The Entity-Relationship Model • The E-R model employs three basic notions: entity sets, relationship sets, and attributes. • An entity is a “thing” or “object” in the real world that is distinguishable from all other objects. An entity may be either concrete, such as a person or a book, or it may be abstract, such as a bank loan, or a holiday, or a concept. • An entity is represented by a set of attributes. Attributes are descriptive properties or characteristics possessed by an entity. • An entity set is a set of entities of the same type that share the same attributes. For example, the set of all persons who are customers at a particular bank can be defined as the entity set customers. COP 4710: Database Systems (Day 4) Page 13 Mark Llewellyn
- The Entity-Relationship Model (cont.) • Entity sets do not need to be disjoint. For example, we could define the entity set of all persons who work for a bank (employee) and the entity set of all persons who are customers of the bank (customers). A given person entity might be an employee, a customer, both, or neither. • For each attribute, there is a permitted set of values, called the domain (sometimes called the value set), of that attribute. More formally, an attribute of an entity set is a function that maps from the entity set into a domain. Since an entity set may have several attributes, each entity in the set can be described by a set of pairs, one for each attribute of the entity set. • A database contains a collection of entity sets. COP 4710: Database Systems (Day 4) Page 14 Mark Llewellyn
- E-R Model Notation E entity set a attribute weak entity set a multi-valued attribute E a derived attribute R relationship identifying relationship total participation of R E R for a weak entity set entity set in relationship att primary key partial participation of R E entity set in relationship COP 4710: Database Systems (Day 4) Page 15 Mark Llewellyn
- E-R Model Notation (cont.) discriminating attribute of attribute weak entity set a E1 R 1:1 cardinality from E1 to E2 E2 E1 R E2 1:M cardinality from E1 to E2 E1 1 M E2 alternate form for 1:M cardinality from E1 to E2 R E1 R E2 M:1 cardinality from E1 to E2 E1 R E2 M:M cardinality from E1 to E2 E1 N M E2 alternate form for M:M cardinality from E1 to E2 R COP 4710: Database Systems (Day 4) Page 16 Mark Llewellyn
- E-R Model Notation (cont.) ISA ISA (specialization or generalization)(partial participation) DisjointISA (specialization or generalization) ISA disjoint ISA Total generalization COP 4710: Database Systems (Day 4) Page 17 Mark Llewellyn
- E-R Model Notation (cont.) E3 Aggregation: box drawn around relationship which is treated as an entity E1 R E2 1 R 2 (min,max) R E2 E4 Structural constraint: (min,max) on the participation of an entity in a relationship COP 4710: Database Systems (Day 4) Page 18 Mark Llewellyn
- Example E-R Diagram (ERD) customer-street customer-name customer-city amount customer-id customer-id customer borrower loan COP 4710: Database Systems (Day 4) Page 19 Mark Llewellyn
- Another Example ERD street-name middle-name street-num apartment-num first-name last-name customer-name street city customer-id state address customer zipcode phone-num age date-of-birth COP 4710: Database Systems (Day 4) Page 20 Mark Llewellyn
CÓ THỂ BẠN MUỐN DOWNLOAD
Chịu trách nhiệm nội dung:
Nguyễn Công Hà - Giám đốc Công ty TNHH TÀI LIỆU TRỰC TUYẾN VI NA
LIÊN HỆ
Địa chỉ: P402, 54A Nơ Trang Long, Phường 14, Q.Bình Thạnh, TP.HCM
Hotline: 093 303 0098
Email: support@tailieu.vn