Schema in DBMS: Definition, Types, and Examples

What is a Schema?

A schema in a Database Management System (DBMS) defines the logical structure of a database, including its tables, relationships, constraints, views, indexes, and permissions. It acts as a blueprint that dictates how data is organized and how different entities interact.

Key Characteristics of a Schema

Logical structure – Defines how data is stored and related.
Includes constraints – Specifies rules (e.g., primary keys, foreign keys).
Does not store data – Acts as a framework for data storage.
Can be modified – Using ALTER SCHEMA or ALTER TABLE.


Types of Database Schemas

A DBMS schema can be divided into different levels based on the ANSI-SPARC three-tier architecture:

  1. Physical Schema (Internal Level) – Storage details
  2. Logical Schema (Conceptual Level) – Data structure & relationships
  3. View Schema (External Level) – User-specific views

1. Physical Schema (Internal Schema)

🔹 Definition: Describes how data is physically stored on hardware (disks, SSDs).
🔹 Includes: File organization, indexing methods, access paths.
🔹 Users: Database administrators (DBAs) & system engineers.

💡 Example:

  • Data is stored in B-trees, hash indexes, or tablespaces.
  • Indexing is used to speed up retrieval.

2. Logical Schema (Conceptual Schema)

🔹 Definition: Defines the structure of the database (tables, attributes, relationships).
🔹 Includes:

  • Tables & fields (Employee(id, name, department))
  • Relationships (One-to-Many between Employee & Department)
  • Constraints (Primary key, foreign key, NOT NULL)
    🔹 Users: Database developers, architects.

Defines the Employee table structure with a foreign key linking it to the Department table.

3. View Schema (External Schema)

🔹 Definition: Defines how different users see the database.
🔹 Includes:

  • User permissions (HR sees salaries, but employees don’t).
  • Custom views for business intelligence and reporting.
    🔹 Users: End-users, business analysts, security teams.
  • Creates a custom view that only shows salary details for a specific department.

Other Types of Schemas in DBMS

Schema TypeDescriptionExample
Star SchemaA single fact table connected to multiple dimension tablesData warehouses, OLAP
Snowflake SchemaA normalized version of a star schemaComplex analytics
Fact ConstellationMultiple fact tables sharing common dimension tablesLarge-scale BI applications
ER Model SchemaUses Entity-Relationship diagrams to model relationshipsDatabase design phase

Comparison Table: Physical vs. Logical vs. View Schema

FeaturePhysical SchemaLogical SchemaView Schema
FocusHow data is storedData structure & relationshipsUser-specific views
IncludesFiles, indexes, partitionsTables, relationships, constraintsCustom reports, security filters
UsersDBAs, System EngineersDevelopers, ArchitectsEnd-users, Analysts

Schema Modification (ALTER SCHEMA Commands)

Modify Table Structure (Logical Schema Change)

Conclusion

  • The Physical Schema handles storage details.
  • The Logical Schema defines tables, relationships, and constraints.
  • The View Schema provides user-specific data access.
  • Different schemas like Star, Snowflake, and Fact Constellation are used in data warehouses.

7 thoughts on “Schema in DBMS: Definition, Types, and Examples

  1. One thing is that when you are searching for a education loan you may find that you’ll need a co-signer. There are many situations where this is correct because you should find that you do not employ a past credit ranking so the bank will require you have someone cosign the credit for you. Good post.

  2. Hey there just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Ie. I’m not sure if this is a formatting issue or something to do with browser compatibility but I figured I’d post to let you know. The style and design look great though! Hope you get the issue resolved soon. Cheers

  3. Howdy would you mind sharing which blog platform you’re working with? I’m going to start my own blog soon but I’m having a tough time selecting between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design and style seems different then most blogs and I’m looking for something completely unique. P.S Apologies for getting off-topic but I had to ask!

  4. I like the valuable information you provide to your articles. I抣l bookmark your blog and check once more here frequently. I’m slightly certain I will be told plenty of new stuff right right here! Best of luck for the following!

Leave a Reply

Your email address will not be published. Required fields are marked *