Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions app/sem4/dbms/[chapter]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import Link from "next/link";
import { Ch0Content } from "../content/chapter0";
import { Ch1Content } from "../content/chapter1";
import { Ch2Content } from "../content/chapter2";
import { Ch3Content } from "../content/chapter3";
// import { Ch4Content } from "../content/chapter4";
// import { Ch5Content } from "../content/chapter5";
// import { Ch6Content } from "../content/chapter6";
// import { Ch7Content } from "../content/chapter7";
// import { Ch8Content } from "../content/chapter8";

import { ArrowBigLeft, ArrowBigRight } from "lucide-react";
import { Righteous } from "next/font/google";

const righteous = Righteous({
subsets: ["latin"],
weight: "400",
variable: "--font-righteous",
});

const chapters = [
{ id: "ch0", title: "Course Outline", component: Ch0Content },
{ id: "ch1", title: "Introduction to Databases", component: Ch1Content },
{ id: "ch2", title: "Entity-Relationship Model", component: Ch2Content },
{ id: "ch3", title: "Relational Model and SQL", component: Ch3Content },
// { id: "ch4", title: "Normalization", component: Ch4Content },
// { id: "ch5", title: "Transactions and Concurrency Control", component: Ch5Content },
// { id: "ch6", title: "Indexing and Hashing", component: Ch6Content },
// { id: "ch7", title: "Query Processing and Optimization", component: Ch7Content },
// { id: "ch8", title: "Recovery and Security", component: Ch8Content },
];

type ChapterProps = {
params: { chapter: string };
};

export default function ChapterPage({ params }: ChapterProps) {
const currentIndex = chapters.findIndex((c) => c.id === params.chapter);
const chapter = chapters[currentIndex];

if (!chapter) {
return <h1 className="text-2xl font-bold">Chapter not found</h1>;
}

const ChapterComponent = chapter.component;
const prevChapter = currentIndex > 0 ? chapters[currentIndex - 1] : null;
const nextChapter = currentIndex < chapters.length - 1 ? chapters[currentIndex + 1] : null;

return (
<div className="flex flex-col bg-[#1B0D00] min-h-full p-2 pt-6 text-[#e2d1c1]">
<div className="flex-1">
<h1 className={`text-4xl font-bold ${righteous.className} mb-2`}>
Database Management Systems
</h1>

<p className={`text-2xl mt-[-8] ${righteous.className}`}>
{chapter.title}
</p>

<div className="flex justify-between mt-3">
{prevChapter ? (
<Link
href={`/sem4/dbms/${prevChapter.id}`}
className="px-4 py-1 text-2xl flex items-center justify-center bg-[#e2d1c1] text-[#1b0d00] rounded hover:bg-[#ac9e91] transition"
style={{ fontFamily: "Rockwell, Serif, serif" }}
>
<ArrowBigLeft className="inline-block mr-1" />
Previous
</Link>
) : <div />}

{nextChapter ? (
<Link
href={`/sem4/dbms/${nextChapter.id}`}
className="px-4 py-1 text-2xl flex items-center justify-center bg-[#e2d1c1] text-[#1b0d00] rounded hover:bg-[#ac9e91] transition"
style={{ fontFamily: "Rockwell, Serif, serif" }}
>
Next
<ArrowBigRight className="inline-block ml-1" />
</Link>
) : <div />}
</div>

<hr className="my-6 border-t-3" />

<ChapterComponent />
</div>

<div className="flex justify-between my-8">
{prevChapter ? (
<Link
href={`/sem4/dbms/${prevChapter.id}`}
className="px-4 py-2 bg-[#e2d1c1] text-xl flex items-center justify-center text-[#1b0d00] rounded hover:bg-[#ac9e91] transition"
style={{ fontFamily: "Rockwell, Serif, serif" }}
>
<ArrowBigLeft className="inline-block mr-1" />
{prevChapter.title}
</Link>
) : <div />}

{nextChapter ? (
<Link
href={`/sem4/dbms/${nextChapter.id}`}
className="px-4 py-2 bg-[#e2d1c1] text-xl flex items-center justify-center text-[#1b0d00] rounded hover:bg-[#ac9e91] transition"
style={{ fontFamily: "Rockwell, Serif, serif" }}
>
{nextChapter.title}
<ArrowBigRight className="inline-block ml-1" />
</Link>
) : <div />}
</div>
</div>
);
}
73 changes: 73 additions & 0 deletions app/sem4/dbms/components/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className="flex relative">
<aside
className={`h-[100vh] sticky top-0 bg-[#fae8d7] text-[#1B0D00] p-0 flex flex-col transition-all duration-300 ${
open ? "w-64" : "w-0 overflow-hidden"
}`}
>
<h2
className="flex items-center text-2xl font-normal pt-3 pl-3 mb-2 bg-[#cebb9c] text-[#1B0D00] pb-2 border-b-4 border-[#1B0D00]"
style={{ fontFamily: "Rockwell, Serif, serif" }}
>
Chapters
</h2>

<ul className="flex-1 overflow-y-auto space-y-0">
{chapters.map((ch) => {
const active = pathname === `/sem4/dbms/${ch.id}`;
return (
<li key={ch.id}>
<Link
href={`/sem4/dbms/${ch.id}`}
className={`block px-3 py-2 text-xl transition ${
active ? "bg-[#fccc7e]" : "hover:bg-[#ffdda7af]"
} ${righteous.className}`}
>
{ch.title}
</Link>
</li>
);
})}
</ul>
</aside>

<button
onClick={() => setOpen(!open)}
className="toggle-sidebar sticky top-[10%] left-full bg-[#ffdda7d0] h-[85vh] w-[50px] text-[#1B0D00] text-center font-semibold text-2xl border-l-4 rounded-r-2xl border-[#1B0D00] flex items-center justify-center transition-all duration-300"
style={{ fontFamily: "Rockwell, Serif, serif" }}
>
<p className="leading-5">
C<br />H<br />A<br />P<br />T<br />E<br />R<br />S
</p>
</button>
</div>
);
}
149 changes: 149 additions & 0 deletions app/sem4/dbms/content/chapter0.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
export const Ch0Content = () => {
return (
<div className="course-content">
<p className="p-text">
Welcome to <span className="font-semibold">Database Management Systems</span> —
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.
</p>

<hr className="my-6 border-[#c7a669] opacity-40" />

<section>
<h3 className="section-heading">
Module I: <span className="section-subheading">Introduction to Databases</span>
</h3>
<ul className="section-list">
<li>What is a database and why we need it</li>
<li>File system vs database approach</li>
<li>Advantages of DBMS over file systems</li>
<li>Types of databases: relational, hierarchical, network, object-oriented</li>
<li>Database users: end users, application programmers, DBA</li>
<li>DBMS architecture: 1-tier, 2-tier, 3-tier</li>
</ul>
</section>

<hr className="my-6 border-[#c7a669] opacity-40" />

<section>
<h3 className="section-heading">
Module II: <span className="section-subheading">Entity-Relationship Model</span>
</h3>
<ul className="section-list">
<li>Entities, attributes, and relationships</li>
<li>Types of attributes: simple, composite, multivalued, derived</li>
<li>Cardinality: one-to-one, one-to-many, many-to-many</li>
<li>Participation constraints: total and partial</li>
<li>ER diagram notation and conventions</li>
<li>Extended ER features: specialization, generalization, aggregation</li>
</ul>
</section>

<hr className="my-6 border-[#c7a669] opacity-40" />

<section>
<h3 className="section-heading">
Module III: <span className="section-subheading">Relational Model and SQL</span>
</h3>
<ul className="section-list">
<li>Relational model: tables, tuples, attributes, domains</li>
<li>Keys: primary, candidate, foreign, super key</li>
<li>Relational algebra operations</li>
<li>SQL basics: DDL, DML, DCL, TCL</li>
<li>Joins: inner, outer, natural, cross</li>
<li>Subqueries, views, and aggregation functions</li>
</ul>
</section>

<hr className="my-6 border-[#c7a669] opacity-40" />

<section>
<h3 className="section-heading">
Module IV: <span className="section-subheading">Normalization</span>
</h3>
<ul className="section-list">
<li>Functional dependencies and their types</li>
<li>Anomalies: insertion, deletion, update</li>
<li>Normal forms: 1NF, 2NF, 3NF, BCNF</li>
<li>Decomposition: lossless join and dependency preservation</li>
<li>Multivalued dependencies and 4NF</li>
<li>Practical approach to normalization</li>
</ul>
</section>

<hr className="my-6 border-[#c7a669] opacity-40" />

<section>
<h3 className="section-heading">
Module V: <span className="section-subheading">Transactions and Concurrency Control</span>
</h3>
<ul className="section-list">
<li>Transaction concept and ACID properties</li>
<li>Transaction states: active, partially committed, committed, failed, aborted</li>
<li>Concurrency problems: lost update, dirty read, unrepeatable read</li>
<li>Concurrency control techniques: locking, timestamps</li>
<li>Two-phase locking protocol</li>
<li>Deadlock detection and recovery</li>
</ul>
</section>

<hr className="my-6 border-[#c7a669] opacity-40" />

<section>
<h3 className="section-heading">
Module VI: <span className="section-subheading">Indexing and Hashing</span>
</h3>
<ul className="section-list">
<li>Basic concepts of indexing</li>
<li>Dense and sparse indexes</li>
<li>B-tree and B+ tree indexing</li>
<li>Hashing techniques: static and dynamic</li>
<li>Comparison of indexing vs hashing</li>
<li>When to use which technique</li>
</ul>
</section>

<hr className="my-6 border-[#c7a669] opacity-40" />

<section>
<h3 className="section-heading">
Module VII: <span className="section-subheading">Query Processing and Optimization</span>
</h3>
<ul className="section-list">
<li>Steps in query processing</li>
<li>Query cost estimation</li>
<li>Equivalence of relational expressions</li>
<li>Query optimization techniques</li>
<li>Nested loop joins and merge joins</li>
<li>Query execution plans</li>
</ul>
</section>

<hr className="my-6 border-[#c7a669] opacity-40" />

<section>
<h3 className="section-heading">
Module VIII: <span className="section-subheading">Recovery and Security</span>
</h3>
<ul className="section-list">
<li>Types of failures: transaction, system, media</li>
<li>Recovery techniques: log-based, shadow paging</li>
<li>Checkpoints and their role in recovery</li>
<li>Database security concepts</li>
<li>Authorization and authentication</li>
<li>SQL injection and prevention</li>
</ul>
</section>

<hr className="my-6 border-[#c7a669] opacity-40" />

<p className="p-text">
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.
</p>
</div>
);
};
Loading