pert4-5 database design

Upload: noraq

Post on 30-May-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Pert4-5 Database Design

    1/28

    Database DesignSession 4 and 5

    Matakuliah : Web Database

    Tahun : 2008

  • 8/9/2019 Pert4-5 Database Design

    2/28

    2

    Last Session Review:

    Web Basic ConceptHow to put information on WebDynamic Web pages

    New Development of Web

  • 8/9/2019 Pert4-5 Database Design

    3/28

    3

    Agenda:Conventional Database DesignMethodRequirements AnalysisData AnalysisData Design

    Physical Database Design

  • 8/9/2019 Pert4-5 Database Design

    4/28

    4

    Objectives:Student understand ConventionalDatabase Design MethodStudent can do RequirementsAnalysis, Data Analysis, Data Designand Physical Database Design

    Student can design conceptualdata model and ERD

  • 8/9/2019 Pert4-5 Database Design

    5/28

    5

    Conventional Database Design Method

    What is Database Design?

    Process of creating a design for a database that will support theenterprises operations and objectives

    Major Aims for Database Design?

    Represent data and relationship between data required by allmajor application area and users groups

    Provide data model that support any transactions required onthe data

    Specify a minimum design that is appropriately structured toachieve stated performance requirements for the system

    Two main approaches in Database Design?

    Entity Relationship Diagram (ERD), for Relational Database

    UML, for Object Data Modeling

  • 8/9/2019 Pert4-5 Database Design

    6/28

    6

    Conventional Database Design Method

    (cont.)

  • 8/9/2019 Pert4-5 Database Design

    7/287

    Conventional Database Design Method

    (cont.) Steps in Database Design Method? Requirements Analysis

    Data Analysis

    Data Design

    Physical Database Design

    Input in Database Design Method? The Organization: serve as sponsor of new system

    Output in Database Design Method?

    Description of the Organization and System Requirements

    Conceptual Data Model

    Logical Data Model

    Physical Data Model

  • 8/9/2019 Pert4-5 Database Design

    8/288

    Requirements Analysis

    What is Requirements Analysis?

    The process of collecting and analyzing information about thepart of the organization that is to be supported by thedatabase system, and using this information to identify therequirement for the new system

    Technique to do Requirement Analysis?

    Observation

    Interview

    Inspecting Documents

    Surveying Experts Using Other Information

    Output from Requirements Analysis?

    Description of the organization and system requirements

  • 8/9/2019 Pert4-5 Database Design

    9/289

    Requirements Analysis (cont.)

    Study Case Requirements Analysis

    Assume that you are developing a database

    system for your enterprise, whether it is auniversity (or college) or business (ordepartment). Consider what technique you woulduse to identify the important facts needed todevelop a database system.

  • 8/9/2019 Pert4-5 Database Design

    10/2810

    Data Analysis

    What is Data Analysis? The process of describing the organization in terms of

    the phenomena that must be represented within thedatabase.

    How to do Data Analysis?

    There are 2 approach: Top-Down

    Bottom-Up

    Output from Data Analysis? Conceptual Data Model

  • 8/9/2019 Pert4-5 Database Design

    11/2811

    Data Analysis (cont.) 3 Component in Database:

    Entity

    should be unique and has name. Represent objects or things inreal world that has independent existence.

    Example: Student Entity

    Representation:Or

    Relationship

    connection between one entity with another.

    Example: Relationship between student entity and faculty entity Representation:

    Or

    x

  • 8/9/2019 Pert4-5 Database Design

    12/2812

    Data Analysis (cont.)

    3 Component in Database: Attribute

    Fact-fact that describe entity or relationship

    Example: Nim and Name attribute in Entity

    Representation:

    Or

  • 8/9/2019 Pert4-5 Database Design

    13/2813

    Data Analysis (cont.)

    2 Approach of Data Analysis that are commonly used?

    Top-Down

    Top-down=entity-relationship-attribute data analysis

    How:

    Identify entities: usually represent the real world

    Identify relationships between entities: identify direct relationship only

    Identify entities attributes: fact about entities that must represent indatabase

    Advantages:

    Represent real world

    Filter out entities, relationships and attributes that do not make sense

    or not useful within the context of problem

    Appropriate for complex database with many attributes

    Disadvantages:

    Often result in a simpler conceptual model

  • 8/9/2019 Pert4-5 Database Design

    14/28

    14

    Data Analysis (cont.)

    2 Approach of Data Analysis that are commonly used?

    Top-Down

    Example:

    University has students and faculty.

    Create Students and Faculty entity.

    Students and Faculty has direct relationship, which is: Students chooseFaculty. Choose is relationship.

    Students has nim, name, address, place of birth and date of birth, whileFaculty has faculty code, faculty name and dean. Those are the attributes.

  • 8/9/2019 Pert4-5 Database Design

    15/28

    15

    Data Analysis (cont.) 2 Approach of Data Analysis that are commonly used?

    Bottom-Up Bottom-Up=attribute-relationship-entity data analysis

    Based on the notion that entities are implicit in the data values

    How:

    Identify data item (attribute): identified from fields on data recordingform or contents of organizations files and records

    Identify relationships between data items: identify connectionbetween one data item with the others

    Identify entities: deducted from the attributes and relationshipsidentified in step 1 and 2

    Advantages: Appropriate for simple database design

    Give attention on detail attributes

    Disadvantages: Hard to use in complex database design

  • 8/9/2019 Pert4-5 Database Design

    16/28

    16

    Data Analysis (cont.) 2 Approach of Data Analysis that are commonly used?

    Bottom-Up

    Example:

    University has student data form.

    In that form, there are several field that can be filled. Those fields are: nim,name, address, place of birth, date of birth, faculty code, faculty name and

    dean. Those are the attributes.

    Find relationship between those data items. Nim, name, address, place ofbirth and date of birth are describing one entity and faculty code, name anddean are describing one entity.

    Separate those attributes and relationships into entities Students and Facultyentities.

  • 8/9/2019 Pert4-5 Database Design

    17/28

    17

    Data Analysis (cont.)

    2 Approach of Data Analysis that are commonlyused? Those 2 approach can be combine, depend on the

    situations and needs.

    Other Approach: Inside-Out: related to the bottom-up approach but differ by

    the first identifying a set of major entities and thenspreading out to consider other entities, relationships andattributes associated with those first identified

  • 8/9/2019 Pert4-5 Database Design

    18/28

    18

    Data Analysis (cont.)

    Type of Relationships between entities? One-to-one

    One-to-many

    Many-to-many

    Zero-or-one-to-many

    Model composite key and generalization/specification

  • 8/9/2019 Pert4-5 Database Design

    19/28

    19

    Data Analysis (cont.) Case Study for Data Analysis

    Consider the following statement and use both top-down andbottom-up technique:

    Students attending Honley University enroll on courses.There are prerequisites for enrollment, i.e. the student musthave certain qualifications, or be accepted by Dr. Brown theadmissions tutor. The institute currently has 3000 students

    enrolled. Once enrolled, the student will accumulate creditsby taking various course modules, such as Programming andObject Database. A grade is awarded for each completedmodules. The grade will be A, B, C, D or E. A representsdistinction, and E a fail. Students may be full time or parttime.

  • 8/9/2019 Pert4-5 Database Design

    20/28

    20

    Data Design

    What is a Data Design? The process of defining a logical data model that

    implements the conceptual model as a database

    Input Data Design? Conceptual data model

    How to do Data Design? Transform conceptual data model into a relational

    database by applying several rules

    Normalization

    Output from Data Design? ERD Normal

  • 8/9/2019 Pert4-5 Database Design

    21/28

    21

    Data Design (cont.) Rules to transform?

    Representation of Entities

    Each entity in the Conceptual data model becomes a table. Eachproperty become attribute. A primary key is selected

    One-to-one

    Transform into 1 table

    One-to-many

    Transform into 2 tables

    Primary key in one (parent or owner) table migrates to many(child or member) table (become foreign key). Each row in many

    table many cross-reference a row in the one table. Many-to-many

    Replaced by two one-to-many relationships

    Zero-or-one-to-many

    Represented by a separate table, in the same way that one-to-many relationships are

  • 8/9/2019 Pert4-5 Database Design

    22/28

    22

    Data Design (cont.)

    Normalization? First Normal Form (1NF):

    simplifying the structure in a database

    Ensure each data value represent a single fact

    Select Primary Key Eliminate redundancy and calculation

    Second Normal Form (2NF):

    Eliminate partial dependency

    Third Normal Form (3NF):

    Eliminate transitive dependency

  • 8/9/2019 Pert4-5 Database Design

    23/28

    23

    Data Design (cont.)

    Case Study 1 for Data Design?

    Represent the following structure as ERD model:

    The university of Honley is a technical university,with five faculties, each with departments

  • 8/9/2019 Pert4-5 Database Design

    24/28

    24

    Data Design (cont.)

    Case Study 2 for Data Design?

    A relational table is designed to represent details

    of projects. Its columns are project number,employee number of project leader, projectname, host department and head of hostdepartment. Each project has a unique number, aleader and a host department. Each department

    has only one head, but can host many projects.

    Make the 3NF from this case.

  • 8/9/2019 Pert4-5 Database Design

    25/28

    25

    Physical Database Design

    What is a Physical Database Design? The phase in design process wherein the designer

    decides how the database is to be stored in DBMS.Highly connected with DBMS.

    Will be discuss in details in Session 8

  • 8/9/2019 Pert4-5 Database Design

    26/28

    26

    Summary

    Requirements Analysis: process to collect andanalyze needs from the organization

    Data Analysis: derives a conceptual model of thedatabase. Most commonly used technique: top-down and bottom-up.

    Data Design: derives a ERD Normal.

    Physical Database Design: highly connected withDBMS.

  • 8/9/2019 Pert4-5 Database Design

    27/28

    27

    Next Session:Complication in Web DatabaseLimitation in Web Database Method

    Web Database Design MethodWeb Data AnalysisLogical Web Data Design

    Physical Web Database DesignReview session 1-7

  • 8/9/2019 Pert4-5 Database Design

    28/28

    28

    End of

    Database Design

    Thank you