<?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: Hareesh</title>
    <description>The latest articles on DEV Community by Hareesh (@hareesh_e8fcfb0dd54290b4d).</description>
    <link>https://dev.to/hareesh_e8fcfb0dd54290b4d</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%2F3458110%2Fdd13cae3-fa61-491b-b1ba-8139ca0a845e.png</url>
      <title>DEV Community: Hareesh</title>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hareesh_e8fcfb0dd54290b4d"/>
    <language>en</language>
    <item>
      <title>“AZ-305 Explained: Designing Microsoft Azure Infrastructure Solutions”</title>
      <dc:creator>Hareesh</dc:creator>
      <pubDate>Mon, 22 Dec 2025 03:30:09 +0000</pubDate>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d/az-305-explained-designing-microsoft-azure-infrastructure-solutions-43pd</link>
      <guid>https://dev.to/hareesh_e8fcfb0dd54290b4d/az-305-explained-designing-microsoft-azure-infrastructure-solutions-43pd</guid>
      <description>&lt;p&gt;📌 &lt;strong&gt;Overview of the Tool / Exam&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Designing Microsoft Azure Infrastructure Solutions (AZ-305)&lt;/strong&gt; is a &lt;strong&gt;Microsoft certification exam&lt;/strong&gt; for cloud and infrastructure architects. It measures your ability to &lt;strong&gt;design Azure solutions&lt;/strong&gt; that address identity, governance, monitoring, storage, networking, business continuity, and infrastructure as a whole. Passing this exam contributes to the &lt;strong&gt;Microsoft Certified: Azure Solutions Architect Expert&lt;/strong&gt; certification. &lt;/p&gt;

&lt;p&gt;Unlike traditional software tools, &lt;strong&gt;AZ-305 is an exam&lt;/strong&gt; that validates skills in designing and planning Azure infrastructure solutions rather than a specific piece of software.&lt;/p&gt;

&lt;p&gt;⭐ &lt;strong&gt;Key Features / Skills Covered&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The AZ-305 exam tests competencies across multiple architectural design areas:&lt;/p&gt;

&lt;p&gt;🧠 &lt;strong&gt;Core Skill Domains&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Design identity, governance, and monitoring solutions&lt;/strong&gt; – secure access, policies, logs, metrics. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design data storage solutions&lt;/strong&gt; – relational &amp;amp; non-relational storage strategies. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design business continuity and disaster recovery solutions&lt;/strong&gt; – high availability, backups. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design infrastructure solutions&lt;/strong&gt; – compute, network connectivity, application architectures, migrations. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These areas ensure you can architect complete Azure solutions that are secure, resilient, performant, and aligned with business needs.&lt;/p&gt;

&lt;p&gt;🔁 &lt;strong&gt;How It Fits into DevOps / DevSecOps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Although &lt;strong&gt;AZ-305 is not a DevOps tool&lt;/strong&gt;, it strongly connects to &lt;strong&gt;DevOps and DevSecOps practices&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;🛠️ &lt;strong&gt;DevOps Alignment&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Focus on &lt;strong&gt;Infrastructure as Code (IaC)&lt;/strong&gt; — designing infrastructure that can be automated and deployed consistently. ([examcollection.com][3])&lt;/li&gt;
&lt;li&gt;Supports architects working with CI/CD pipelines and DevOps teams to deliver solutions that integrate with Azure DevOps or GitHub Actions for automated rollouts. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔐 &lt;strong&gt;DevSecOps Alignment&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security and governance are explicitly tested (identity, access, policy). ([Microsoft Learn][1])&lt;/li&gt;
&lt;li&gt;Ensures designs embed &lt;strong&gt;security best practices&lt;/strong&gt;, continuous compliance with policies, and resilience against threats. ([examcollection.com][3])&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So &lt;strong&gt;AZ-305 complements DevOps/DevSecOps processes&lt;/strong&gt; by validating the architectural skills needed to design secure, reliable, and automated cloud infrastructure.&lt;/p&gt;

&lt;p&gt;💻 &lt;strong&gt;Programming Language&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AZ-305 does &lt;em&gt;not&lt;/em&gt; mandate a specific programming language&lt;/strong&gt; because it’s an &lt;strong&gt;architectural design exam&lt;/strong&gt; rather than a coding certification. However, you’ll often work with languages and tools in practice such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CLI and scripting:&lt;/strong&gt; PowerShell, Azure CLI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IaC tools’ languages:&lt;/strong&gt; Bicep, ARM templates, Terraform (HCL)&lt;/li&gt;
&lt;li&gt;General clouds and application languages like C#, Python, JavaScript may be used in solutions you design&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These languages are used to implement and automate the infrastructure, but &lt;strong&gt;not specifically tested as “coding” questions&lt;/strong&gt; in the exam.&lt;/p&gt;

&lt;p&gt;🏢 &lt;strong&gt;Parent Organization&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Owner &amp;amp; Sponsor:&lt;/strong&gt; &lt;strong&gt;Microsoft Corporation&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Certification Path:&lt;/strong&gt; Part of &lt;strong&gt;Microsoft Certified: Azure Solutions Architect Expert&lt;/strong&gt; — this credential reflects advanced expertise in Azure design and architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There’s no single company behind “AZ-305” other than Microsoft itself, since it’s a proprietary exam within the Microsoft certification ecosystem.&lt;/p&gt;

&lt;p&gt;💰 &lt;strong&gt;Open Source or Paid?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AZ-305 Exam&lt;/strong&gt;                       🔒 &lt;strong&gt;Paid&lt;/strong&gt; – You must pay an exam fee (e.g., ~$165 USD; varies by region). &lt;br&gt;
 &lt;strong&gt;Microsoft Learn study resources&lt;/strong&gt;  🆓 &lt;strong&gt;Free&lt;/strong&gt; – Official documentation and learning paths are free.&lt;br&gt;
 &lt;strong&gt;Third-party training courses&lt;/strong&gt;     💸 &lt;strong&gt;Often Paid&lt;/strong&gt; – Courses and practice exams from other providers may cost money                     &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AZ-305 itself is a paid, proprietary Microsoft exam&lt;/strong&gt;, not an open-source tool or free certification.&lt;/p&gt;

</description>
      <category>career</category>
      <category>cloud</category>
      <category>azure</category>
      <category>architecture</category>
    </item>
    <item>
      <title>HashiCorp Packer: Automating Machine Images for DevOps and DevSecOps</title>
      <dc:creator>Hareesh</dc:creator>
      <pubDate>Mon, 22 Dec 2025 03:21:17 +0000</pubDate>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d/hashicorp-packer-automating-machine-images-for-devops-and-devsecops-37ep</link>
      <guid>https://dev.to/hareesh_e8fcfb0dd54290b4d/hashicorp-packer-automating-machine-images-for-devops-and-devsecops-37ep</guid>
      <description>&lt;p&gt;📌 &lt;em&gt;Overview of the Tool&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;HashiCorp Packer&lt;/em&gt; is a tool for &lt;em&gt;automating the creation of machine images&lt;/em&gt; for various platforms (cloud, virtual machines, containers) using a &lt;em&gt;single source configuration&lt;/em&gt;. It lets you define how to build images once and produce identical artifacts for AWS, Azure, GCP, Docker, VMware, and other environments. &lt;/p&gt;

&lt;p&gt;Packer focuses on &lt;em&gt;immutable infrastructure&lt;/em&gt; by generating pre‑configured, deployable images (e.g., AMIs, container images) that can be reused across environments. &lt;/p&gt;

&lt;p&gt;⭐ &lt;em&gt;Key Features&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. Multi‑Platform Image Builds&lt;/em&gt;&lt;br&gt;
Create &lt;em&gt;consistent images&lt;/em&gt; for multiple platforms (cloud providers and virtualization systems) from a single template. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;2. Templates Using HCL/JSON&lt;/em&gt;&lt;br&gt;
Packer uses &lt;em&gt;HashiCorp Configuration Language (HCL)&lt;/em&gt; or JSON to define how images are built — including builders, provisioners, and post‑processors.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;3. Parallel Build Support&lt;/em&gt;&lt;br&gt;
Build images for many targets simultaneously to speed up image creation.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;4. Provisioners and Plugins&lt;/em&gt;&lt;br&gt;
Integrate provisioners like shell scripts, Ansible, Chef, etc., to configure images during build time. Support for &lt;em&gt;plugins/extensions&lt;/em&gt; enables extending functionality.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;5. Integration With CI/CD&lt;/em&gt;&lt;br&gt;
Automate image creation as part of build pipelines for more consistent deployments.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;6. Golden Image Management&lt;/em&gt;&lt;br&gt;
Standardize golden images across teams and environments, helping maintain policy, compliance, and consistency.&lt;br&gt;
 🔁 &lt;em&gt;How It Fits into DevOps / DevSecOps&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;🧠 DevOps Alignment&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Infrastructure as Code (IaC):&lt;/em&gt; Packer codifies image builds in configuration files, aligning with IaC principles. &lt;/li&gt;
&lt;li&gt;
&lt;em&gt;CI/CD Integration:&lt;/em&gt; Works well in automated build pipelines (GitHub Actions, Azure DevOps, Jenkins), producing images as a pipeline artifact. &lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Immutable Artifacts:&lt;/em&gt; With Packer, teams can bake software and dependencies into images, reducing configuration drift during deployments. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔐 DevSecOps Alignment&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Security Standards Built In:&lt;/em&gt; By automating image builds with security configurations and compliance checks, Packer helps enforce secure baselines early in the lifecycle. &lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Repeatable Secure Builds:&lt;/em&gt; Ensures the same hardened image is used across environments instead of manual image setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So Packer supports both &lt;em&gt;DevOps automation&lt;/em&gt; and &lt;em&gt;DevSecOps secure infrastructure practices&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;💻 &lt;em&gt;Programming Language&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Written in:&lt;/em&gt; &lt;em&gt;Go (Golang)&lt;/em&gt; — a performant language that produces standalone binaries across platforms. &lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Configuration:&lt;/em&gt; Packer templates use &lt;em&gt;HCL (HashiCorp Configuration Language)&lt;/em&gt; (preferred) or JSON.&lt;/li&gt;
&lt;li&gt;Plugin integrations and ecosystem extensions are also designed around Go.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🏢 &lt;em&gt;Parent Company&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Parent / Developer:&lt;/em&gt; &lt;em&gt;HashiCorp, Inc.&lt;/em&gt; — a company specializing in infrastructure automation tools&lt;/li&gt;
&lt;li&gt;HashiCorp’s toolset includes Terraform, Vault, Consul, Nomad, and others, and many of these tools are widely used in cloud and DevOps workflows. 
(HashiCorp was acquired by IBM in 2025, with the acquisition closing in February 2025, so it now operates as part of IBM.) &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🆓 &lt;em&gt;Open Source or Paid?&lt;/em&gt;&lt;br&gt;
 &lt;em&gt;Packer core tool&lt;/em&gt;              &lt;em&gt;Open‑source / free to use&lt;/em&gt; — source code available on GitHub under HashiCorp’s source‑available license. &lt;br&gt;
 &lt;em&gt;Managed Service (HCP Packer)&lt;/em&gt;  &lt;em&gt;Paid / subscription tiers&lt;/em&gt; — advanced image management, artifact registry, and enterprise features via &lt;em&gt;HashiCorp Cloud Platform (HCP)&lt;/em&gt;. &lt;br&gt;
 &lt;em&gt;Enterprise Support&lt;/em&gt;            Paid support available via enterprise HashiCorp offerings or partner services.                                                         &lt;/p&gt;

&lt;p&gt;So the &lt;em&gt;core Packer tool is free and open source&lt;/em&gt;, but enterprise or cloud‑hosted capabilities may involve cost.&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>cloud</category>
      <category>automation</category>
      <category>devops</category>
    </item>
    <item>
      <title>ACID Properties</title>
      <dc:creator>Hareesh</dc:creator>
      <pubDate>Wed, 08 Oct 2025 12:12:05 +0000</pubDate>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d/acid-properties-25m3</link>
      <guid>https://dev.to/hareesh_e8fcfb0dd54290b4d/acid-properties-25m3</guid>
      <description>&lt;p&gt;Databases are the backbone of nearly every modern application from banking systems to e-commerce platforms. To maintain reliability and accuracy, databases follow a crucial set of principles known as &lt;strong&gt;ACID&lt;/strong&gt;:&lt;br&gt;
&lt;strong&gt;Atomicity, Consistency, Isolation, and Durability.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this blog, let’s explore these properties through a simple Loan Management System using SQL transactions.&lt;br&gt;
Creating the Schema 🧱&lt;/p&gt;

&lt;p&gt;We’ll begin by setting up a table to store customer loan details.&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%2Fwltyjcg3mrpwgxk6ssjz.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%2Fwltyjcg3mrpwgxk6ssjz.webp" alt=" " width="800" height="536"&gt;&lt;/a&gt;&lt;br&gt;
Now, let’s insert some sample records:&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%2Ffgozb0zdh3tl0ulntp82.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%2Ffgozb0zdh3tl0ulntp82.webp" alt=" " width="800" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the inserted data:&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%2Fn37vwib907uvcdo2twah.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%2Fn37vwib907uvcdo2twah.webp" alt=" " width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Atomicity — “All or Nothing”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Atomicity ensures that all operations within a transaction are completed successfully, or none at all.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
Suppose we want to deduct an EMI payment of ₹5,000 from Bob’s loan account.&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%2Fhu1qhsl87u7zo1kj254s.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%2Fhu1qhsl87u7zo1kj254s.webp" alt=" " width="800" height="564"&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%2F6rigdkktkw37qjwmr6pw.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%2F6rigdkktkw37qjwmr6pw.webp" alt=" " width="800" height="536"&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%2Fdt48in948dsgwcbbhvny.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%2Fdt48in948dsgwcbbhvny.webp" alt=" " width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After rolling back, no change is reflected — demonstrating that partial updates don’t occur.&lt;/p&gt;

&lt;p&gt;Atomicity ensures that incomplete transactions never alter the database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consistency — “Data Must Stay Valid”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Consistency means that a transaction should always move the database from one valid state to another, maintaining all integrity rules.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
Suppose we try to insert invalid data (negative loan amount).&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%2Fn5zl7qvopwiwcix4cvk7.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%2Fn5zl7qvopwiwcix4cvk7.webp" alt=" " width="800" height="546"&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%2Fahuxvaz3tfflflon9wi4.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%2Fahuxvaz3tfflflon9wi4.webp" alt=" " width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will fail due to the constraint.&lt;/p&gt;

&lt;p&gt;Consistency ensures only valid, rule-abiding data enters the system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Isolation — “Transactions Don’t Interfere”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Isolation guarantees that concurrent transactions don’t affect each other’s intermediate states.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
When two users update the same record simultaneously, one transaction waits until the other completes — preventing dirty reads or inconsistent 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%2Fimwrwjjqeu5s5rswsd53.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%2Fimwrwjjqeu5s5rswsd53.webp" alt=" " width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Isolation ensures safe, concurrent access to shared data.&lt;br&gt;
&lt;strong&gt;Durability — “Committed Data Never Vanishes”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Durability ensures that once a transaction is committed, its changes persist permanently, even after system failures or restarts.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
After committing a 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%2Fqleppyuavmmze972mht3.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%2Fqleppyuavmmze972mht3.webp" alt=" " width="800" height="556"&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%2Fupv116t5ls1t8e2dsy4k.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%2Fupv116t5ls1t8e2dsy4k.webp" alt=" " width="800" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;By following ACID principles, databases maintain reliability, fault-tolerance, and data integrity — even under high concurrency conditions like banking, finance, or e-commerce systems.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>architecture</category>
      <category>tutorial</category>
      <category>database</category>
    </item>
    <item>
      <title>CRUD in MongoDB</title>
      <dc:creator>Hareesh</dc:creator>
      <pubDate>Wed, 08 Oct 2025 12:04:13 +0000</pubDate>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d/crud-in-mongodb-28pp</link>
      <guid>https://dev.to/hareesh_e8fcfb0dd54290b4d/crud-in-mongodb-28pp</guid>
      <description>&lt;p&gt;Creating a Student Database on MongoDB Atlas&lt;br&gt;
Step 1: Setting Up MongoDB Atlas&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to MongoDB Atlas&lt;/li&gt;
&lt;li&gt;Create a Free Cluster (it’s totally free).&lt;/li&gt;
&lt;li&gt;Add a Database User with a username and password.&lt;/li&gt;
&lt;li&gt;Under “Network Access”, whitelist your IP address → 0.0.0.0/0 (allows all IPs for testing).&lt;/li&gt;
&lt;li&gt;Click Connect → Connect with Mongo Shell, and copy your connection string.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Create (Insert):-&lt;/p&gt;

&lt;p&gt;Insert at least 5 student records into the students collection.&lt;/p&gt;

&lt;p&gt;We cannot start by inserting 5 student records into our students collection together. We can create each student as separate document.&lt;/p&gt;

&lt;p&gt;Code:-&lt;br&gt;
{&lt;br&gt;
"student_id": "S001",&lt;br&gt;
"name": "Santhosh",&lt;br&gt;
"age": 20,&lt;br&gt;
"department": "CSBS",&lt;br&gt;
"year": 2,&lt;br&gt;
"cgpa": 9&lt;br&gt;
},&lt;br&gt;
{&lt;br&gt;
"student_id": "S002",&lt;br&gt;
"name": "Baviya",&lt;br&gt;
"age": 19,&lt;br&gt;
"department": "CSE",&lt;br&gt;
"year": 1,&lt;br&gt;
"cgpa": 8.7&lt;br&gt;
},&lt;br&gt;
{&lt;br&gt;
"student_id": "S003",&lt;br&gt;
"name": "Karthik",&lt;br&gt;
"age": 21,&lt;br&gt;
"department": "ECE",&lt;br&gt;
"year": 3,&lt;br&gt;
"cgpa": 7.2&lt;br&gt;
},&lt;br&gt;
{&lt;br&gt;
"student_id": "S004",&lt;br&gt;
"name": "Anu",&lt;br&gt;
"age": 20,&lt;br&gt;
"department": "CSE",&lt;br&gt;
"year": 2,&lt;br&gt;
"cgpa": 9.3&lt;br&gt;
},&lt;br&gt;
{&lt;br&gt;
"student_id": "S005",&lt;br&gt;
"name": "Ravi",&lt;br&gt;
"age": 22,&lt;br&gt;
"department": "MECH",&lt;br&gt;
"year": 3,&lt;br&gt;
"cgpa": 6.8&lt;br&gt;
}&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%2Fget3sqmgc6ie6in0oi0t.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%2Fget3sqmgc6ie6in0oi0t.webp" alt=" " width="800" height="450"&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%2Fztox4ywyhop0r3adlwa7.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%2Fztox4ywyhop0r3adlwa7.webp" alt=" " width="800" height="392"&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%2Fdus7oqnz08a934l0i29e.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%2Fdus7oqnz08a934l0i29e.webp" alt=" " width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;READ (QUERY)&lt;/p&gt;

&lt;p&gt;Find all students with CGPA &amp;gt; 8:&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%2Ffwgyggkcsqmitpao5blp.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%2Ffwgyggkcsqmitpao5blp.webp" alt=" " width="800" height="366"&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%2F83r58uzdm6v8bcxc85dc.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%2F83r58uzdm6v8bcxc85dc.webp" alt=" " width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3️⃣ UPDATE&lt;br&gt;
(a) Update the CGPA of a specific student&lt;/p&gt;

&lt;p&gt;db.students.updateOne(&lt;br&gt;
{ student_id: "S002" },&lt;br&gt;
{ $set: { cgpa: 9.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%2F1jofnt5lrjkl70we8g07.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%2F1jofnt5lrjkl70we8g07.webp" alt=" " width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(b) Increase the year of study for all 3rd-year students by 1&lt;/p&gt;

&lt;p&gt;db.students.updateMany(&lt;br&gt;
{ year: 3 },&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%2Ft6i3rlg0u4vnkoaeklki.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%2Ft6i3rlg0u4vnkoaeklki.webp" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DELETE&lt;br&gt;
(a) Delete one student record by student_id:&lt;/p&gt;

&lt;p&gt;db.students.deleteOne({ student_id: "S005" })&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%2F9ltxr7rah5ia41uro3ys.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%2F9ltxr7rah5ia41uro3ys.webp" alt=" " width="800" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(b) Delete all students having CGPA &amp;lt; 7.5&lt;/p&gt;

&lt;p&gt;db.students.deleteMany({ cgpa: { $lt: 7.5 } })&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%2Frhwxrzl4ruy9g3xs7a6y.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%2Frhwxrzl4ruy9g3xs7a6y.webp" alt=" " width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>mongodb</category>
      <category>database</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Mastering B-Tree, B+Tree, and Hash Indexes</title>
      <dc:creator>Hareesh</dc:creator>
      <pubDate>Wed, 08 Oct 2025 11:47:52 +0000</pubDate>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d/mastering-b-tree-btree-and-hash-indexes-jj0</link>
      <guid>https://dev.to/hareesh_e8fcfb0dd54290b4d/mastering-b-tree-btree-and-hash-indexes-jj0</guid>
      <description>&lt;p&gt;Ever wondered why some SQL queries take milliseconds, while others take minutes?&lt;br&gt;
The secret lies in a powerful data structure Indexes!&lt;/p&gt;

&lt;p&gt;In this tutorial, we’ll explore how to create and use B-Tree, B+Tree, and Hash indexes using a simple Students table example.&lt;br&gt;
Let’s dive right in!&lt;/p&gt;

&lt;p&gt;🎯 &lt;strong&gt;What Are Indexes in Databases?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of an index as a shortcut just like the index in a book.&lt;br&gt;
Instead of flipping through every page, the database can jump directly to the data you want.&lt;/p&gt;

&lt;p&gt;Step 1: Create the Students Table&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%2Fwywbqbkxete2o0sx7rz3.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%2Fwywbqbkxete2o0sx7rz3.webp" alt=" " width="800" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Insert 20 Sample Records&lt;/p&gt;

&lt;p&gt;Let’s fill our table with student data.&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%2F32kdbzjtwcanj922oibj.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%2F32kdbzjtwcanj922oibj.webp" alt=" " width="642" height="725"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: Create a B-Tree Index on roll_no&lt;br&gt;
CREATE INDEX idx_rollno ON Students(roll_no);&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%2Fj9bxab1nn5mamuqvsrg0.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%2Fj9bxab1nn5mamuqvsrg0.webp" alt=" " width="800" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4: Query Using B-Tree Index&lt;/p&gt;

&lt;p&gt;SELECT * FROM Students WHERE roll_no = 110;&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%2Froda7u91hjce2chkudxg.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%2Froda7u91hjce2chkudxg.webp" alt=" " width="800" height="643"&gt;&lt;/a&gt;&lt;br&gt;
Step 5: Create a B+ Tree Index on cgpa&lt;/p&gt;

&lt;p&gt;SELECT * FROM Students WHERE cgpa &amp;gt; 8.0;&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%2Fj4qt14f9pqwb5qdbdye1.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%2Fj4qt14f9pqwb5qdbdye1.webp" alt=" " width="800" height="663"&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%2Fxzzu6w2x8abmb5qcvubb.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%2Fxzzu6w2x8abmb5qcvubb.webp" alt=" " width="800" height="655"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 6: Query Using Hash Index&lt;/p&gt;

&lt;p&gt;SELECT * FROM Students WHERE dept = 'CSBS';&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%2F6pyr01zhwa0henlf2dre.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%2F6pyr01zhwa0henlf2dre.webp" alt=" " width="800" height="666"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We just built a mini high-performance database system from scratch!&lt;br&gt;
Using B-Tree, B+Tree, and Hash indexes, you’ve learned how databases actually speed up query execution behind the scenes.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>sql</category>
      <category>performance</category>
      <category>database</category>
    </item>
    <item>
      <title>Transactions, Deadlocks &amp; Log Based Recovery</title>
      <dc:creator>Hareesh</dc:creator>
      <pubDate>Sun, 05 Oct 2025 17:26:05 +0000</pubDate>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d/transactions-deadlocks-log-based-recovery-1cji</link>
      <guid>https://dev.to/hareesh_e8fcfb0dd54290b4d/transactions-deadlocks-log-based-recovery-1cji</guid>
      <description>&lt;p&gt;Managing database transactions safely is crucial to ensure data integrity and prevent issues like partial updates or deadlocks. In this tutorial, we’ll explore transactions, deadlocks, and log-based recovery using a simple Accounts table.&lt;/p&gt;

&lt;p&gt;First, let’s create a sample table&lt;br&gt;
CREATE TABLE Accounts (&lt;br&gt;
acc_no INT PRIMARY KEY,&lt;br&gt;
name VARCHAR(50),&lt;br&gt;
balance INT&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;INSERT INTO Accounts VALUES&lt;br&gt;
(1, 'Alice', 1000),&lt;br&gt;
(2, 'Bob', 1500),&lt;br&gt;
(3, 'Charlie', 2000);&lt;/p&gt;

&lt;p&gt;*Transaction – Atomicity &amp;amp; Rollback&lt;br&gt;
*&lt;br&gt;
Suppose we want to transfer 500 from Alice to Bob. Using a transaction ensures that either both operations succeed or none.&lt;/p&gt;

&lt;p&gt;START TRANSACTION;&lt;/p&gt;

&lt;p&gt;UPDATE Accounts&lt;br&gt;
SET balance = balance - 500&lt;br&gt;
WHERE name = 'Alice';&lt;/p&gt;

&lt;p&gt;ROLLBACK;&lt;br&gt;
UPDATE Accounts&lt;br&gt;
SET balance = balance + 500&lt;br&gt;
WHERE name = 'Bob';&lt;/p&gt;

&lt;p&gt;Deadlock Simulation&lt;/p&gt;

&lt;p&gt;Deadlocks occur when two transactions block each other waiting for resources.&lt;/p&gt;

&lt;p&gt;START TRANSACTION;&lt;br&gt;
SELECT * FROM Accounts WHERE name='Alice' FOR UPDATE;&lt;br&gt;
UPDATE Accounts SET balance = balance + 100 WHERE name='Bob';&lt;/p&gt;

&lt;p&gt;START TRANSACTION;&lt;br&gt;
SELECT * FROM Accounts WHERE name='Bob' FOR UPDATE;&lt;br&gt;
UPDATE Accounts SET balance = balance - 100 WHERE name='Alice';RESULT&lt;br&gt;
ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction&lt;/p&gt;

&lt;p&gt;Log-Based Recovery&lt;/p&gt;

&lt;p&gt;Modern DBMS (MySQL/PostgreSQL) automatically maintain transaction logs. These logs help undo changes if a transaction fails.&lt;/p&gt;

&lt;p&gt;UPDATE Accounts SET balance = balance - 300 WHERE name='Alice';Log-based recovery ensures that undo operations are possible. Even if the database crashes, the system can restore a consistent state.&lt;/p&gt;

&lt;p&gt;Summary&lt;/p&gt;

&lt;p&gt;Transactions guarantee atomicity; either all operations succeed or none.&lt;/p&gt;

&lt;p&gt;Deadlocks occur when transactions block each other; they must be handled with care.&lt;/p&gt;

&lt;p&gt;Log-based recovery ensures durability and recoverability&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%2Fhsotpt6ttanixr8o552q.jpg" 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%2Fhsotpt6ttanixr8o552q.jpg" alt=" " width="800" height="415"&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%2F85oy42sqrjf2b7v5rnje.jpg" 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%2F85oy42sqrjf2b7v5rnje.jpg" alt=" " width="800" height="361"&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%2Fewy8wkxdcpsoxcos2ace.jpg" 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%2Fewy8wkxdcpsoxcos2ace.jpg" alt=" " width="800" height="371"&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%2Fesh32jt8g0lo9w5fifuv.jpg" 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%2Fesh32jt8g0lo9w5fifuv.jpg" alt=" " width="800" height="384"&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%2Fi9sxg0i1u2j93bxsgk62.jpg" 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%2Fi9sxg0i1u2j93bxsgk62.jpg" alt=" " width="800" height="352"&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%2Fy74qeztv89chum33eq22.jpg" 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%2Fy74qeztv89chum33eq22.jpg" alt=" " width="800" height="392"&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%2Fu6dtygkckz8ts2n4mtes.jpg" 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%2Fu6dtygkckz8ts2n4mtes.jpg" alt=" " width="800" height="418"&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%2Fn491b19b8lzn6yhxtcf8.jpg" 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%2Fn491b19b8lzn6yhxtcf8.jpg" alt=" " width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>normalization</title>
      <dc:creator>Hareesh</dc:creator>
      <pubDate>Sun, 05 Oct 2025 16:48:39 +0000</pubDate>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d/normalization-5cl</link>
      <guid>https://dev.to/hareesh_e8fcfb0dd54290b4d/normalization-5cl</guid>
      <description>&lt;p&gt;Database normalization is the process of organizing data to reduce redundancy and improve data integrity. In this tutorial, we’ll go step-by-step from &lt;em&gt;Unnormalized Table → 1NF → 2NF → 3NF, and implement it using **MySQL&lt;/em&gt;.  &lt;/p&gt;

&lt;p&gt;We’ll also write a &lt;em&gt;JOIN query&lt;/em&gt; to display students along with their courses and instructors.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Insertion Anomaly:&lt;/em&gt; Cannot add a new course without assigning it to a student.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Update Anomaly:&lt;/em&gt; If an instructor’s phone number changes, multiple rows must be updated.
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Deletion Anomaly:&lt;/em&gt; Removing a student could delete information about the course and instructor.
1.First Normal Form (1NF)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Rule:&lt;/em&gt; Each column should have &lt;em&gt;atomic values&lt;/em&gt;.  &lt;/p&gt;

&lt;p&gt;Our table already satisfies 1NF.  &lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
sql
CREATE TABLE StudentCourses_1NF (
    StudentName VARCHAR(50),
    CourseID VARCHAR(10),
    CourseName VARCHAR(50),
    Instructor VARCHAR(50),
    InstructorPhone VARCHAR(15)
);
2. Second Normal Form (2NF)

Rule: Must be in 1NF, and remove partial dependencies.

CourseName, Instructor, InstructorPhone depend only on CourseID.

StudentName depends only on the student.
-- Students Table
CREATE TABLE Students (
    StudentID INT PRIMARY KEY AUTO_INCREMENT,
    StudentName VARCHAR(50)
);

-- Courses Table
CREATE TABLE Courses (
    CourseID VARCHAR(10) PRIMARY KEY,
    CourseName VARCHAR(50),
    Instructor VARCHAR(50),
    InstructorPhone VARCHAR(15)
);

-- Enrollments Table (linking students to courses)
CREATE TABLE Enrollments (
    StudentID INT,
    CourseID VARCHAR(10),
    PRIMARY KEY (StudentID, CourseID),
    FOREIGN KEY (CourseID) REFERENCES Courses(CourseID)
);
3. Third Normal Form (3NF)

Rule: Must be in 2NF, and remove transitive dependencies.

InstructorPhone depends on Instructor.

Move instructors to a separate table.
-- Students Table
CREATE TABLE Students (
    StudentID INT PRIMARY KEY AUTO_INCREMENT,
    StudentName VARCHAR(50)
);

-- Instructors Table
CREATE TABLE Instructors (
    InstructorID INT PRIMARY KEY AUTO_INCREMENT,
    InstructorName VARCHAR(50),
    InstructorPhone VARCHAR(15)
);

-- Courses Table
CREATE TABLE Courses (
    CourseID VARCHAR(10) PRIMARY KEY,
    CourseName VARCHAR(50),
    InstructorID INT,
    FOREIGN KEY (InstructorID) REFERENCES Instructors(InstructorID)
);

-- Enrollments Table
CREATE TABLE Enrollments (
    StudentID INT,
    CourseID VARCHAR(10),
    PRIMARY KEY (StudentID, CourseID),
    FOREIGN KEY (StudentID) REFERENCES Students(StudentID),
    FOREIGN KEY (CourseID) REFERENCES Courses(CourseID)
);
4. Insert Sample Data
-- Insert Students
INSERT INTO Students (StudentName) VALUES
('Arjun'),
('Priya'),
('Kiran');

-- Insert Instructors
INSERT INTO Instructors (InstructorName, InstructorPhone) VALUES
('Dr. Kumar', '9876543210'),
('Dr. Mehta', '9123456780'),
('Dr. Rao', '9988776655');

-- Insert Courses
INSERT INTO Courses (CourseID, CourseName, InstructorID) VALUES
('C101', 'DBMS', 1),
('C102', 'Data Mining', 2),
('C103', 'AI', 3);

-- Insert Enrollments
INSERT INTO Enrollments (StudentID, CourseID) VALUES
(1, 'C101'),
(1, 'C102'),
(2, 'C101'),
(3, 'C103');

5. JOIN Query to List Students, Courses &amp;amp; Instructors
SELECT 
    s.StudentName,
    c.CourseName,
    i.InstructorName,
    i.InstructorPhone
FROM Enrollments e
JOIN Students s ON e.StudentID = s.StudentID
JOIN Courses c ON e.CourseID = c.CourseID
JOIN Instructors i ON c.InstructorID = i.InstructorID;
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d51ftxxw4jbb4c2th8iw.jpg)
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5q8mfq8h6todc55ewhl1.jpg)
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cujll7jvo4t0wgnlrs2m.jpg)
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/186xyijdhqyfsvc1ucyh.jpg)
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f2flpv0regoryzr6lqmi.jpg)
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8m5sb36r2ce9b4ojmgv6.jpg)
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mqyuq85t3dpinnhs7xfp.jpg)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>database</category>
      <category>mysql</category>
      <category>tutorial</category>
      <category>sql</category>
    </item>
    <item>
      <title>cursor+trigger</title>
      <dc:creator>Hareesh</dc:creator>
      <pubDate>Sun, 05 Oct 2025 16:43:21 +0000</pubDate>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d/cursortrigger-2aj2</link>
      <guid>https://dev.to/hareesh_e8fcfb0dd54290b4d/cursortrigger-2aj2</guid>
      <description>&lt;p&gt;Cursor + Trigger — SQL Practice&lt;br&gt;
In this post, we’ll explore two powerful SQL concepts — Cursors and Triggers — with complete examples that you can run directly in Oracle LiveSQL.&lt;/p&gt;

&lt;p&gt;CURSOR — Process Cursor with Condition&lt;br&gt;
Problem Statement:&lt;/p&gt;

&lt;p&gt;Create a cursor that displays employee names whose salary is greater than 50,000 from the Employee table.&lt;br&gt;
CREATE TABLE Employee (&lt;br&gt;
EmpID NUMBER PRIMARY KEY,&lt;br&gt;
EmpName VARCHAR2(100),&lt;br&gt;
Salary NUMBER(10,2)&lt;br&gt;
);&lt;br&gt;
INSERT INTO Employee VALUES (1, 'Arjun', 45000);&lt;br&gt;
INSERT INTO Employee VALUES (2, 'Sneha', 52000);&lt;br&gt;
INSERT INTO Employee VALUES (3, 'Kiran', 60000);&lt;br&gt;
INSERT INTO Employee VALUES (4, 'Meena', 48000);&lt;br&gt;
COMMIT;&lt;br&gt;
SET SERVEROUTPUT ON;&lt;/p&gt;

&lt;p&gt;DECLARE&lt;br&gt;
v_EmpName Employee.EmpName%TYPE;&lt;br&gt;
v_Salary Employee.Salary%TYPE;&lt;br&gt;
CURSOR emp_cursor IS&lt;br&gt;
SELECT EmpName, Salary&lt;br&gt;
FROM Employee&lt;br&gt;
WHERE Salary &amp;gt; 50000;&lt;br&gt;
BEGIN&lt;br&gt;
OPEN emp_cursor;&lt;br&gt;
LOOP&lt;br&gt;
FETCH emp_cursor INTO v_EmpName, v_Salary;&lt;br&gt;
EXIT WHEN emp_cursor%NOTFOUND;&lt;br&gt;
DBMS_OUTPUT.PUT_LINE('Employee: ' || v_EmpName || ' | Salary: ' || v_Salary);&lt;br&gt;
END LOOP;&lt;br&gt;
CLOSE emp_cursor;&lt;br&gt;
END;&lt;br&gt;
/&lt;/p&gt;

&lt;p&gt;*TRIGGER *— AFTER INSERT Trigger (Student Table)&lt;br&gt;
Problem Statement:&lt;/p&gt;

&lt;p&gt;Whenever a new student is added to the Students table, automatically insert a log entry into the Student_Audit table to keep track of the registration.&lt;br&gt;
CREATE TABLE Students (&lt;br&gt;
StudentID NUMBER PRIMARY KEY,&lt;br&gt;
StudentName VARCHAR2(100),&lt;br&gt;
Course VARCHAR2(100)&lt;br&gt;
);&lt;br&gt;
CREATE TABLE Student_Audit (&lt;br&gt;
AuditID NUMBER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,&lt;br&gt;
StudentID NUMBER,&lt;br&gt;
StudentName VARCHAR2(100),&lt;br&gt;
ActionTaken VARCHAR2(100),&lt;br&gt;
ActionDate DATE&lt;br&gt;
);&lt;br&gt;
CREATE OR REPLACE TRIGGER trg_AfterStudentInsert&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, ActionTaken, ActionDate)&lt;br&gt;
VALUES (:NEW.StudentID, :NEW.StudentName, 'New Student Registered', SYSDATE);&lt;br&gt;
END;&lt;br&gt;
INSERT INTO Students (StudentID, StudentName, Course)&lt;br&gt;
VALUES (1, 'hareesh', 'Computer Science');&lt;br&gt;
COMMIT;&lt;br&gt;
SELECT * FROM Student_Audit;&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%2F04lw7halfxh8d8snznil.jpg" 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%2F04lw7halfxh8d8snznil.jpg" alt=" " width="800" height="356"&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%2Fn67x32cu41ywaz1hnunc.jpg" 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%2Fn67x32cu41ywaz1hnunc.jpg" alt=" " width="800" height="449"&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%2Fxc5zg0yyhwspux7n318n.jpg" 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%2Fxc5zg0yyhwspux7n318n.jpg" alt=" " width="800" height="449"&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%2Fk5r9rh00t1gk0v9u36ov.jpg" 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%2Fk5r9rh00t1gk0v9u36ov.jpg" alt=" " width="800" height="455"&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%2Fz8pyz4xt11ruoihzw05u.jpg" 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%2Fz8pyz4xt11ruoihzw05u.jpg" alt=" " width="800" height="441"&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%2Fdc6pkiqumbr38j8rfzw7.jpg" 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%2Fdc6pkiqumbr38j8rfzw7.jpg" alt=" " width="800" height="458"&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%2F1f4lmc9154gokhf9l323.jpg" 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%2F1f4lmc9154gokhf9l323.jpg" alt=" " width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>oracle</category>
      <category>database</category>
      <category>tutorial</category>
      <category>sql</category>
    </item>
    <item>
      <title>Getting Started with SQL: My First Hands-On Experience</title>
      <dc:creator>Hareesh</dc:creator>
      <pubDate>Mon, 25 Aug 2025 16:06:32 +0000</pubDate>
      <link>https://dev.to/hareesh_e8fcfb0dd54290b4d/getting-started-with-sql-my-first-hands-on-experience-182g</link>
      <guid>https://dev.to/hareesh_e8fcfb0dd54290b4d/getting-started-with-sql-my-first-hands-on-experience-182g</guid>
      <description>&lt;p&gt;Over the past few days, I started learning SQL (Structured Query Language) and performed some of the most essential operations that every beginner should know. Databases power almost every application we use today, and SQL is the language that helps us communicate with them.&lt;br&gt;
I practiced queries on a simple Students–Courses database and here’s what I tried:&lt;/p&gt;

&lt;p&gt;Creating Tables (DDL) I started with the CREATE TABLE command to define the structure of my tables. For example: CREATE TABLE Faculty ( FacultyID INT PRIMARY KEY, FacultyName VARCHAR2(100) NOT NULL, Dept VARCHAR2(50), Email VARCHAR2(100) UNIQUE ); This helped me understand how to set primary keys, constraints, and column types.&lt;br&gt;
Inserting Data (DML) Next, I used the INSERT INTO statement to add records into my tables. For example, I added some students into different departments. INSERT INTO Students (StudentID, Name, Dept, DOB, Email) VALUES (1, 'Saifulhaq', 'CSBS', TO_DATE('13-12-2006','DD-MM-YYYY'), '&lt;a href="mailto:itsaifulhaq@gmail.com"&gt;itsaifulhaq@gmail.com&lt;/a&gt;');&lt;br&gt;
Altering Tables I learned how to modify table structures using the ALTER TABLE command. For instance, I added a phone number column: ALTER TABLE Students ADD PhoneNo VARCHAR2(10);&lt;br&gt;
Using Functions in SELECT I also explored SQL functions to manipulate and display data. Example: SELECT UPPER(Name) AS StudentName, LENGTH(Email) AS EmailLength FROM Students; This query shows student names in uppercase and calculates the length of their email IDs.&lt;br&gt;
Aggregate Functions SQL makes it easy to calculate statistics. I tried: SELECT AVG(Credits) AS AvgCredits FROM Courses; SELECT COUNT(*) AS TotalStudents FROM Students;&lt;br&gt;
Joins Finally, I experimented with joins to combine data from multiple tables: SELECT s.Name, c.CourseName, e.Grade FROM Students s JOIN Enrollments e ON s.StudentID = e.StudentID JOIN Courses c ON e.CourseID = c.CourseID; This lists all students with the courses they’re enrolled in and their grades. Final Thoughts 💡 Writing and executing these SQL queries gave me a solid understanding of how relational databases work. It’s one thing to learn the theory, but actually running queries and seeing the results makes it click much faster. I’ll be sharing more of my learning journey soon — especially as I explore advanced SQL queries and dive deeper into database design.&lt;br&gt;
Thank you &lt;a class="mentioned-user" href="https://dev.to/santhoshnc"&gt;@santhoshnc&lt;/a&gt; sir for your valuable guidance...&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%2Fnmdb97cdocflgisqkke8.jpg" 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%2Fnmdb97cdocflgisqkke8.jpg" alt=" " width="800" height="451"&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%2Fncrllbsetlkcih04avqh.jpg" 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%2Fncrllbsetlkcih04avqh.jpg" alt=" " width="800" height="451"&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%2Fol7f1547cjg44tcoiq2s.jpg" 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%2Fol7f1547cjg44tcoiq2s.jpg" alt=" " width="800" height="451"&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%2Flk3royfhp1t0v4i9mrfx.jpg" 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%2Flk3royfhp1t0v4i9mrfx.jpg" alt=" " width="800" height="451"&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%2Fdym4cdg633n572uokeh9.jpg" 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%2Fdym4cdg633n572uokeh9.jpg" alt=" " width="800" height="451"&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%2Fulu3euddajkj8qbiza7h.jpg" 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%2Fulu3euddajkj8qbiza7h.jpg" alt=" " width="800" height="451"&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%2Ft58vuuxjcnz38brqwa3j.jpg" 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%2Ft58vuuxjcnz38brqwa3j.jpg" alt=" " width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
