DBMS
DBMS
Querying Requires custom code Can use SQL for efficient querying
A file system is a traditional way of storing data in files on a disk, where each application must
manage its own data format, access, and integrity. It lacks built-in support for security, concurrent
access, and relationships between data. In contrast, a Database Management System (DBMS)
offers a structured way to store, retrieve, and manage data using tables. DBMS ensures data
consistency, security, minimal redundancy, and supports complex queries using languages like
SQL. It also handles concurrent access, backup, and data recovery, making it more suitable for
modern applications requiring efficient and reliable data management.
Data Model
A data model is a conceptual framework that defines how data is organized, stored, and
manipulated in a database.
It provides the rules and structure for:
Data types
Relationships between data
Constraints
Types of Data Models:
Hierarchical Model
Network Model
Relational Model (most commonly used)
Entity-Relationship (E-R) Model
Object-Oriented Model
Example: The relational model organizes data in tables with rows and columns.
📘 2. Schema
A schema is the overall design or structure of the database.
It defines:
The tables
The attributes (columns)
The relationships
Constraints like primary keys, foreign keys, etc.
Schemas are created when the database is designed and rarely change.
Example: A schema for a college database might include a table Students with fields RollNo,
Name, and Course.
📘 3. Instance
An instance refers to the actual content of the database at a particular point in time — the data
stored in it.
Unlike a schema, an instance can change frequently as data is inserted, updated, or deleted.
Example: If the Students table currently has 50 rows, that data represents an instance of the
database.
🔹 2-Tier Architecture
Client and server are separate.
The application is on the client, and the DBMS runs on the server.
The client sends SQL queries; the server processes and sends back results.
Example: A bank employee using a desktop app to query account details from a central database.
🔹 3-Tier Architecture
Adds a middle tier (application server) between client and database.
Layers:
o Presentation Layer (User Interface)
o Application Layer (business logic)
o Database Layer (data storage)
Example: A web-based online shopping app — browser (client), web server (application logic),
database server (inventory, orders).
✅ Most secure and scalable, widely used in enterprise systems.
Performance with
Degrades as users increase Handles many users efficiently
Load
Network
Less dependency Requires reliable network
Dependency
Entity-Relationship Diagrams:
Introduction of ER Model | GeeksforGeeks
Mapping from ER Model to Relational Model | GeeksforGeeks
UNIT 2
📊 Summary Table
Feature Equi Join Natural Join
Join Condition Explicit (e.g., ON A.col = B.col) Implicit (based on common column names)
Duplicate
Yes (keeps both columns) No (removes duplicate column)
Columns
A specific type of join using only A broader type of join that returns
Definition
equality (=) as the condition matching rows based on any condition
Scope Narrow — only equality comparisons General — can use =, <, >, !=, etc.