1 Database Fundamentals And Architecture

Database Management System · Unit 1

Database Fundamentals and Architecture

Exam-focused notes for Database Fundamentals and Architecture (Database Management System, BIT202): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.

Database Fundamentals and Architecture in short

A database system stores large amounts of related data and lets many users share it safely. This chapter explains what a database is, why a DBMS beats plain files, and how the three-schema architecture keeps data and programs independent.

Database Fundamentals and Architecture: notes

Database definition and characteristics

A database is an organized collection of related data that is stored so it can be easily accessed, managed, and updated. A DBMS (Database Management System) is the software that creates, stores, protects, and retrieves this data. Examples are MySQL, Oracle, PostgreSQL, and SQL Server.

Main characteristics of the database approach:

  • Self-describing: the database holds its own description (the catalog or data dictionary) along with the data.
  • Program-data independence: programs do not depend on how data is stored.
  • Multiple views: each user can see the data in a different form.
  • Data sharing: many users can use the same data at the same time (multiuser transactions).
  • Controlled redundancy: duplicate data is kept low, so updates stay consistent.
  • Security and integrity: only allowed users access data, and rules keep the data correct.
  • Backup and recovery: data can be restored after a failure.

Advantages of DBMS over file systems

In a file system, each application keeps its own files. The same data is often copied into many files. This causes many problems that a DBMS solves.

File systemDBMS
High data redundancyRedundancy is controlled
Data inconsistency is commonConsistency is enforced by constraints
Program and data are tightly linkedData independence is supported
Hard to share data between usersEasy and safe sharing
Weak securityStrong access control by user and role
No standard backup or recoveryBuilt-in backup and recovery
Hard to query in new waysAd hoc queries with SQL
Integrity rules written in each programIntegrity rules stored once in the database

Other advantages are concurrent access, faster development of applications, and enforcement of standards. Disadvantages are higher cost, extra hardware needs, and more complexity.

What this unit covers

  • Database definition and characteristics
  • Advantages of DBMS over file systems
  • Three-schema architecture layers
  • Logical and physical data independence
  • Database users and roles
  • Data models, schemas, and instances

Three-schema architecture layers

2082 · 5 marks

Describe the three schema architecture. How does the architecture create data independence? [5]

Show solved answer

Three Schema Architecture and Data Independence

Three Schema Architecture

The three schema architecture (also called the ANSI/SPARC architecture) is a framework for database systems that separates the database into three distinct levels or schemas. This architecture was proposed to achieve data independence and support multiple user views.


The Three Levels

1. External Level (View Level)

  • The highest level of abstraction, closest to the end users.
  • Describes how individual users or groups of users see the data.
  • Each user group has its own external schema (user view), showing only the portion of the database relevant to that user.
  • Different users can have different views of the same data.
  • Example: A student may see only their own grades, while a teacher sees all student grades.

2. Conceptual Level (Logical Level)

  • The middle level, representing the community or organizational view of the entire database.
  • Described by a conceptual schema, which defines:
    • All entities, attributes, and relationships
    • Constraints, security, and integrity rules
  • Hides the physical storage details but describes what data is stored and how it is logically structured.
  • Managed by the Database Administrator (DBA).

3. Internal Level (Physical Level)

  • The lowest level, closest to physical storage.
  • Described by an internal schema, which defines:
    • How data is physically stored on disk
    • File organization, indexing, hashing, access paths
    • Storage allocation and compression
  • Deals with the actual implementation of the database.

Diagram

+-----------------------------+
|   External Schema 1  |  External Schema 2  |  ...  |   <- External Level
+-----------------------------+
           |
+-----------------------------+
|      Conceptual Schema      |                           <- Conceptual Level
+-----------------------------+
           |
+-----------------------------+
|       Internal Schema       |                           <- Internal Level
+-----------------------------+
           |
+-----------------------------+
|     Physical Database       |
+-----------------------------+

How the Architecture Creates Data Independence

Data independence is the ability to change the schema at one level without having to change the schema at the next higher level. The three schema architecture achieves this through two types of mappings:


1. Logical Data Independence

  • The ability to change the conceptual schema without changing the external schemas or application programs.
  • Example: Adding a new attribute (column) to a table, or splitting a table, does not affect the user views as long as the mapping between external and conceptual levels is updated.
  • This is harder to achieve in practice.

2. Physical Data Independence

  • The ability to change the internal schema without changing the conceptual schema.
  • Example: Changing the file organization from sequential to indexed, or moving data to a different storage device, does not affect the logical structure.
  • This is easier to achieve and is supported by most DBMS.

Summary Table

Change Made AtDoes Not AffectType of Independence
Internal SchemaConceptual SchemaPhysical Data Independence
Conceptual SchemaExternal SchemaLogical Data Independence

Conclusion

The three schema architecture creates data independence by introducing clear separation between how data is physically stored, how it is logically organized, and how it is viewed by users. The mappings between levels ensure that changes at one level are translated appropriately, shielding higher levels from lower-level changes. This reduces maintenance cost, improves flexibility, and allows the database to evolve without disrupting existing applications.

Open this answer on its own page →

2080 · 5 marks

What is data independence? How three schema architecture ensures logical and physical data independence? [5]

Show solved answer

Data Independence and Three Schema Architecture

What is Data Independence?

Data independence is the ability to modify the schema definition at one level of the database system without affecting the schema definition at the next higher level.

In simple terms, it means changes made to the structure or storage of data do not require changes to the application programs that use the data.

There are two types of data independence:

TypeDescription
Logical Data IndependenceAbility to change the conceptual schema without changing external schemas or application programs
Physical Data IndependenceAbility to change the internal/physical schema without changing the conceptual schema

Three Schema Architecture

The ANSI/SPARC Three Schema Architecture divides the database into three levels:

+-----------------------------+
|   External Level (View)     |  <-- User views / subschemas
+-----------------------------+
|   Conceptual Level          |  <-- Logical structure of entire DB
+-----------------------------+
|   Internal Level            |  <-- Physical storage details
+-----------------------------+
  1. External Schema (View Level): Describes how individual users or groups see the data. Different users can have different views.

  2. Conceptual Schema: Describes the overall logical structure of the entire database -- what data is stored, relationships, constraints, etc.

  3. Internal Schema: Describes the physical storage structure -- file organization, indexes, access paths, etc.


How Three Schema Architecture Ensures Data Independence

1. Physical Data Independence

  • Achieved through the mapping between Internal and Conceptual levels.
  • If the physical storage is changed (e.g., changing file organization, adding indexes, moving data to new storage), only the internal schema and its mapping to the conceptual schema need to be updated.
  • The conceptual schema remains unchanged, so application programs and user views are not affected.
  • Example: Changing a sequential file to a B-tree index does not affect the logical description of the data.

2. Logical Data Independence

  • Achieved through the mapping between Conceptual and External levels.
  • If the conceptual schema is changed (e.g., adding a new attribute, splitting a table), only the mapping between conceptual and external schemas needs to be updated.
  • The external schemas (user views) remain unchanged, so application programs are not affected.
  • Example: Adding a new column to a table does not affect existing user views that do not use that column.

Summary

Change in Internal Schema
        |
        v
  Update Internal-Conceptual Mapping  --> Physical Data Independence
        |
        v
  Conceptual Schema unchanged
        |
        v
  Update Conceptual-External Mapping  --> Logical Data Independence
        |
        v
  External Schema (Applications) unchanged

The three schema architecture acts as a buffer between levels, ensuring that changes at one level are isolated from other levels, thus providing both physical and logical data independence.

Open this answer on its own page →

2079 · 5 marks

What are the three layers of the Three-Schema Architecture? Explain. [5]

The Three-Schema Architecture (also called the ANSI/SPARC architecture) is a framework for database systems that separates the user's view of the database from the physical storage of data. It defines three levels of abstraction to achieve data independence. --- - This is the lowest level of abst...

Open this answer on its own page →

0 · 5 marks

What is data independence? How three schema architecture ensures logical and physical data independence? [5]

Show solved answer

Data Independence and Three Schema Architecture

What is Data Independence?

Data independence is the ability to modify the schema definition at one level of the database system without affecting the schema definition at the next higher level.

It means that changes made to the structure or storage of data should not require changes to the application programs that use the data.

There are two types of data independence:

1. Logical Data Independence

The ability to change the conceptual schema without having to change the external schemas (user views) or application programs.

  • Example: Adding a new attribute to a table, splitting a table, or merging tables should not affect existing user views or applications.

2. Physical Data Independence

The ability to change the internal/physical schema without having to change the conceptual schema (or external schemas).

  • Example: Changing file organization, indexing strategy, or storage devices should not affect the logical structure of the database.

Three Schema Architecture

The Three Schema Architecture (proposed by ANSI/SPARC) divides the database into three levels:

LevelSchemaDescription
External LevelExternal SchemaIndividual user views
Conceptual LevelConceptual SchemaLogical structure of entire database
Internal LevelInternal SchemaPhysical storage details
External Level:   [View 1]   [View 2]   [View 3]
                        |         |         |
                   (External/Conceptual Mapping)
                              |
Conceptual Level:    [Conceptual Schema]
                              |
                   (Conceptual/Internal Mapping)
                              |
Internal Level:      [Internal Schema]
                              |
                      [Physical Database]

How Three Schema Architecture Ensures Data Independence

Logical Data Independence (via External/Conceptual Mapping)

  • The mapping between external schema and conceptual schema is maintained by the DBMS.
  • When the conceptual schema changes (e.g., a new column is added), only the external/conceptual mapping needs to be updated.
  • The external schemas and application programs remain unchanged.
  • This is harder to achieve because application programs are closely tied to the logical structure.

Physical Data Independence (via Conceptual/Internal Mapping)

  • The mapping between conceptual schema and internal schema is maintained by the DBMS.
  • When the internal schema changes (e.g., a new index is created, or data is moved to a different disk), only the conceptual/internal mapping needs to be updated.
  • The conceptual schema remains unchanged, and therefore external schemas and applications are also unaffected.
  • This is relatively easier to achieve and is well supported by most modern DBMS.

Summary

The three schema architecture achieves data independence by providing two levels of mappings (external/conceptual and conceptual/internal). Changes at one level are absorbed by updating the corresponding mapping, so the levels above remain unaffected. This insulates users and applications from physical and logical changes in the database.

Open this answer on its own page →

Advantages of DBMS over file systems

2080 · 5 marks

What are the Advantages of using DBMS? Explain in brief. [5]

(Note: Reference notes were not available for this topic; the following answer is based on standard Database Management System concepts as taught in BSc CSIT curriculum.) --- A Database Management System (DBMS) is software that manages the storage, retrieval, and manipulation of data in a structu...

Open this answer on its own page →

Database definition and characteristics

2079 · 5 marks

What is Database? Explain the characteristics of Database Approach. [5]

A database is a collection of related data that is organized, stored, and managed so that it can be easily accessed, retrieved, updated, and managed. It represents some aspect of the real world (called a miniworld or Universe of Discourse) and is designed for a specific purpose with an intended g...

Open this answer on its own page →

Database users and roles

2078 · 5 marks

What are different types of Database Users? Explain in Brief. [5]

Database users are people who interact with the database system in different ways. They can be classified into the following types: --- - These are end users who interact with the database through predefined application programs (forms, menus). - They do not need to know about the database struct...

Open this answer on its own page →

Data models, schemas, and instances

2078 · 5 marks

Explain Data Models, Schemas, and Instances. [5]

A data model is a collection of concepts or tools used to describe the structure of a database. It provides a way to describe the design of a database at logical, physical, and view levels. Data models define: - The data itself - Relationships among data - Semantics (meaning) of data - Constraint...

Open this answer on its own page →