chapter2 by VinyWenkz


									Database Management System                                             b. Many-to-many(M:N or M:M) – an employee
                                                                          may have many job skills and each job skill
                                                                          may be learned by many employees
Importance of Data Models                                              c. One-to-one (1:1) – a retail store can cave only
                                                                          1 manager and a manager can manage only 1
*data models – relatively simple representations, usually                 retail store
graphical, of more complex real-world structures                    4. Constraint – restriction placed on the data
        - represents the data structures and their                     - Help ensure data integrity
characteristics, relations, constraints & transformations              - Ex: salary should be between 6,000 & 350,000
*model – abstraction of a more complex real-world or
       - main function is to help us understand the             Business Rules
complexities of the real-world environment                      *business rule – a brief, precise, and unambiguous
                                                                description of a policy, procedure or principle within a
*data model & database model  interchangeable                  specific organization

*database model – will be used to refer to the                  *properly written business rules are used to define entities,
implementation of a data model in a specific database           attributes, relationships & constraints
         - can facilitate interaction among the designer, the   *main sources of business rules: company managers,
applications programmer, and the end user                       policy makers, department managers & written
*data constitute the most basic information units
employed by a system                                            *the process of identifying and documenting business
*applications are created to manage data and to help            rules is essential to database design for several reasons:
transform data into information
                                                                       They help standardize the company’s view of data
                                                                       They can be a communications tool between
                                                                        users and designers
Data Model Basic Building Blocks
                                                                       They allow the designer to understand the nature,
    1. Entity – anything (a person, a place, a thing, or an             role & scope of the data
       event) about which data are to be collected and                 They allow the designer to understand business
       stored                                                           process
       - Represents a particular type of object in the                 They allow the designer to develop appropriate
           real world                                                   relationship participation rules and constraints
       - May be physical objects (such as customers or                  and to create an accurate data model.
           products) or abstraction (such as flight routes
           or musical concerts)
                                                                Evolution of Data Models
    2. Attribute – characteristic of an entity
                                                                *the hierarchical and data models are largely of historical
       - Example: customer phone number
    3. Relationship – describes association between
       entities; bidirectional
                                                                The Hierarchical Model
                                                                                                                                Viny Wenkz

       a. One-to-many (1:M) – painter paints many                       -    Developed in the 1960s to manage large
           paintings, but each painting is painted by only                   amounts of data for complex manufacturing
           one painter                                                       such as the Apollo rocket that landed on the
                                                                             moon in 1969
       -   Basic logical structure is represented by an            c.   Data management language (DML) – defines
           upside down tree                                             the environment in which data can be
       -   Contains levels or segments                                  managed
       -   Segment: equivalent of a file system’s record                    Three Distinct DML Components:
           type                                                             i.      A schema data definition
       -   Root: top layer                                                          language (DDL), which enables
       -   1:M relationship                                                         the database admin to define the
       -   Limitations                                                              schema components
           a. Complex to implement                                          ii.     A subschema DDL, which allows
           b. Difficult to manage                                                   application programs to define
           c. Lacked structural independence                                        the database components that
           d. Many common data relationships do not                                 will be used by the application
               conform to the 1:M form                                      iii.    A data manipulation language to
           e. No standards how to implement the                                     work with the data in the
               model                                                                database

The Network Model                                          *Network model resembles the hierarchical model, only
                                                           that network model allows a record to have more than
       -   Created to represent complex data               one parent
           relationships more effectively than the         *relationship = set
           hierarchical model, to improve database         *each set is composed of at least 2 record data types:
           performance, and to impose a database           1. owner record = hierarchical model’s parent
           standard                                        2. member record = hierarchical model’s child
       -   Conference on Data Systems Languages
           (CODASYL) created the Database Task Group       The Relational Model
           (DBTG) in the late 1960s
       -   DBTG: charged to define standards for an                -    Introduced by E.F. Codd (of IBM) in 1970 in his
           environment that would facilitate database                   landmark paper “A Relational Model of Data
           creation and manipulation                                    for Shared Databanks”
                                                                   -    Represented a major breakthrough for both
       Three Crucial Database Components (from the                      users and designers
       final DGTB report):                                         -    Produced an “automatic transmission”
       a. Network schema – conceptual organization of                   database to replace the “standard
                                                                        transmission” databases
          the entire database as viewed by the
                                                                   -    Implemented through a very sophisticated
          database administrator
                                                                        relational database management system
       - Includes a definition of the database name,
          the record type for each record, and the
                                                                   -    RDBMS performs the same basic functions
          components that make up those records
       b. Network subschema – defines the portion of                    provided by the hierarchical and network
          the database as “seen” by the application                     DBMS systems
          programs that actually produce the desired       *The most important advantage of the RDBMS is its ability
          information from the data contained within       to hide the complexities of the relational model from the
          the database                                     user
       - Allows all application programs to simply
                                                                                                                          Viny Wenkz

                                                           *The RDBMS manages all of the physical details while the
          invoke the subschema required to access the      user sees the RDB as a collection of tables in w/c data are
          appropriate database file(s)                     stored and can manipulate and query data in a way that
                                                           seems intuitive and logical

*table – a matrix consisting of series of row/column
intersections                                                    Entity Relationship Model
- also called relations & are related to each other through
the sharing of common entity characteristic                              -   A graphical tool in which entities and their
                                                                             relationship are pictured
*relational model – provides a minimum level of                          -   Graphical representation of entities and their
controlled redundancy to eliminate most of the                               relationships in a database structure
redundancies commonly found in file systems                              -   Complemented the relational data model
*1:M & M:N – often shown in a relational schema                          -   Combined with relational data model provide
                                                                             the foundation for tightly structured database
*relational diagram – representation of the relational                       design
database’s entities, the attributes within those entities,       *Peter Chen – introduced ERM in 1976
and the relationships between those entities                     *ER Models are normally represented in an entity
                                                                 relationship diagram (ERD) which uses graphical
*relational table – stores a collection of related entities      representations to model database components

*relational database table – resembles a file that yields
complete data and structural independence because it is
                                                                 The Components where the ER Model was based:
purely logical structure
- its powerful and flexible language made it dominant                1. Entity – represented by a rectangle also known as
                                                                        entity box
*how the data stored does not matter, it is the perception              - Usually mapped to a relational table
that counts                                                             - Each row in the relational table is known as an
                                                                            entity instance or entity occurrence
*SQL – Structured Query Language
- 4GL which allows the user to specify what must be done                 *entity set – collection of like entities
without specifying how it must be done                                   - each entity is described by a set of attributes
- RDBMS uses SQL to translate user queries into                          that describes particular characteristics of the
instructions for retrieving requested data                               entity
- makes it possible to retrieve data with far less effort than           - ex. Entity: attribute  customer: SSN
any other database or file environment
                                                                     2. Relationships – describe associations among data
                                                                        -Usually describes associations between 2 entities
Three parts of nay SQL-based relational database
application from an end-user perspective:
                                                                         *connectivity – label of the relationships (ex. 1:M)
    1. End-user interface – allows the user to interact                  -represented by diamond connected to the
       with the data by auto generating SQL code                         related entities through a relationship line
       - A product of the software vendor’s idea of                      Ex:
           meaningful interaction with the data                               1                        M
                                                                    painter            paints              painting
    2. A collection of tables stored in the database – all
       data are perceived to be stored in tables
                                                                 ^ Example of a Chen Model
       - The tables simply “present
                                                                 (can also be vertical)
       - “ the data to the end user in a way that it easy
                                                                                                                                Viny Wenkz

           to understand
                                                                 *Crow’s Foot Notation – more current version of the ERD
    3. SQL engine`e – largely hidden from the end user
                                                                 (three-pronged symbol to represent the “many” line)
       - Executes all queries or data requests

The Object – Oriented (OO) Model                                            attributes and methods of the classes
OODM – Object Oriented Data Model                                           above it

       -   Both data and their relationships are             *conceptual models – better for high-data modeling
           contained in a single structure called the        - ER
           object                                            *implementation modeling – better at managing stored
       -   Basis for OO Database Management System           data for implementation purposes
           (OODBMS)                                          - hierarchical, network
       -   Semantic data model                               *both – OO, Relational
       -   Reflects a very different way to show entities:

           *like a relational model’s entity, an object is   Other Models
           described by its factual content, but unlike an   *extended relational model (ERDM) – ERM’s response to
           entity, an object includes information about      the OODM (O/RDBMS)
           relationships between the facts within the        XML – Extensible Markup Language; standard protocol for
           object, as well as the information about its      data exchange among different systems and Internet-
           relationships with the other objects              based services
           *greater meaning is given to the facts within
           the object
           *object also contains all operations that can
           be performed on it
           *objects became the basic building block for
           autonomous structures because it contains
           the variable, the relationships between them
           and the operations (self-contained)

           Components where OO has been based:

           1. An object is an abstraction of a real-
              world entity. Generally, an object is
              equivalent to an ER model’s entity. Object
              represents only one individual occurrence
              of an entity.
           2. Attributes describe the properties of an
              Ex: obj: attr  Person: Birth date
           3. Objects that share similar characteristics
              are grouped in classes
              *class – collection of similar objects
              w/shared structure(attributes) and
              behavior (methods)
              OO:ER  Object: Entity Set
           4. Classes are organized in a class hierarchy.
              Class hierarchy – resembles an upside
                                                                                                                       Viny Wenkz

              down tree in which each class has only
              one parent
           5. Inheritance is the ability of an object
              within the class hierarchy to inherit the


To top