+ );
+}
\ No newline at end of file
diff --git a/app/sem4/dbms/components/sidebar.tsx b/app/sem4/dbms/components/sidebar.tsx
new file mode 100644
index 0000000..7e092db
--- /dev/null
+++ b/app/sem4/dbms/components/sidebar.tsx
@@ -0,0 +1,73 @@
+"use client";
+import { Righteous } from "next/font/google";
+import Link from "next/link";
+import { usePathname } from "next/navigation";
+import { useState } from "react";
+
+const righteous = Righteous({
+ subsets: ["latin"],
+ weight: "400",
+ variable: "--font-righteous",
+});
+
+export default function Sidebar() {
+ const pathname = usePathname();
+ const [open, setOpen] = useState(true);
+
+ const chapters = [
+ { id: "ch0", title: "Course Outline" },
+ { id: "ch1", title: "Introduction to Databases" },
+ // { id: "ch2", title: "Entity-Relationship Model" },
+ // { id: "ch3", title: "Relational Model and SQL" },
+ // { id: "ch4", title: "Normalization" },
+ // { id: "ch5", title: "Transactions and Concurrency Control" },
+ // { id: "ch6", title: "Indexing and Hashing" },
+ // { id: "ch7", title: "Query Processing and Optimization" },
+ // { id: "ch8", title: "Recovery and Security" },
+ ];
+
+ return (
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/app/sem4/dbms/content/chapter0.tsx b/app/sem4/dbms/content/chapter0.tsx
new file mode 100644
index 0000000..044002b
--- /dev/null
+++ b/app/sem4/dbms/content/chapter0.tsx
@@ -0,0 +1,149 @@
+export const Ch0Content = () => {
+ return (
+
+
+ Welcome to Database Management Systems —
+ a core course designed to help you understand how data is organized, stored,
+ retrieved, and managed efficiently. This course covers relational models, SQL,
+ normalization, transactions, indexing, and more.
+
+
+
+
+
+
+ Module I: Introduction to Databases
+
+
+
What is a database and why we need it
+
File system vs database approach
+
Advantages of DBMS over file systems
+
Types of databases: relational, hierarchical, network, object-oriented
+
Database users: end users, application programmers, DBA
+
DBMS architecture: 1-tier, 2-tier, 3-tier
+
+
+
+
+
+
+
+ Module II: Entity-Relationship Model
+
+
+
Entities, attributes, and relationships
+
Types of attributes: simple, composite, multivalued, derived
Concurrency problems: lost update, dirty read, unrepeatable read
+
Concurrency control techniques: locking, timestamps
+
Two-phase locking protocol
+
Deadlock detection and recovery
+
+
+
+
+
+
+
+ Module VI: Indexing and Hashing
+
+
+
Basic concepts of indexing
+
Dense and sparse indexes
+
B-tree and B+ tree indexing
+
Hashing techniques: static and dynamic
+
Comparison of indexing vs hashing
+
When to use which technique
+
+
+
+
+
+
+
+ Module VII: Query Processing and Optimization
+
+
+
Steps in query processing
+
Query cost estimation
+
Equivalence of relational expressions
+
Query optimization techniques
+
Nested loop joins and merge joins
+
Query execution plans
+
+
+
+
+
+
+
+ Module VIII: Recovery and Security
+
+
+
Types of failures: transaction, system, media
+
Recovery techniques: log-based, shadow paging
+
Checkpoints and their role in recovery
+
Database security concepts
+
Authorization and authentication
+
SQL injection and prevention
+
+
+
+
+
+
+ By the end of this course, you will understand how to design databases,
+ write efficient SQL queries, normalize data, manage transactions, and
+ handle indexing and recovery — providing a strong foundation for
+ real-world database development and system design.
+
+ This chapter covers the fundamental concepts of database systems — what
+ they are, why they exist, how they compare to file systems, and the
+ basic architecture of a DBMS.
+
+
+
+
+
+
+ What is a Database?
+
+
+
A database is an organized collection of related data stored and accessed electronically.
+
Data represents real-world information — student records, bank transactions, product inventory.
+
A DBMS (Database Management System) is software that manages and controls access to the database.
+
Examples of DBMS: MySQL, PostgreSQL, Oracle, MongoDB.
+
+
+
Real-world Example
+
{`University DB
+Tables: Students, Courses, Enrollments, Professors
+Student Zubair (ID: 101) is enrolled in DBMS (CS401)
+taught by Prof. Sharma.`}
+
+
+
+
+
+
+
+ File System vs DBMS
+
+
+
Before DBMS, data was stored in flat files managed by the OS.
+
Data Redundancy: the same data repeated in multiple files.
+
Data Inconsistency: updating one file does not update others.
+
Data Isolation: data scattered in different formats, hard to access together.
+
DBMS solves all three by centralizing data and enforcing rules.
+
+
+
Exam Tip: Always mention the 3 main problems of file systems — redundancy, inconsistency, and data isolation — when comparing with DBMS.
+
+
+
+
+
+
+
+ Advantages of DBMS
+
+
+
Reduced Redundancy: data is stored once and shared.
+
Data Consistency: changes reflect everywhere automatically.
+
Data Integrity: constraints ensure data accuracy.
+
Data Security: access control limits who can read or modify data.
+
Concurrent Access: multiple users can safely access data at the same time.
+
Backup and Recovery: DBMS provides tools to recover from failures.
+
+
+
+
+
+
+
+ Types of Databases
+
+
+
Relational: data in tables with rows and columns. Example: MySQL, PostgreSQL.
+
Hierarchical: tree-like structure. Example: IBM IMS.
+
Network: graph structure with multiple parent-child relationships.
+
Object-Oriented: stores objects like in OOP. Example: db4o.
+
NoSQL: designed for unstructured data at scale. Example: MongoDB, Redis.
+
+
+
Most university syllabi focus on relational databases. NoSQL is mentioned for awareness.
+
+
+
+
+
+
+
+ Database Users
+
+
+
End Users: interact with the database through applications.
+
Application Programmers: write programs to access the database.
+
DBA (Database Administrator): manages performance, security, and backups.
+
Data Analysts: query the database to generate reports and insights.
+
+
+
Who does what?
+
{`End User → Uses a form to register for a course
+App Dev → Writes INSERT INTO enrollments...
+DBA → Creates tables, grants permissions, monitors performance`}
+
+
+
+
+
+
+
+ Three-Schema Architecture
+
+
+
DBMS uses a 3-level architecture to separate storage from how users see data.
+
Internal Level: how data is physically stored on disk.
+
Conceptual Level: the logical structure — tables, relationships, constraints.
+
External Level: what individual users or applications see (views).
+
This separation is called Data Independence.
+
+
+
Physical independence = change storage without changing logic. Logical independence = change logic without changing user views.
DCL (Data Control Language): access control. Example: GRANT, REVOKE.
+
TCL (Transaction Control Language): manage transactions. Example: COMMIT, ROLLBACK.
+
+
+
Quick Examples
+
{`DDL: CREATE TABLE students (id INT PRIMARY KEY, name VARCHAR(50));
+DML: INSERT INTO students VALUES (1, 'Zubair');
+DCL: GRANT SELECT ON students TO user1;
+TCL: COMMIT;`}
+
+
+
+
+
+
+
+ DBMS Architecture: 1-Tier, 2-Tier, 3-Tier
+
+
+
1-Tier: database and application on the same machine. Used for personal/local databases.
+
2-Tier: client communicates directly with the database server.
+
3-Tier: a middle application server sits between client and database. Used in web apps.
+
+
+
3-Tier Example
+
{`Client (Browser)
+ ↓ HTTP request
+App Server (Node.js / Spring Boot)
+ ↓ SQL query
+Database Server (MySQL / PostgreSQL)`}
+
+
+
+ );
+};
\ No newline at end of file
diff --git a/app/sem4/dbms/layout.tsx b/app/sem4/dbms/layout.tsx
new file mode 100644
index 0000000..de8664c
--- /dev/null
+++ b/app/sem4/dbms/layout.tsx
@@ -0,0 +1,28 @@
+import Navbar from "../../components/navbar";
+import Sidebar from "./components/sidebar";
+
+export const metadata = {
+ title: "Database Management Systems | openCSE",
+ description:
+ "Free and Open Documentations for Database Management Systems",
+};
+
+export default function DBMSLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+
+
+
+
+
+
+ {children}
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/app/sem4/dbms/page.tsx b/app/sem4/dbms/page.tsx
new file mode 100644
index 0000000..c7daade
--- /dev/null
+++ b/app/sem4/dbms/page.tsx
@@ -0,0 +1,8 @@
+export default function Home() {
+ return (
+