<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nidheesh Thangavel</title>
    <description>The latest articles on DEV Community by Nidheesh Thangavel (@nidheesh_).</description>
    <link>https://dev.to/nidheesh_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3449176%2F5644aa97-8a12-4583-8c68-20bde111d1ac.png</url>
      <title>DEV Community: Nidheesh Thangavel</title>
      <link>https://dev.to/nidheesh_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nidheesh_"/>
    <language>en</language>
    <item>
      <title>Unlocking the Power of Connected Data: A Deep Dive into Amazon Neptune</title>
      <dc:creator>Nidheesh Thangavel</dc:creator>
      <pubDate>Fri, 19 Dec 2025 09:29:30 +0000</pubDate>
      <link>https://dev.to/nidheesh_/unlocking-the-power-of-connected-data-a-deep-dive-into-amazon-neptune-151d</link>
      <guid>https://dev.to/nidheesh_/unlocking-the-power-of-connected-data-a-deep-dive-into-amazon-neptune-151d</guid>
      <description>&lt;p&gt;Unlocking the Power of Connected Data: A Deep Dive into Amazon Neptune&lt;br&gt;
In the world of traditional databases, we’ve been taught to think in tables, rows, and columns. But in 2025, data isn't just a list; it’s a web. Whether it’s a social network, a fraud detection system, or a Knowledge Graph for Generative AI, the relationships between data points are often more valuable than the data itself.&lt;/p&gt;

&lt;p&gt;That’s where Amazon Neptune enters the chat.&lt;/p&gt;

&lt;p&gt;What exactly is Amazon Neptune?&lt;br&gt;
Amazon Neptune is a fully managed, serverless graph database. While a standard SQL database struggles with deep "JOIN" operations (which get slower and more expensive as you add layers), Neptune is purpose-built to navigate billions of connections in milliseconds.&lt;/p&gt;

&lt;p&gt;Key Features that Change the Game&lt;br&gt;
Serverless Architecture: Gone are the days of guessing your instance size. Neptune scales your compute power up and down automatically based on the actual demand of your application.&lt;/p&gt;

&lt;p&gt;GraphRAG (The AI Secret Sauce): If you're building a Chatbot, Neptune integrates with Amazon Bedrock. By using a graph to provide context (Graph Retrieval-Augmented Generation), you can significantly reduce AI hallucinations and improve accuracy.&lt;/p&gt;

&lt;p&gt;Multi-Lingual: It speaks the languages developers love. Whether you prefer openCypher, Apache TinkerPop Gremlin, or SPARQL, Neptune supports them all.&lt;br&gt;
 Where Neptune Fits in the DevOps Lifecycle&lt;br&gt;
Neptune isn't just a storage bucket; it’s a strategic component of your infrastructure:&lt;/p&gt;

&lt;p&gt;Design: You use it when your data model looks more like a spiderweb than a spreadsheet.&lt;/p&gt;

&lt;p&gt;Build: Developers use Neptune SDKs (Java, Python, Node.js) to build features like "People you may know" or "Customers who bought this also liked..."&lt;/p&gt;

&lt;p&gt;Deploy: It integrates perfectly with Terraform or AWS CDK, allowing you to treat your graph database as code.&lt;/p&gt;

&lt;p&gt;Security: It handles the "Sec" in DevSecOps by allowing you to map complex IAM permissions to see exactly how a user might reach a sensitive resource.&lt;/p&gt;

&lt;p&gt;The Bottom Line: Pricing &amp;amp; Access&lt;br&gt;
Amazon Neptune is built for flexibility. You aren't locked into a massive contract; it follows a Pay-as-you-go model.&lt;/p&gt;

&lt;p&gt;Compute: You pay for NCUs (Neptune Capacity Units) per hour.&lt;/p&gt;

&lt;p&gt;Storage: You pay for the actual GBs used (roughly $0.10 per GB).&lt;/p&gt;

&lt;p&gt;Access: You can manage it through the AWS Console, query it via HTTPS endpoints, or explore your data visually using Neptune Notebooks (Jupyter-based).&lt;/p&gt;

&lt;p&gt;Is Neptune Right for Your Next Project?&lt;br&gt;
If your application needs to understand how things are connected—like tracking fraudulent credit card patterns or building a massive recommendation engine—Neptune is the gold standard. However, if you're just storing simple user profiles, a standard RDS or DynamoDB might still be your best friend.&lt;/p&gt;

&lt;p&gt;What are you building next? Are you diving into the world of GraphRAG, or are you sticking with Relational databases for now? Let’s chat in the comments! &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftu554asfe7068ge769k4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftu554asfe7068ge769k4.png" alt=" " width="556" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  AWS #CloudComputing #Database #GraphDB #AmazonNeptune #AI #DevOps
&lt;/h1&gt;

</description>
      <category>programming</category>
      <category>react</category>
      <category>architecture</category>
      <category>learning</category>
    </item>
    <item>
      <title>Beyond Just Monitoring: Why New Relic is a DevSecOps Powerhouse</title>
      <dc:creator>Nidheesh Thangavel</dc:creator>
      <pubDate>Fri, 19 Dec 2025 04:04:07 +0000</pubDate>
      <link>https://dev.to/nidheesh_/beyond-just-monitoring-why-new-relic-is-a-devsecops-powerhouse-1mnm</link>
      <guid>https://dev.to/nidheesh_/beyond-just-monitoring-why-new-relic-is-a-devsecops-powerhouse-1mnm</guid>
      <description>&lt;p&gt;New Relic&lt;br&gt;
At its core, New Relic is an All-in-One Observability Platform. It doesn't just collect data; it correlates it. By gathering "MELT" data (Metrics, Events, Logs, and Traces), it provides a single source of truth for your entire software stack—from the browser your customer is using down to the container running your code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45hjnacua3fpj7ved1t3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45hjnacua3fpj7ved1t3.png" alt=" " width="800" height="395"&gt;&lt;/a&gt;&lt;br&gt;
Key Features You Should Know&lt;br&gt;
APM 360: Gives you a holistic view of your application’s health, including golden signals like latency, traffic, and error rates.&lt;/p&gt;

&lt;p&gt;Security RX: This is the "Sec" in DevSecOps. It provides runtime vulnerability management, telling you which libraries are actually vulnerable while they are running.&lt;/p&gt;

&lt;p&gt;Infrastructure Monitoring: Deep visibility into Kubernetes, AWS, Azure, and on-premise hosts.&lt;/p&gt;

&lt;p&gt;AIOps: Uses machine learning to detect anomalies and group related alerts, preventing the dreaded "alert fatigue."&lt;/p&gt;

&lt;p&gt;How It Fits into DevSecOps&lt;br&gt;
New Relic acts as the continuous feedback loop. In a traditional DevOps flow, you plan, build, and deploy. In DevSecOps, you need to know immediately if a deployment introduced a security flaw or a performance lag.&lt;/p&gt;

&lt;p&gt;New Relic integrates with CI/CD tools (like GitHub Actions) to mark deployments. If your error rate spikes after a "git push," New Relic points to the exact line of code responsible. With Security RX, it shifts security "right" by monitoring production environments for real-time exploits.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>CRUD Operation in MongoDB</title>
      <dc:creator>Nidheesh Thangavel</dc:creator>
      <pubDate>Mon, 06 Oct 2025 16:48:43 +0000</pubDate>
      <link>https://dev.to/nidheesh_/crud-operation-in-mongodb-24gh</link>
      <guid>https://dev.to/nidheesh_/crud-operation-in-mongodb-24gh</guid>
      <description>&lt;p&gt;CRUD Operations in MongoDB&lt;/p&gt;

&lt;p&gt;Tags: #beginners #tutorial #mongodb #database&lt;/p&gt;

&lt;p&gt;MongoDB is a popular NoSQL database used in modern applications. Unlike relational databases, MongoDB stores data in flexible JSON-like documents, which gives you more agility in modeling real-world problems.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll walk through CRUD operations (Create, Read, Update, Delete) in MongoDB using a sample “student database.” We’ll:&lt;/p&gt;

&lt;p&gt;Insert student records&lt;/p&gt;

&lt;p&gt;Query/filter records&lt;/p&gt;

&lt;p&gt;Update documents&lt;/p&gt;

&lt;p&gt;Delete documents&lt;/p&gt;

&lt;p&gt;See how CRUD fits into typical application use&lt;/p&gt;

&lt;p&gt;Let’s get started!&lt;/p&gt;

&lt;p&gt;📦 Setup&lt;/p&gt;

&lt;p&gt;First, set up your MongoDB environment (Atlas / local).&lt;br&gt;
Create a database collegeDB and a collection students (or STUDENTS).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9dbnbzi8yu82bcjqcn5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9dbnbzi8yu82bcjqcn5.png" alt=" " width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create (Insert)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Insert several student documents into the students collection.&lt;/p&gt;

&lt;p&gt;// Paste your code snippet here&lt;br&gt;
{&lt;br&gt;
  student_id: "S001",&lt;br&gt;
  name: "Alice",&lt;br&gt;
  age: 20,&lt;br&gt;
  department: "CSE",&lt;br&gt;
  year: 2,&lt;br&gt;
  cgpa: 9.1&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  student_id: "S002",&lt;br&gt;
  name: "Bob",&lt;br&gt;
  age: 21,&lt;br&gt;
  department: "ECE",&lt;br&gt;
  year: 3,&lt;br&gt;
  cgpa: 8.7&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;// more documents...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte9bkfl2ymlo35o25hm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte9bkfl2ymlo35o25hm1.png" alt=" " width="800" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read (Query)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can query documents using filters. For example:&lt;/p&gt;

&lt;p&gt;// Find all students with CGPA &amp;gt; 8&lt;br&gt;
db.students.find({ cgpa: { $gt: 8 } })&lt;/p&gt;

&lt;p&gt;// Find all students from department "CSE"&lt;br&gt;
db.students.find({ department: "CSE" })&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9gugcgnwcgt6gpbzjfp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9gugcgnwcgt6gpbzjfp.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can update one or many documents. For example:&lt;/p&gt;

&lt;p&gt;// Update a particular student’s CGPA&lt;br&gt;
db.students.updateOne(&lt;br&gt;
  { student_id: "S002" },&lt;br&gt;
  { $set: { cgpa: 9.0 } }&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;// Update multiple students (e.g., increment year)&lt;br&gt;
db.students.updateMany(&lt;br&gt;
  { year: { $lt: 4 } },&lt;br&gt;
  { $inc: { year: 1 } }&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7a4hbzcfnd1qdhpxie1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7a4hbzcfnd1qdhpxie1a.png" alt=" " width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Delete&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can remove documents that match criteria:&lt;/p&gt;

&lt;p&gt;// Delete a specific student record&lt;br&gt;
db.students.deleteOne({ student_id: "S003" });&lt;/p&gt;

&lt;p&gt;// Delete many (e.g., all students in a certain year)&lt;br&gt;
db.students.deleteMany({ year: 4 });&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1n0etcyvv7nbcxvoi4mc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1n0etcyvv7nbcxvoi4mc.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏁 Conclusion&lt;/p&gt;

&lt;p&gt;In this tutorial, we:&lt;/p&gt;

&lt;p&gt;Inserted multiple student records&lt;/p&gt;

&lt;p&gt;Queried/filter documents using conditions&lt;/p&gt;

&lt;p&gt;Updated documents (single &amp;amp; multiple)&lt;/p&gt;

&lt;p&gt;Deleted documents based on criteria&lt;/p&gt;

&lt;p&gt;These CRUD operations are the foundation for most database interactions in applications — whether managing users, products, or content.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>career</category>
      <category>architecture</category>
    </item>
    <item>
      <title>INDEXING - HASHING - AND -QUERY</title>
      <dc:creator>Nidheesh Thangavel</dc:creator>
      <pubDate>Mon, 06 Oct 2025 03:35:10 +0000</pubDate>
      <link>https://dev.to/nidheesh_/indexing-hashing-and-query-3g4l</link>
      <guid>https://dev.to/nidheesh_/indexing-hashing-and-query-3g4l</guid>
      <description>&lt;p&gt;🚀 Indexing, Hashing &amp;amp; Query Optimization in DBMS&lt;/p&gt;

&lt;p&gt;Databases don’t just store data — they also need to retrieve it efficiently.&lt;br&gt;
When you’re dealing with thousands (or millions) of records, querying without proper optimization can slow your system to a crawl.&lt;/p&gt;

&lt;p&gt;That’s where indexing and hashing come into play.&lt;br&gt;
These techniques help databases find data faster, just like how an index helps you locate topics quickly in a book.&lt;/p&gt;

&lt;p&gt;Let’s dive deep into what they are, how they work, and when to use them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fak995bnb59y4d0ywpv4x.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fak995bnb59y4d0ywpv4x.webp" alt=" " width="800" height="636"&gt;&lt;/a&gt;&lt;br&gt;
🧩 What Is Indexing?&lt;/p&gt;

&lt;p&gt;An index is a data structure that improves the speed of data retrieval from a database table.&lt;/p&gt;

&lt;p&gt;Instead of scanning every row to find the required data, the database uses the index to jump directly to the location of the record.&lt;/p&gt;

&lt;p&gt;Think of it as the index page of a book — it doesn’t store the entire content, but points you exactly where to find it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6x4o8prmzm7n6edr7dv7.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6x4o8prmzm7n6edr7dv7.webp" alt=" " width="614" height="715"&gt;&lt;/a&gt;&lt;br&gt;
🔹 Types of Indexing&lt;/p&gt;

&lt;p&gt;Primary Index – Automatically created on the primary key column.&lt;/p&gt;

&lt;p&gt;Secondary Index – Created manually by the user for faster access to non-key attributes.&lt;/p&gt;

&lt;p&gt;Clustering Index – Determines how data is physically stored on disk.&lt;/p&gt;

&lt;p&gt;Non-Clustering Index – Has a separate structure pointing to the physical records.&lt;/p&gt;

&lt;p&gt;⚙️ B-Tree and B+Tree Indexes&lt;/p&gt;

&lt;p&gt;Most modern databases use B-Tree or B+Tree indexing.&lt;/p&gt;

&lt;p&gt;B-Tree Index: Balanced tree structure where both internal and leaf nodes can contain keys and data pointers.&lt;/p&gt;

&lt;p&gt;B+Tree Index: Internal nodes only store keys; actual data is kept in the leaf nodes.&lt;/p&gt;

&lt;p&gt;Leaf nodes are linked, making range queries and sequential scans faster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvj6ybra3tilfte26z1fz.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvj6ybra3tilfte26z1fz.webp" alt=" " width="800" height="656"&gt;&lt;/a&gt;&lt;br&gt;
📘 Use Case: Best for range queries like&lt;/p&gt;

&lt;p&gt;SELECT * FROM students WHERE roll_no BETWEEN 10 AND 50;&lt;/p&gt;

&lt;p&gt;🔢 Hash Indexing&lt;/p&gt;

&lt;p&gt;A hash index uses a hash function to compute the location of a record based on its key.&lt;br&gt;
The hash value determines which “bucket” the record belongs to.&lt;/p&gt;

&lt;p&gt;✅ Best for:&lt;br&gt;
Equality searches like&lt;/p&gt;

&lt;p&gt;SELECT * FROM students WHERE roll_no = 45;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F674hfos36d9lypdf0ka6.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F674hfos36d9lypdf0ka6.webp" alt=" " width="800" height="644"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;❌ Not good for:&lt;br&gt;
Range-based queries or sorting operations (like BETWEEN, &amp;lt;, &amp;gt;).&lt;/p&gt;

&lt;p&gt;📘 Use Case: When your application frequently runs exact-match lookups.&lt;/p&gt;

&lt;p&gt;🧾 Example: Students Table&lt;/p&gt;

&lt;p&gt;Let’s create a sample table to see how indexing helps:&lt;/p&gt;

&lt;p&gt;CREATE TABLE Students (&lt;br&gt;
  roll_no INT PRIMARY KEY,&lt;br&gt;
  name VARCHAR(100),&lt;br&gt;
  age INT,&lt;br&gt;
  grade CHAR(1)&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;Step 1: Create Indexes&lt;br&gt;
-- B-Tree index (default)&lt;br&gt;
CREATE INDEX idx_roll_btree ON Students (roll_no);&lt;/p&gt;

&lt;p&gt;-- Hash index (if supported by your DBMS)&lt;br&gt;
CREATE INDEX idx_roll_hash ON Students USING HASH (roll_no);&lt;/p&gt;

&lt;p&gt;Step 2: Run Queries&lt;br&gt;
-- Equality check (best for hash or B-tree)&lt;br&gt;
SELECT * FROM Students WHERE roll_no = 50;&lt;/p&gt;

&lt;p&gt;-- Range query (best for B-tree or B+Tree)&lt;br&gt;
SELECT * FROM Students WHERE roll_no BETWEEN 10 AND 100;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokoqqm283kr3vqurtgbl.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokoqqm283kr3vqurtgbl.webp" alt=" " width="800" height="667"&gt;&lt;/a&gt;&lt;br&gt;
👉 The B-Tree index handles both cases efficiently,&lt;br&gt;
while the hash index excels only in equality lookups.&lt;/p&gt;

&lt;p&gt;📊 When to Use Which Index&lt;br&gt;
Use Case    Best Index  Reason&lt;br&gt;
Equality lookups (=)    Hash or B-Tree  Hash is fastest for exact matches&lt;br&gt;
Range queries   B-Tree / B+Tree Maintains sorted order&lt;br&gt;
Sequential access   B+Tree  Linked leaf nodes improve performance&lt;br&gt;
Memory optimization Minimal indexing    Too many indexes slow down inserts/updates&lt;br&gt;
⚠️ Important Considerations&lt;/p&gt;

&lt;p&gt;Storage Overhead: Every index consumes additional space.&lt;/p&gt;

&lt;p&gt;Write Performance: More indexes = slower INSERT, UPDATE, DELETE.&lt;/p&gt;

&lt;p&gt;Low-Cardinality Columns: Avoid indexing columns with few unique values (e.g., gender, status).&lt;/p&gt;

&lt;p&gt;Maintenance: Indexes can fragment over time and may need rebuilding.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fknn0vlrsdczeflw5qacp.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fknn0vlrsdczeflw5qacp.webp" alt=" " width="800" height="670"&gt;&lt;/a&gt;&lt;br&gt;
🧠 Query Optimization&lt;/p&gt;

&lt;p&gt;Indexes are one of the most effective tools for query optimization.&lt;br&gt;
But you can combine them with:&lt;/p&gt;

&lt;p&gt;Query planning: Use EXPLAIN to analyze how queries execute.&lt;/p&gt;

&lt;p&gt;Proper filtering: Avoid SELECT *; fetch only what’s needed.&lt;/p&gt;

&lt;p&gt;Composite indexes: Combine multiple columns in one index for common query patterns.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8hs585jsoh27v6q3t5f.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8hs585jsoh27v6q3t5f.webp" alt=" " width="800" height="702"&gt;&lt;/a&gt;&lt;br&gt;
✅ Summary&lt;br&gt;
Concept Description&lt;br&gt;
Indexing    Data structure for faster lookups&lt;br&gt;
B-Tree / B+Tree Supports ordering and range queries&lt;br&gt;
Hash Indexing   Best for equality checks&lt;br&gt;
Query Optimization  Uses indexes and execution plans for efficiency&lt;br&gt;
🚀 Final Thoughts&lt;/p&gt;

&lt;p&gt;Efficient indexing and query design are what make large-scale applications fast and reliable.&lt;br&gt;
Understanding how and when to use B-Tree or Hash indexes can significantly improve your database performance.&lt;/p&gt;

&lt;p&gt;Start small — analyze your queries, create the right indexes, and monitor performance.&lt;br&gt;
A few thoughtful indexes can turn your slowest queries into instant results.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>database</category>
      <category>learning</category>
    </item>
    <item>
      <title>Transactions, Deadlocks &amp; Log Based Recovery</title>
      <dc:creator>Nidheesh Thangavel</dc:creator>
      <pubDate>Mon, 06 Oct 2025 03:28:00 +0000</pubDate>
      <link>https://dev.to/nidheesh_/transactions-deadlocks-log-based-recovery-20bm</link>
      <guid>https://dev.to/nidheesh_/transactions-deadlocks-log-based-recovery-20bm</guid>
      <description>&lt;p&gt;💾 Understanding Transactions, Deadlocks &amp;amp; Log-Based Recovery in DBMS&lt;/p&gt;

&lt;p&gt;Databases are the backbone of modern applications — from banking and e-commerce to social networks. For a system to be reliable, it must handle multiple users, ensure data integrity, and recover gracefully from failures.&lt;/p&gt;

&lt;p&gt;In this post, we’ll explore three key concepts that make this possible: Transactions, Deadlocks, and Log-Based Recovery.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xy2dlq70ejfulwwslbj.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xy2dlq70ejfulwwslbj.webp" alt=" " width="800" height="388"&gt;&lt;/a&gt;&lt;br&gt;
🔄 What Is a Transaction?&lt;/p&gt;

&lt;p&gt;A transaction in a Database Management System (DBMS) is a sequence of operations performed as a single logical unit of work.&lt;br&gt;
The transaction must follow the ACID properties — Atomicity, Consistency, Isolation, and Durability.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fart2jk86s5kowmg3uera.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fart2jk86s5kowmg3uera.webp" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;br&gt;
In simple terms:&lt;/p&gt;

&lt;p&gt;Either all operations of a transaction are successfully executed, or none of them take effect.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwe8fnm6zghyql7wjckp.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwe8fnm6zghyql7wjckp.webp" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;br&gt;
✳️ Example&lt;/p&gt;

&lt;p&gt;Let’s take a simple bank transfer:&lt;/p&gt;

&lt;p&gt;Debit ₹1000 from Account A&lt;/p&gt;

&lt;p&gt;Credit ₹1000 to Account B&lt;/p&gt;

&lt;p&gt;If either step fails, the transaction should rollback to its previous state — ensuring data accuracy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1l0xw6egg9e77c13m361.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1l0xw6egg9e77c13m361.webp" alt=" " width="800" height="388"&gt;&lt;/a&gt;&lt;br&gt;
⚙️ Concurrency &amp;amp; Deadlocks&lt;/p&gt;

&lt;p&gt;In multi-user environments, multiple transactions may access the same data simultaneously. To maintain correctness, databases use locks to control access.&lt;/p&gt;

&lt;p&gt;But sometimes, this leads to a problem called a Deadlock.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0v8xeumaxinx9djcc4b.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0v8xeumaxinx9djcc4b.webp" alt=" " width="800" height="384"&gt;&lt;/a&gt;&lt;br&gt;
🧩 What Is a Deadlock?&lt;/p&gt;

&lt;p&gt;A deadlock occurs when two or more transactions are waiting indefinitely for each other to release locks.&lt;/p&gt;

&lt;p&gt;Example Scenario&lt;/p&gt;

&lt;p&gt;Transaction T1 locks Row A and waits for Row B&lt;/p&gt;

&lt;p&gt;Transaction T2 locks Row B and waits for Row A&lt;/p&gt;

&lt;p&gt;Both are waiting forever — creating a deadlock!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8mfuvlyp9oravkd9ms1p.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8mfuvlyp9oravkd9ms1p.webp" alt=" " width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
💡 Deadlock Handling Strategies&lt;/p&gt;

&lt;p&gt;Databases use different approaches to detect and resolve deadlocks:&lt;/p&gt;

&lt;p&gt;Timeouts: Abort a transaction if it waits too long.&lt;/p&gt;

&lt;p&gt;Wait-For Graphs: Detect cycles and terminate one transaction.&lt;/p&gt;

&lt;p&gt;Consistent Resource Ordering: Access resources in a predefined order to prevent cycles.&lt;/p&gt;

&lt;p&gt;A typical MySQL error might look like this:&lt;/p&gt;

&lt;p&gt;ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffyin6rmriktkf9ipfexp.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffyin6rmriktkf9ipfexp.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
🧾 Log-Based Recovery&lt;/p&gt;

&lt;p&gt;What happens if a system crashes in the middle of a transaction?&lt;/p&gt;

&lt;p&gt;This is where log-based recovery comes in.&lt;/p&gt;

&lt;p&gt;📘 What Is a Log?&lt;/p&gt;

&lt;p&gt;A log file records all modifications made by transactions.&lt;br&gt;
Before any change is applied to the database, the action is written to the log — a principle called Write-Ahead Logging (WAL).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg7x34ezhgvzsnnw8pna3.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg7x34ezhgvzsnnw8pna3.webp" alt=" " width="800" height="388"&gt;&lt;/a&gt;&lt;br&gt;
🔁 Recovery Using Logs&lt;/p&gt;

&lt;p&gt;After a crash:&lt;/p&gt;

&lt;p&gt;Undo (Rollback): Revert the effects of incomplete transactions.&lt;/p&gt;

&lt;p&gt;Redo: Reapply the effects of committed transactions not yet saved to disk.&lt;/p&gt;

&lt;p&gt;This ensures data durability and atomicity — even after system failures.&lt;/p&gt;

&lt;p&gt;✅ Summary&lt;br&gt;
Concept Description&lt;br&gt;
Transaction A logical unit of work that must be fully completed or fully undone.&lt;br&gt;
Deadlock    A situation where transactions wait indefinitely for each other’s resources.&lt;br&gt;
Log-Based Recovery  A mechanism to recover the database after a failure using transaction logs.&lt;br&gt;
🚀 Final Thoughts&lt;/p&gt;

&lt;p&gt;Understanding how transactions, deadlocks, and recovery mechanisms work is crucial for database professionals and developers alike.&lt;br&gt;
These core principles ensure that our systems remain reliable, consistent, and fault-tolerant — even under heavy load or unexpected crashes.&lt;/p&gt;

</description>
      <category>database</category>
      <category>computerscience</category>
      <category>beginners</category>
      <category>architecture</category>
    </item>
    <item>
      <title>ACID Properties in DBMS</title>
      <dc:creator>Nidheesh Thangavel</dc:creator>
      <pubDate>Mon, 06 Oct 2025 03:19:12 +0000</pubDate>
      <link>https://dev.to/nidheesh_/acid-properties-in-dbms-495h</link>
      <guid>https://dev.to/nidheesh_/acid-properties-in-dbms-495h</guid>
      <description>&lt;p&gt;ACID Properties in DBMS: Ensuring Reliable Database Transactions&lt;/p&gt;

&lt;p&gt;Databases underpin nearly every software application we use — from e-commerce platforms to banking systems. To maintain integrity, consistency, and reliability, they adhere to the ACID properties: Atomicity, Consistency, Isolation, and Durability.&lt;/p&gt;

&lt;p&gt;Below is a cleaner, revised version you can post:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9a0hfrv7xyhd4hq29cw5.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9a0hfrv7xyhd4hq29cw5.webp" alt=" " width="800" height="509"&gt;&lt;/a&gt;&lt;br&gt;
🧩 Introduction&lt;/p&gt;

&lt;p&gt;A database powers critical operations in nearly every system. When multiple users or processes interact concurrently—or when failures happen—how do we ensure data remains correct and resilient? That’s where ACID properties come in.&lt;/p&gt;

&lt;p&gt;📋 ACID Explained&lt;/p&gt;

&lt;p&gt;Let’s break down each guarantee:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte5cgy3ei6jdm6bmv9c1.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte5cgy3ei6jdm6bmv9c1.webp" alt=" " width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Atomicity&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A transaction is treated as a single unit of work: either everything succeeds or nothing happens. If any part of the transaction fails, the entire transaction is rolled back to its prior state.&lt;/p&gt;

&lt;p&gt;E.g. transferring money: if debit succeeds but credit fails, the entire operation is rolled back.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsij4ei2vki7ooyvji6sf.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsij4ei2vki7ooyvji6sf.webp" alt=" " width="800" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Consistency&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The database transitions from one valid state to another. Any constraints, rules, or validations must hold before and after the transaction.&lt;/p&gt;

&lt;p&gt;No invalid data should ever be committed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3me9iakc3mn4ez7uncov.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3me9iakc3mn4ez7uncov.webp" alt=" " width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Isolation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Even when multiple transactions run concurrently, they shouldn’t interfere with each other’s intermediate steps. One transaction should not see the partial results of another.&lt;/p&gt;

&lt;p&gt;Prevents “dirty reads,” “non-repeatable reads,” etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3608iyax50lqk5vliq8y.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3608iyax50lqk5vliq8y.webp" alt=" " width="800" height="584"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Durability&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once a transaction is committed, the results must persist—even if the system crashes immediately afterward.&lt;/p&gt;

&lt;p&gt;Data is stored reliably (e.g. on disk), ensuring it’s not lost.&lt;/p&gt;

&lt;p&gt;🛠️ Example (Simplified)&lt;/p&gt;

&lt;p&gt;Imagine a Loans table. You start a transaction:&lt;/p&gt;

&lt;p&gt;Atomicity — If updating loan details fails midway, roll back everything.&lt;/p&gt;

&lt;p&gt;Consistency — Ensure new values meet business rules, e.g. interest rate bounds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhcci3rwnphgx4td9db6e.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhcci3rwnphgx4td9db6e.webp" alt=" " width="800" height="543"&gt;&lt;/a&gt;&lt;br&gt;
Isolation — If another transaction is also updating the same record, one should wait so they don’t clash.&lt;/p&gt;

&lt;p&gt;Durability — After committing, the data should survive crashes, hardware failures, or reboots.&lt;/p&gt;

&lt;p&gt;✅ Why ACID Matters&lt;/p&gt;

&lt;p&gt;Guarantees data integrity even under concurrent access&lt;/p&gt;

&lt;p&gt;Offers fault tolerance in case of partial failures&lt;/p&gt;

&lt;p&gt;Builds trust in systems handling sensitive data (e.g. financial, healthcare)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9se34lmmz2au542llnqg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9se34lmmz2au542llnqg.webp" alt=" " width="800" height="549"&gt;&lt;/a&gt;&lt;br&gt;
When databases strictly enforce ACID, they become robust backbones for any reliable application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomedoo5n0sjrt7dzec13.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomedoo5n0sjrt7dzec13.webp" alt=" " width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjd6ejrs518h89qdkmx4i.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjd6ejrs518h89qdkmx4i.webp" alt=" " width="800" height="509"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0h481vke9htrt894kwx.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0h481vke9htrt894kwx.webp" alt=" " width="800" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>database</category>
    </item>
    <item>
      <title>Cursor +Trigger</title>
      <dc:creator>Nidheesh Thangavel</dc:creator>
      <pubDate>Sun, 05 Oct 2025 16:42:09 +0000</pubDate>
      <link>https://dev.to/nidheesh_/cursor-trigger-3if8</link>
      <guid>https://dev.to/nidheesh_/cursor-trigger-3if8</guid>
      <description>&lt;p&gt;💡 Cursor &amp;amp; Trigger: How They Work in SQL&lt;/p&gt;

&lt;p&gt;In this post, we’ll dive into two powerful features in SQL and relational databases: cursors and triggers. You’ll see examples and learn how and when to use them.&lt;/p&gt;

&lt;p&gt;🧭 What Are Cursors?&lt;/p&gt;

&lt;p&gt;A cursor allows you to process query results row by row. Sometimes you need to iterate through each record individually rather than handling the entire result set at once.&lt;/p&gt;

&lt;p&gt;Cursor Use Case Example&lt;/p&gt;

&lt;p&gt;Suppose you want to fetch names of employees whose salary is over 50,000 and print them one by one.&lt;/p&gt;

&lt;p&gt;CREATE TABLE Employee (&lt;br&gt;
  EmpID INT PRIMARY KEY,&lt;br&gt;
  EmpName VARCHAR(50),&lt;br&gt;
  Salary INT&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;INSERT INTO Employee VALUES&lt;br&gt;
 (1, 'Arjun', 45000),&lt;br&gt;
 (2, 'Priya', 60000),&lt;br&gt;
 (3, 'Kiran', 75000),&lt;br&gt;
 (4, 'Meera', 48000),&lt;br&gt;
 (5, 'Rahul', 90000);&lt;/p&gt;

&lt;p&gt;Now, the cursor logic:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff91dhdu8vzy8s1wrcfq9.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff91dhdu8vzy8s1wrcfq9.webp" alt=" " width="800" height="617"&gt;&lt;/a&gt;&lt;br&gt;
DECLARE&lt;br&gt;
  CURSOR high_salary_cursor IS&lt;br&gt;
    SELECT EmpName &lt;br&gt;
    FROM Employee &lt;br&gt;
    WHERE Salary &amp;gt; 50000;&lt;br&gt;
  v_name Employee.EmpName%TYPE;&lt;br&gt;
BEGIN&lt;br&gt;
  OPEN high_salary_cursor;&lt;br&gt;
  LOOP&lt;br&gt;
    FETCH high_salary_cursor INTO v_name;&lt;br&gt;
    EXIT WHEN high_salary_cursor%NOTFOUND;&lt;br&gt;
    DBMS_OUTPUT.PUT_LINE('Employee: ' || v_name);&lt;br&gt;
  END LOOP;&lt;br&gt;
  CLOSE high_salary_cursor;&lt;br&gt;
END;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bn2tlcgcbzk2fomtk24.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bn2tlcgcbzk2fomtk24.webp" alt=" " width="800" height="638"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We declare a cursor that selects employee names with salary over 50,000.&lt;/p&gt;

&lt;p&gt;Each loop iteration, FETCH retrieves one row into v_name.&lt;/p&gt;

&lt;p&gt;The loop stops when there are no more rows (%NOTFOUND).&lt;/p&gt;

&lt;p&gt;We print each employee name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6hu1dvcp1e9mweubjb8m.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6hu1dvcp1e9mweubjb8m.webp" alt=" " width="800" height="626"&gt;&lt;/a&gt;&lt;br&gt;
🔔 What Are Triggers?&lt;/p&gt;

&lt;p&gt;A trigger is an automated procedure that fires in response to certain events on a table (INSERT, UPDATE, DELETE). You can use triggers to enforce rules, maintain audit logs, or propagate changes.&lt;/p&gt;

&lt;p&gt;Trigger Use Case Example: Logging Insertions&lt;/p&gt;

&lt;p&gt;Let’s maintain an audit trail so that whenever a new student is added, we log it into a separate audit table.&lt;/p&gt;

&lt;p&gt;-- Base table for students&lt;br&gt;
CREATE TABLE Students (&lt;br&gt;
  StudentID VARCHAR(10) PRIMARY KEY,&lt;br&gt;
  StudentName VARCHAR(50)&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;-- Audit table to record insert events&lt;br&gt;
CREATE TABLE Student_Audit (&lt;br&gt;
  AuditID INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,&lt;br&gt;
  StudentID VARCHAR(10),&lt;br&gt;
  StudentName VARCHAR(50),&lt;br&gt;
  ActionDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbfc8lncr94n37ab43ff.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbfc8lncr94n37ab43ff.webp" alt=" " width="800" height="631"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Trigger definition:&lt;/p&gt;

&lt;p&gt;CREATE OR REPLACE TRIGGER student_insert_audit&lt;br&gt;
AFTER INSERT ON Students&lt;br&gt;
FOR EACH ROW&lt;br&gt;
BEGIN&lt;br&gt;
  INSERT INTO Student_Audit (StudentID, StudentName)&lt;br&gt;
  VALUES (:NEW.StudentID, :NEW.StudentName);&lt;br&gt;
END;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26iwoalh1rid3pulshfv.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26iwoalh1rid3pulshfv.webp" alt=" " width="800" height="646"&gt;&lt;/a&gt;&lt;br&gt;
AFTER INSERT ON Students means the trigger fires after each insertion.&lt;/p&gt;

&lt;p&gt;FOR EACH ROW ensures it acts for every new record.&lt;/p&gt;

&lt;p&gt;:NEW.StudentID and :NEW.StudentName refer to the values of the new row.&lt;/p&gt;

&lt;p&gt;When you insert:&lt;/p&gt;

&lt;p&gt;INSERT INTO Students VALUES ('S01', 'Arjun');&lt;br&gt;
INSERT INTO Students VALUES ('S02', 'Priya');&lt;br&gt;
INSERT INTO Students VALUES ('S03', 'Kiran');&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbaszykncb881vymv4gny.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbaszykncb881vymv4gny.webp" alt=" " width="800" height="624"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;p&gt;SELECT * FROM Student_Audit;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgn3ebuv2cbygbeu8z25.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgn3ebuv2cbygbeu8z25.webp" alt=" " width="800" height="209"&gt;&lt;/a&gt;&lt;br&gt;
You’ll see entries in the audit table corresponding to each student insertion with timestamps.&lt;/p&gt;

&lt;p&gt;📋 Key Takeaways&lt;/p&gt;

&lt;p&gt;Cursor: Useful for row-by-row processing when you need finer control over each record.&lt;/p&gt;

&lt;p&gt;Trigger: Useful for automating actions in response to data changes (e.g. logging, enforcing constraints).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1r0v2dsylx6p84q2fjf8.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1r0v2dsylx6p84q2fjf8.webp" alt=" " width="800" height="639"&gt;&lt;/a&gt;&lt;br&gt;
Used wisely, cursors and triggers can greatly enhance what you can do within SQL beyond simple queries.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>sql</category>
    </item>
    <item>
      <title>Database Normalization: From 1NF to 3NF</title>
      <dc:creator>Nidheesh Thangavel</dc:creator>
      <pubDate>Sun, 05 Oct 2025 16:31:33 +0000</pubDate>
      <link>https://dev.to/nidheesh_/database-normalization-from-1nf-to-3nf-1gm6</link>
      <guid>https://dev.to/nidheesh_/database-normalization-from-1nf-to-3nf-1gm6</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyuy6dlq4vg2oy6wcw8ky.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyuy6dlq4vg2oy6wcw8ky.webp" alt=" " width="800" height="580"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F408k8m63j1yzpipeuvm0.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F408k8m63j1yzpipeuvm0.webp" alt=" " width="800" height="593"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ofz574j9gcqg48tjyrd.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ofz574j9gcqg48tjyrd.webp" alt=" " width="800" height="625"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxvx2ipaysq1mkq9yzqvj.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxvx2ipaysq1mkq9yzqvj.webp" alt=" " width="800" height="648"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faahqwznbfvncu5r5e1sj.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faahqwznbfvncu5r5e1sj.webp" alt=" " width="800" height="623"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcl4jkark3jbvd2gxf1qb.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcl4jkark3jbvd2gxf1qb.webp" alt=" " width="800" height="591"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc1u31gqp8ux0ha8k3vl3.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc1u31gqp8ux0ha8k3vl3.webp" alt=" " width="800" height="595"&gt;&lt;/a&gt;🧠 Database Normalization: From 1NF to 3NF Explained Simply&lt;/p&gt;

&lt;p&gt;If you’ve ever worked with relational databases, you know how quickly things can get messy when data isn’t properly organized. That’s where normalization comes in — a systematic way of structuring data to minimize redundancy and maintain integrity.&lt;/p&gt;

&lt;p&gt;In this post, we’ll walk through the process of normalization from First Normal Form (1NF) to Third Normal Form (3NF) with simple explanations and examples.&lt;/p&gt;

&lt;p&gt;🔍 What Is Database Normalization?&lt;/p&gt;

&lt;p&gt;Normalization is the process of organizing database columns (attributes) and tables (relations) to ensure data consistency and reduce duplication.&lt;/p&gt;

&lt;p&gt;The main goals are:&lt;/p&gt;

&lt;p&gt;Avoid storing the same data more than once&lt;/p&gt;

&lt;p&gt;Make data easier to update, insert, and delete&lt;/p&gt;

&lt;p&gt;Ensure logical data relationships&lt;/p&gt;

&lt;p&gt;🚫 The Problem: An Unnormalized Table&lt;/p&gt;

&lt;p&gt;Imagine a table storing student information, courses, and instructors like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2zd5gdckg5n52a9d2u1o.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2zd5gdckg5n52a9d2u1o.webp" alt=" " width="800" height="621"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks fine at first — but this design leads to serious anomalies:&lt;/p&gt;

&lt;p&gt;Insertion anomaly: Can’t add a new student unless they’re taking a course&lt;/p&gt;

&lt;p&gt;Update anomaly: Changing an instructor’s phone number requires multiple edits&lt;/p&gt;

&lt;p&gt;Deletion anomaly: Removing a student’s last course deletes their entire record&lt;/p&gt;

&lt;p&gt;✅ First Normal Form (1NF): Atomic Data&lt;/p&gt;

&lt;p&gt;To achieve 1NF, we ensure that:&lt;/p&gt;

&lt;p&gt;Each cell contains a single value (no lists or multiple values).&lt;/p&gt;

&lt;p&gt;Each record is unique.&lt;/p&gt;

&lt;p&gt;So, we split repeating data into multiple rows. Every column now holds atomic values — indivisible pieces of information.&lt;/p&gt;

&lt;p&gt;🧩 Second Normal Form (2NF): Remove Partial Dependencies&lt;/p&gt;

&lt;p&gt;1NF removes repeating groups, but partial dependency can still exist when a column depends on part of a composite primary key.&lt;/p&gt;

&lt;p&gt;To fix this:&lt;/p&gt;

&lt;p&gt;Create separate tables for Students, Courses, and Instructors.&lt;/p&gt;

&lt;p&gt;Ensure that every non-key attribute depends on the whole key, not part of it.&lt;/p&gt;

&lt;p&gt;Now, our relationships are more structured and clear.&lt;/p&gt;

&lt;p&gt;🔄 Third Normal Form (3NF): Remove Transitive Dependencies&lt;/p&gt;

&lt;p&gt;In 3NF, we eliminate transitive dependencies — when a non-key column depends on another non-key column.&lt;/p&gt;

&lt;p&gt;For instance, InstructorPhone depends on Instructor, not on Course.&lt;br&gt;
So, we move instructor details into a separate table.&lt;/p&gt;

&lt;p&gt;🏗️ Final Normalized Structure&lt;/p&gt;

&lt;p&gt;After normalization up to 3NF, our tables look like this:&lt;/p&gt;

&lt;p&gt;Students&lt;br&gt;
| StudentID | StudentName |&lt;/p&gt;

&lt;p&gt;Instructors&lt;br&gt;
| InstructorID | InstructorName | InstructorPhone |&lt;/p&gt;

&lt;p&gt;Courses&lt;br&gt;
| CourseID | CourseName | InstructorID |&lt;/p&gt;

&lt;p&gt;StudentCourses&lt;br&gt;
| StudentID | CourseID |&lt;/p&gt;

&lt;p&gt;This design:&lt;/p&gt;

&lt;p&gt;Eliminates redundancy&lt;/p&gt;

&lt;p&gt;Prevents update anomalies&lt;/p&gt;

&lt;p&gt;Makes queries and maintenance cleaner and faster&lt;/p&gt;

&lt;p&gt;🧾 Summary&lt;br&gt;
Normal Form Goal    Key Action&lt;br&gt;
1NF Atomic data Remove repeating groups&lt;br&gt;
2NF Full functional dependency  Remove partial dependencies&lt;br&gt;
3NF Transitive dependency removal   Separate related data into new tables&lt;br&gt;
THE INPUT AND OUTPUT SCHREENSHOTS:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftimz7mvprnjb6t3x56hk.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftimz7mvprnjb6t3x56hk.webp" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fums4naj3djknucwg7yxf.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fums4naj3djknucwg7yxf.webp" alt=" " width="800" height="588"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6miagry17e69n4zsb0bd.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6miagry17e69n4zsb0bd.webp" alt=" " width="800" height="622"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmog2ymb7kcvlffmel5o.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmog2ymb7kcvlffmel5o.webp" alt=" " width="800" height="587"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvpbit1yla8cupdxjcaqv.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvpbit1yla8cupdxjcaqv.webp" alt=" " width="800" height="623"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flka3kr6dtbvyp1nlaxic.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flka3kr6dtbvyp1nlaxic.webp" alt=" " width="800" height="593"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn7z2kwb4wy4bc87zgvie.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn7z2kwb4wy4bc87zgvie.webp" alt=" " width="800" height="628"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>backend</category>
    </item>
    <item>
      <title>COLLEGE STUDENT &amp; COURSE MANAGEMENT SYSTEM WITH ORACLE LIVE SQL</title>
      <dc:creator>Nidheesh Thangavel</dc:creator>
      <pubDate>Thu, 21 Aug 2025 06:17:21 +0000</pubDate>
      <link>https://dev.to/nidheesh_/college-student-course-management-system-with-oracle-live-sql-237a</link>
      <guid>https://dev.to/nidheesh_/college-student-course-management-system-with-oracle-live-sql-237a</guid>
      <description>&lt;p&gt;🚀 My Journey with SQL on Oracle LiveSQL | Assignment Practice&lt;/p&gt;

&lt;p&gt;As part of my DBMS assignment, I decided to go hands-on with Oracle LiveSQL and practice real-world SQL queries. What started as just another task turned into an exciting journey of creating tables, inserting data, altering structures, and running some powerful queries. Let me walk you through my experience!&lt;/p&gt;

&lt;p&gt;🏗 Step 1: Creating Tables&lt;/p&gt;

&lt;p&gt;I began with three main tables:&lt;/p&gt;

&lt;p&gt;Students – to store student details&lt;/p&gt;

&lt;p&gt;Courses – to hold course information&lt;/p&gt;

&lt;p&gt;Enrollments – to manage the many-to-many relationship between students and courses&lt;/p&gt;

&lt;p&gt;CREATE TABLE Students (&lt;br&gt;
    StudentID NUMBER PRIMARY KEY,&lt;br&gt;
    Name VARCHAR2(50) NOT NULL,&lt;br&gt;
    Dept VARCHAR2(30),&lt;br&gt;
    DOB DATE,&lt;br&gt;
    Email VARCHAR2(50) UNIQUE&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;CREATE TABLE Courses (&lt;br&gt;
    CourseID NUMBER PRIMARY KEY,&lt;br&gt;
    CourseName VARCHAR2(50) NOT NULL,&lt;br&gt;
    Credits NUMBER(2)&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;CREATE TABLE Enrollments (&lt;br&gt;
    EnrollID NUMBER PRIMARY KEY,&lt;br&gt;
    StudentID NUMBER REFERENCES Students(StudentID),&lt;br&gt;
    CourseID NUMBER REFERENCES Courses(CourseID),&lt;br&gt;
    Grade CHAR(2)&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;📸 Screenshot proof of successful table creation:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3rdlkt4g731y0bxrh84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3rdlkt4g731y0bxrh84.png" alt=" " width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✍️ Step 2: Altering &amp;amp; Inserting Data&lt;/p&gt;

&lt;p&gt;Next, I added a Phone Number column to the Students table and inserted some sample data.&lt;/p&gt;

&lt;p&gt;ALTER TABLE Students ADD (PhoneNo VARCHAR2(10));&lt;/p&gt;

&lt;p&gt;INSERT INTO Students (StudentID, Name, Dept, DOB, Email) VALUES&lt;br&gt;
(1, 'Alice', 'Computer Science', DATE '2002-07-08', '&lt;a href="mailto:alice@example.com"&gt;alice@example.com&lt;/a&gt;'),&lt;br&gt;
(2, 'Bob', 'Electrical', DATE '2001-05-12', '&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt;'),&lt;br&gt;
(3, 'Charlie', 'Mechanical', DATE '2003-09-21', '&lt;a href="mailto:charlie@example.com"&gt;charlie@example.com&lt;/a&gt;');&lt;/p&gt;

&lt;p&gt;📸 Screenshot proof of inserted rows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fentcejy5b7zkvn2ir4mk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fentcejy5b7zkvn2ir4mk.png" alt=" " width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fki8bzwwxfm3ww29kuo0d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fki8bzwwxfm3ww29kuo0d.png" alt=" " width="800" height="375"&gt;&lt;/a&gt;&lt;br&gt;
🔎 Step 3: Running Queries&lt;br&gt;
🔠 String Functions&lt;/p&gt;

&lt;p&gt;I queried all student names in uppercase and calculated the length of their email IDs:&lt;/p&gt;

&lt;p&gt;SELECT UPPER(Name) AS StudentName, LENGTH(Email) AS EmailLength&lt;br&gt;
FROM Students;&lt;/p&gt;

&lt;p&gt;✅ Output:&lt;/p&gt;

&lt;p&gt;STUDENTNAME EMAILLENGTH&lt;br&gt;
ALICE   17&lt;br&gt;
BOB 15&lt;br&gt;
CHARLIE 19&lt;/p&gt;

&lt;p&gt;📸 Screenshot of results:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr7x24f5onlim0hl4jkus.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr7x24f5onlim0hl4jkus.png" alt=" " width="800" height="379"&gt;&lt;/a&gt;&lt;br&gt;
📊 Aggregate Functions&lt;/p&gt;

&lt;p&gt;I also tried aggregate functions to calculate the average credits of courses and the total number of students:&lt;/p&gt;

&lt;p&gt;SELECT AVG(Credits) AS AvgCredits, COUNT(*) AS TotalStudents&lt;br&gt;
FROM Courses, Students;&lt;/p&gt;

&lt;p&gt;📸 Screenshot output:&lt;/p&gt;

&lt;p&gt;💡 Key Takeaways&lt;/p&gt;

&lt;p&gt;SQL is more powerful than it looks – even small queries give deep insights.&lt;/p&gt;

&lt;p&gt;Working with constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK) is essential for maintaining data integrity.&lt;/p&gt;

&lt;p&gt;Oracle LiveSQL is a fantastic tool for learning + testing SQL without needing local installation.&lt;/p&gt;

&lt;p&gt;🎯 What’s Next?&lt;/p&gt;

&lt;p&gt;This was just the beginning! My next steps will include:&lt;/p&gt;

&lt;p&gt;JOIN queries to link Students and Courses.&lt;/p&gt;

&lt;p&gt;GROUP BY with HAVING for department-wise insights.&lt;/p&gt;

&lt;p&gt;Views &amp;amp; Stored Procedures to wrap logic neatly.&lt;/p&gt;

&lt;p&gt;Stay tuned for Part 2 of my SQL journey 🔥&lt;/p&gt;

</description>
      <category>queryverse</category>
      <category>datacraft</category>
      <category>tabletalk</category>
      <category>sqlify</category>
    </item>
  </channel>
</rss>
