An Image/Link below is provided (as is) to download presentation
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.Content is provided to you AS IS for your information and personal use only.Download presentation by click this link.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.During download, if you can't get a presentation, the file might be deleted by the publisher.
Requirement Formation& Analysis • Purpose: identify and describe the data that are required by the organization • Inputs: user information requirements, data items(attributes), data association, processing requirements (reports frequencies, response time requirements, etc.) • Outputs: a set of requirements specifications for conceptual design
Conceptual Design • Purpose: synthesize the various user views and information requirements into a global database design. • The result is a conceptual schema in ERD or normalized telations
Implementation Design • Purpose: map the conceptual data model into logical schema that can be processed by a particular DBMS. • Conceptual model is mapped into hierarchical, network or relational data model. • Schemas & subschemas are developed using DDL
Steps in Requirements Analysis • Identifying & documenting what data user requires • Study the data flows&decision-making process, particularly answering the following questions: • User views? • Data elements (attributes) required in the views? • Primary keys? • Relationships among data elements? • Operational requirements such as security, integrity & response time?
Identify user views • Identify the user views in the application • Used for logical database design
User views • A user view is a subset of data required by a particular user to make a decision or carry out some action, can be derived from • Reports, displays, files • Determine semantic rules • Standard form for recording information about user views
Build a data dictionary • Each data item type that appears in a user view must be defined and described in details. • Standard form can be used.
Identify data volume and usage • Data volumes and usage pattern is required for physical database design • It is done after the conceptual model has been completed
Identify operational requirements • Security • Integrity • Response time • Back & recovery • Archiving-how long must data be retained? In what form?
Normalization • Normalization provides a foundation for logical database design • Normalization can be used to reduce complex user views to a set of small, stable conceptual schema
User views Unnormalized relations Remove repeating groups Normalized relations (1NF) Remove partial dependency Second normal form(2NF) relations Remove transitive dependency Third normal form(3NF) relations
Student# Student name Major Course# Course Title Instructor name Instructor Location grade 38214 Bright IS IS 350 IS 465 database sys anal CODD KEMP B104 B213 A C 69173 Smith PM IS 465 PM 300 QM 440 sys anal prod mgt op res B213 D317 B213 A B C … KEMP LEWIS KEMP Example of unnormalized relation
Normalized relation(1NF) • 中每一個列與行的交會處只能放一個single value . 亦即每一個attribute只能有一個single value • Atomic attribute • 又叫做1NF的表格
Normalization • 經由Normalization的分析,可以由一堆views之中整理出一個conceptual data model (schema), 此conceptual schema 能完整(completely),簡單地(simply)支持 所有的user views.
Problems in STUDENT-COURSE • Data redundancy---IS 465 • Insertion anomaly---insert a new course e.g., BA200, INTR DP, • We cannot do this unless one student registers in BA200 • Deletion anomaly---課程若只有一個人修,若該學生退選,則delete該tuple會導致資訊遺失 • 例如,delete student#=69173修Prod mgt,會遺失Lewis教Prod mgt的訊息。 • Update anomaly---改IS465的課名為sys anal&Des,必須修改全部有關的tuple以免造成不一致。
Reasons for anomaly • Some attributes do not fully depend on the primary key STUDENT-COURSE表格的primary key為 (STUDENT#, COURSE#) COURSE#→ COURSE-TITLE, INSTRUCTOR-NAME, INSTRUCTOR-LOCATION • 我們說COURSE-TITLE,INSTRUCTOR-NAME , INSTRUCTOR-LOCATION partially dependent(部份相關)on the primary key .
Functional dependency(FD) • 正規化是在分析函數相依關係(Functional dependency),因此介紹函數相依關係 • 定義:Given a relation R , attribute Y of R is functionally dependent on attribute X of R if and only if each X-value in R has associated with it precisely one Y-value in R (at any time) • 函數相依關係是一種語意規則,不能以某一時間表格的內容論定
Functional dependency X Y R y1 y1 x1 x2 X determines Y Y functional dependent on X X→Y X 與Y 的關係為多對一
第二正規化(2NF) • 定義:A relation is said to be in 2NF , if it is already 1NF , and all non-key attributes are all fully dependent on the primary key • 正規化的方法:將partially dependent 的attributes分到另外一個表格中
FD in COURSE-INSTRUCTOR COURSE# COURSE TITLE INSTRUCTOR NAME INSTRUCTOR LOCATION Transitive dependency
Primary key A B Transitive dependency • A transitive dependency occurs when one non-key attribute is dependent on one or more non-key attributes Transitive dependency } Primary key →A A→B Primary key→B
3NF • A relation is in 3NF, if it is already in 2NF and no transitive dependency exists. 3NF的FD型態 … Primary key Attribute2 Attribute1 Attribute n Each non-key attribute is fully dependent on the primary key and there is no transitive dependency.
3NF的正規化 • Conversion of a relation to third normal form (3NF) by removing transitive functional dependency (FD) COURSE-INSTRUCTOR COURSE INSTRUCTOR 3NF 3NF