-
Notifications
You must be signed in to change notification settings - Fork 19
Docs/dbms er model and sql #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
codewithzubair07
wants to merge
3
commits into
pushkarscripts:main
Choose a base branch
from
codewithzubair07:docs/dbms-er-model-and-sql
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
9276cf7
docs: add DBMS subject with course outline and introduction chapter
jannatfirdous07 52b1dc3
docs: add DBMS chapter 1 - introduction to databases
jannatfirdous07 02394c4
docs: add DBMS chapter 2 - ER model and chapter 3 - relational model …
jannatfirdous07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" }, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one too |
||
| // { 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> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ); | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncomment this line