DATA MODELS AND
THREE SCHEMA ARCHITECTURE OF
            DBMS
Data Models
• Data Model: A set of concepts to describe the
  structure of a database, and certain constraints that
  the database should obey.
• Data Model Operations: Operations for specifying
  database retrievals and updates by referring to the
  concepts of the data model. Operations on the data
  model may include basic operations and user-defined
  operations.



Slide 2-2
Categories of data models
• Conceptual (high-level, semantic) data models:
  Provide concepts that are close to the way many
  users perceive data. (Also called entity-based or
  object-based data models.)
• Physical (low-level, internal) data models: Provide
  concepts that describe details of how data is stored
  in the computer.
• Implementation (representational) data models:
  Provide concepts that fall between the above two,
  balancing user views with some computer storage
  details.
   (Schema – a description of data in terms of a data
  model )

Slide 2-3
Data Models




Slide 2-4
Three-Schema Architecture
• Proposed to support DBMS characteristics of:
       • Program-data independence.
       • Support of multiple views of the data.



       – Schema – a description of data in terms of a data
         model



Slide 2-5
Three-Schema Architecture
• Defines DBMS schemas at three levels:
       • Internal schema at the internal level to describe physical
         storage structures and access paths. Typically uses a
         physical data model.
       • Conceptual schema at the conceptual level to describe the
         structure and constraints for the whole database for a
         community of users. Uses a conceptual or an
         implementation data model.
       • External schemas at the external level to describe the
         various user views. Usually uses the same data model as
         the conceptual level.


Slide 2-6
Levels of Abstraction in a DBMS

External Schema 1   External Schema 2   External Schema 3



                       Conceptual
                        (logical)
                        Schema



                         Physical
                         Schema



                       Secondary
                        Storage                        7
Physical Schema
• Storage space allocation for data and indexes
• Record description for storage (sizes for data
  items)
• Record placement
• Data compression and data encryption
  techniques



                    M.G. Erechtchoukova            8
Conceptual (Logical) Schema

Example:
Book (bid: char(2), title: char(50), author: char(20), price:
  decimal(5,2), av_q: integer)
Customer (cid: char(2), l_n: char(25), f_n: char(25), a_c:
  char(30), phone: char(10))
Order (i_n: char(2), bid: char(2), cid: char(2), n_i: integer,
  d_of_sale: date)




                          M.G. Erechtchoukova                    9
External Schema

• Multiple external schemas
• In relational DBMS, External Schema
  contains views and relations from
  conceptual schema
• Reduce complexity of DBMS for users
• Support data security
• Support data independence

                M.G. Erechtchoukova     10
Data Independence
When a schema at a lower level is changed, only
 the mappings between this schema and
 higher-level schemas need to be changed in a
 DBMS that fully supports data independence.
 The higher-level schemas themselves are
 unchanged. Hence, the application programs
 need not be changed since they refer to the
 external schemas.

Slide 2-11
Data Independence

External Schema 1       External Schema 2      External Schema 3

  Logical data                              independence
                           Conceptual
                            Schema


   Physical data                             independence
                             Physical
                             Schema




                           Secondary
                            Storage                           12
Data Independence (cont…)
• Logical data independence – the immunity of
  the external schemas to changes in the
  conceptual schema
• Physical data independence – the immunity
  of the conceptual schema to changes in the
  physical schema



                   M.G. Erechtchoukova          13

Datamodels & architecture

  • 1.
    DATA MODELS AND THREESCHEMA ARCHITECTURE OF DBMS
  • 2.
    Data Models • DataModel: A set of concepts to describe the structure of a database, and certain constraints that the database should obey. • Data Model Operations: Operations for specifying database retrievals and updates by referring to the concepts of the data model. Operations on the data model may include basic operations and user-defined operations. Slide 2-2
  • 3.
    Categories of datamodels • Conceptual (high-level, semantic) data models: Provide concepts that are close to the way many users perceive data. (Also called entity-based or object-based data models.) • Physical (low-level, internal) data models: Provide concepts that describe details of how data is stored in the computer. • Implementation (representational) data models: Provide concepts that fall between the above two, balancing user views with some computer storage details. (Schema – a description of data in terms of a data model ) Slide 2-3
  • 4.
  • 5.
    Three-Schema Architecture • Proposedto support DBMS characteristics of: • Program-data independence. • Support of multiple views of the data. – Schema – a description of data in terms of a data model Slide 2-5
  • 6.
    Three-Schema Architecture • DefinesDBMS schemas at three levels: • Internal schema at the internal level to describe physical storage structures and access paths. Typically uses a physical data model. • Conceptual schema at the conceptual level to describe the structure and constraints for the whole database for a community of users. Uses a conceptual or an implementation data model. • External schemas at the external level to describe the various user views. Usually uses the same data model as the conceptual level. Slide 2-6
  • 7.
    Levels of Abstractionin a DBMS External Schema 1 External Schema 2 External Schema 3 Conceptual (logical) Schema Physical Schema Secondary Storage 7
  • 8.
    Physical Schema • Storagespace allocation for data and indexes • Record description for storage (sizes for data items) • Record placement • Data compression and data encryption techniques M.G. Erechtchoukova 8
  • 9.
    Conceptual (Logical) Schema Example: Book(bid: char(2), title: char(50), author: char(20), price: decimal(5,2), av_q: integer) Customer (cid: char(2), l_n: char(25), f_n: char(25), a_c: char(30), phone: char(10)) Order (i_n: char(2), bid: char(2), cid: char(2), n_i: integer, d_of_sale: date) M.G. Erechtchoukova 9
  • 10.
    External Schema • Multipleexternal schemas • In relational DBMS, External Schema contains views and relations from conceptual schema • Reduce complexity of DBMS for users • Support data security • Support data independence M.G. Erechtchoukova 10
  • 11.
    Data Independence When aschema at a lower level is changed, only the mappings between this schema and higher-level schemas need to be changed in a DBMS that fully supports data independence. The higher-level schemas themselves are unchanged. Hence, the application programs need not be changed since they refer to the external schemas. Slide 2-11
  • 12.
    Data Independence External Schema1 External Schema 2 External Schema 3 Logical data independence Conceptual Schema Physical data independence Physical Schema Secondary Storage 12
  • 13.
    Data Independence (cont…) •Logical data independence – the immunity of the external schemas to changes in the conceptual schema • Physical data independence – the immunity of the conceptual schema to changes in the physical schema M.G. Erechtchoukova 13