0% found this document useful (0 votes)
9 views10 pages

DBMS

The document compares file systems and database management systems (DBMS), highlighting that DBMS offers structured data storage, low redundancy, and advanced querying capabilities, while file systems are less efficient and secure. It also discusses various data models, schemas, and instances, explaining the relational model as the most commonly used. Additionally, it outlines DBMS architectures, including centralized and client-server models, and provides examples of database applications across different sectors.

Uploaded by

Shriya Sridhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views10 pages

DBMS

The document compares file systems and database management systems (DBMS), highlighting that DBMS offers structured data storage, low redundancy, and advanced querying capabilities, while file systems are less efficient and secure. It also discusses various data models, schemas, and instances, explaining the relational model as the most commonly used. Additionally, it outlines DBMS architectures, including centralized and client-server models, and provides examples of database applications across different sectors.

Uploaded by

Shriya Sridhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

UNIT 1

File Systems vs Databases:


Database Management System
Feature File System
(DBMS)

Data Storage Stores data in files Stores data in structured tables

High redundancy (duplicates


Data Redundancy Low redundancy due to normalization
possible)

Data Integrity Difficult to enforce Integrity constraints can be enforced

Advanced access control and user


Data Security Basic (file permissions)
authentication

Maintains consistency using ACID


Data Consistency Hard to maintain across files
properties

Supports multiple users with


Concurrency Control No built-in support
concurrency control

Automatic backup and recovery


Backup and Recovery Manual backup needed
mechanisms

Querying Requires custom code Can use SQL for efficient querying

Relationships between Supports relational data with keys and


No direct support
data joins

Scalability Poor scalability Highly scalable for large datasets

Low — programmer must handle High — abstraction layers manage


Data Abstraction
everything data complexity

Example .txt, .csv, .log files MySQL, PostgreSQL, Oracle DB

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 Models, Schemas and Instances:

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.

1. Hierarchical Data Model


 Organizes data in a tree-like structure with a parent-child relationship.
 Each child record has only one parent, but a parent can have multiple children.
 Uses pointers to link records.
Example: An organization chart where one manager has many subordinates.
✅ Efficient for one-to-many relationships, but inflexible for complex queries.

2. Network Data Model


 Extends the hierarchical model by allowing many-to-many relationships.
 Data is represented using nodes (records) and edges (relationships).
 A child can have multiple parents.
Example: A project assigned to multiple employees, and employees working on multiple projects.
✅ More flexible than the hierarchical model, but complex to design and maintain.

3. Relational Data Model


 Represents data as tables (relations) with rows and columns.
 Uses keys to link tables (e.g., primary key, foreign key).
 Supports powerful query languages like SQL.
Example: A Students table with columns RollNo, Name, and Course.
✅ Most widely used model due to simplicity, flexibility, and mathematical foundation.

4. Entity-Relationship (E-R) Model


 A high-level conceptual model used for database design.
 Represents real-world entities as entities, and the connections between them as
relationships.
 Uses E-R diagrams with symbols like rectangles (entities), diamonds (relationships), and
ovals (attributes).
Example: A Student entity linked to a Course entity through an Enrolled relationship.
✅ Useful for designing database structure before implementation.

5. Object-Oriented Data Model


 Integrates object-oriented programming concepts into databases.
 Data is stored as objects, with both data and methods.
 Supports inheritance, encapsulation, and polymorphism.
Example: A Vehicle class with subclasses like Car and Bike, each with their own properties.
✅ Good for applications requiring complex data types and relationships.

DBMS Architecture and Applications:


DBMS architecture defines how the database system is structured and how users interact with it.
There are three main types:
🔹 1-Tier Architecture
 All components (DBMS, application, and user interface) are on one machine.
 Mainly used in development/testing.
Example: A single-user desktop DBMS like Microsoft Access.

🔹 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.

📂 3. Examples of Database Applications


Here are real-world examples where databases are used:
Application Area Example Use

Banking Customer accounts, transactions, loan records

Education Student records, grading, attendance

E-commerce Product catalog, orders, user profiles

Healthcare Patient records, doctor schedules, billing

Telecommunications Call records, plans, user data

Social Media User posts, messages, profiles

Airline Reservation Flight schedules, bookings, passenger details

Centralised and Client-Server DBMS Architecture:

Centralized DBMS Architecture


In a centralized DBMS, the entire database system — including the DBMS software, data storage,
and application logic — is located on a single central server.
 Users connect via terminals or thin clients.
 All processing (query execution, updates) is done on the central machine.
 Minimal or no processing happens on the user side.
Example: A university computer lab where students access a database on a central server from
their terminals.
✅ Simple to manage and maintain, but not scalable for large user bases.

📘 Client-Server DBMS Architecture


In a client-server DBMS, the system is split into:
 Clients: Users' machines with front-end applications that send queries.
 Server: A backend machine where the DBMS resides and processes queries.
 The server handles data storage and management.
 The client handles user interface and application logic.
Example: An online banking system where users access account data through an app, which sends
SQL queries to the bank’s database server.
✅ More scalable, allows multiple clients, supports distributed workloads.

📊 Comparison Table: Centralized vs Client-Server DBMS

Feature Centralized DBMS Client-Server DBMS

Processing is split between client &


Architecture Single server does all processing
server

Location of DBMS Central server only On server side

User Interaction Through terminals or thin clients Through client applications

Scalability Limited High

Performance with
Degrades as users increase Handles many users efficiently
Load

Network
Less dependency Requires reliable network
Dependency

Easier to secure, since everything is More challenging due to distributed


Data Security
centralized access

Web-based or enterprise DBMS (e.g.


Examples Mainframe-based systems
MySQL, Oracle)
🔍 In the Centralized Server Example (University Computer Lab):
Students typically access the central database server through terminals or thin clients. These are
the kinds of actions they can perform:
 View their personal details (e.g., student ID, name, enrolled courses)
 Check attendance records
 Register for new courses
 View exam results and grades
 Update limited information (like address or phone number)
 Submit assignments or access digital course material
👉 All of this happens by sending requests to the centralized DBMS, which processes everything
and sends the result back to the terminal.

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

More flexible (can use aliases,


Flexibility Less flexible (depends on same names)
different names)

Used when tables are well-designed with


Common Use Most common for custom joins
consistent naming
Introduction of Relational Algebra in DBMS | GeeksforGeeks
Basic Operators in Relational Algebra | GeeksforGeeks
Extended Operators in Relational Algebra | GeeksforGeeks
SQL Joins (Inner, Left, Right and Full Join) | GeeksforGeeks
How to Group and Aggregate Data Using SQL? | GeeksforGeeks
SQL HAVING Clause with Examples | GeeksforGeeks
SQL ORDER BY | GeeksforGeeks
 Equi Join: A join that combines rows from two tables based on equality (=) of specified columns.
 Inner Join: A join that returns only the matching rows from both tables based on the join
condition
🔑 Difference:

Feature Equi Join Inner Join

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.

Doesn’t have a specific keyword —


SQL Keyword Uses the explicit keyword INNER JOIN
written using JOIN ... ON A.col = B.col
Feature Equi Join Inner Join

Example Join Could be A.col = B.col (equi), or any


A.col = B.col
Type other logical condition

You might also like