<?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>Forem: Haresh B</title>
    <description>The latest articles on Forem by Haresh B (@haresh_511).</description>
    <link>https://forem.com/haresh_511</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%2F3448065%2Fdd28f39a-7038-4290-b42d-92ab34879380.png</url>
      <title>Forem: Haresh B</title>
      <link>https://forem.com/haresh_511</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/haresh_511"/>
    <language>en</language>
    <item>
      <title>AWS Honeycode: Your No-Code App Builder</title>
      <dc:creator>Haresh B</dc:creator>
      <pubDate>Thu, 18 Dec 2025 17:26:50 +0000</pubDate>
      <link>https://forem.com/haresh_511/aws-honeycode-your-no-code-app-builder-4p78</link>
      <guid>https://forem.com/haresh_511/aws-honeycode-your-no-code-app-builder-4p78</guid>
      <description>&lt;h2&gt;
  
  
  AWS Honeycode: Build Apps Without Coding
&lt;/h2&gt;

&lt;p&gt;AWS Honeycode is a fully managed service that allows users to create web and mobile applications without writing code. It empowers teams to build custom apps for project management, customer tracking, inventory management, and more, all while using familiar spreadsheet-like interfaces.&lt;/p&gt;




&lt;h2&gt;
  
  
  Overview of AWS Honeycode
&lt;/h2&gt;

&lt;p&gt;AWS Honeycode enables organizations to design and deploy applications quickly without relying on traditional software development. It focuses on &lt;strong&gt;low-code/no-code app development&lt;/strong&gt;, making it accessible to business users and developers alike. Users can automate workflows, manage tasks, and collaborate effectively within their teams.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No-code App Builder:&lt;/strong&gt; Design applications using a visual interface similar to spreadsheets.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation:&lt;/strong&gt; Automate notifications, approvals, and workflow processes.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team Collaboration:&lt;/strong&gt; Share apps securely with team members and manage permissions.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Templates:&lt;/strong&gt; Start quickly with pre-built templates for common business workflows.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile and Web Access:&lt;/strong&gt; Apps run on both browsers and mobile devices.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration:&lt;/strong&gt; Connect with other AWS services and external tools via APIs.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  AWS Category / Cloud Domain
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Category:&lt;/strong&gt; Application Development / Low-Code Platforms
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Domain:&lt;/strong&gt; Developer Tools / Productivity Applications
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Where It Fits in Cloud / DevOps Lifecycle
&lt;/h2&gt;

&lt;p&gt;AWS Honeycode fits into the &lt;strong&gt;development and operations stages&lt;/strong&gt; of cloud and DevOps:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Development:&lt;/strong&gt; Quickly build apps to automate business processes without writing code.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing &amp;amp; Deployment:&lt;/strong&gt; Test app functionality in Honeycode and deploy instantly to team members.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operations:&lt;/strong&gt; Automate notifications, approvals, and task tracking to streamline workflows.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration &amp;amp; Optimization:&lt;/strong&gt; Continuously improve apps based on user feedback and changing requirements.
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  AWS Honeycode Workflow
&lt;/h2&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%2Fdepp0vku3woztllj46ag.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%2Fdepp0vku3woztllj46ag.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Programming Language / Access Methods
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No programming required&lt;/strong&gt; – built for non-developers.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;APIs &amp;amp; AWS SDKs:&lt;/strong&gt; Advanced users can connect Honeycode apps to other AWS services.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web Interface:&lt;/strong&gt; Design and use apps in a browser.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile App:&lt;/strong&gt; Access and use Honeycode apps on iOS and Android devices.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Pricing Model
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Free Tier:&lt;/strong&gt; Up to 20 users and 2,500 rows per workbook for learning and small teams.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paid Plans:&lt;/strong&gt; Based on the number of users and workbook size, starting at a low monthly fee per user.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pay-as-you-go:&lt;/strong&gt; Only pay for what you use, making it cost-effective for small and large teams alike.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;AWS Honeycode is a powerful tool for organizations that want to &lt;strong&gt;build custom applications quickly without coding&lt;/strong&gt;. By integrating workflow automation, team collaboration, and cloud-based accessibility, Honeycode helps teams innovate faster and manage processes efficiently. For students learning AWS cloud-driven DevOps, exploring Honeycode can provide insights into modern low-code application development.&lt;/p&gt;

&lt;p&gt;I would like to express my sincere thanks to &lt;a class="mentioned-user" href="https://dev.to/santhoshnc"&gt;@santhoshnc&lt;/a&gt; Sir for his valuable guidance and support.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>lowcode</category>
      <category>devops</category>
    </item>
    <item>
      <title>HashiCorp Vault: A Core Security Tool in DevSecOps</title>
      <dc:creator>Haresh B</dc:creator>
      <pubDate>Thu, 18 Dec 2025 16:40:16 +0000</pubDate>
      <link>https://forem.com/haresh_511/hashicorp-vault-a-core-security-tool-in-devsecops-133m</link>
      <guid>https://forem.com/haresh_511/hashicorp-vault-a-core-security-tool-in-devsecops-133m</guid>
      <description>&lt;h2&gt;
  
  
  HashiCorp Vault: A Core Security Tool in DevSecOps
&lt;/h2&gt;

&lt;p&gt;As organizations increasingly adopt cloud computing and DevOps practices, securing sensitive data has become a major challenge. Traditional security approaches are no longer sufficient in fast-paced development environments. This challenge has led to the adoption of &lt;strong&gt;DevSecOps&lt;/strong&gt;, which integrates security into every phase of the DevOps lifecycle. One important tool that supports this approach is &lt;strong&gt;HashiCorp Vault&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Overview of HashiCorp Vault
&lt;/h2&gt;

&lt;p&gt;HashiCorp Vault is a secrets management and data protection tool designed to securely store, manage, and control access to sensitive information such as passwords, API keys, tokens, and certificates. Instead of hard-coding secrets into application code or configuration files, Vault provides a centralized and secure solution for managing them.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Secure storage and encryption of sensitive data
&lt;/li&gt;
&lt;li&gt;Dynamic secrets generation with limited lifetime
&lt;/li&gt;
&lt;li&gt;Role-Based Access Control (RBAC)
&lt;/li&gt;
&lt;li&gt;Audit logging to track access
&lt;/li&gt;
&lt;li&gt;Automatic secret rotation
&lt;/li&gt;
&lt;li&gt;Integration with CI/CD pipelines and cloud platforms
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Role in DevOps and DevSecOps
&lt;/h2&gt;

&lt;p&gt;In a DevOps environment, HashiCorp Vault enables secure automation by allowing applications and services to retrieve secrets at runtime without exposing them in source code.&lt;/p&gt;

&lt;p&gt;In a DevSecOps workflow, Vault supports the shift-left security model by embedding security controls early in the development process. It reduces the risk of credential leakage and strengthens security across continuous integration and continuous deployment pipelines.&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%2Fsh66i0w79xvs41r5pcjp.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%2Fsh66i0w79xvs41r5pcjp.png" alt="Digital illustration of HashiCorp Vault, showing a secure vault icon in the center with cloud servers and encrypted data streams, glowing in blue and green tones, representing secure information management" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Programming Languages Supported
&lt;/h2&gt;

&lt;p&gt;HashiCorp Vault provides APIs and SDKs that support multiple programming languages, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go
&lt;/li&gt;
&lt;li&gt;Python
&lt;/li&gt;
&lt;li&gt;Java
&lt;/li&gt;
&lt;li&gt;JavaScript
&lt;/li&gt;
&lt;li&gt;Ruby
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows seamless integration with different applications and platforms.&lt;/p&gt;




&lt;h2&gt;
  
  
  Parent Company
&lt;/h2&gt;

&lt;p&gt;HashiCorp Vault is developed and maintained by &lt;strong&gt;HashiCorp&lt;/strong&gt;, a company known for its cloud infrastructure and security automation tools such as Terraform, Consul, and Packer.&lt;/p&gt;




&lt;h2&gt;
  
  
  Licensing Model
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Vault Community Edition is open source and free to use.
&lt;/li&gt;
&lt;li&gt;Vault Enterprise Edition is a paid version that offers advanced security features and enterprise-level support.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;HashiCorp Vault is a fundamental tool in the DevSecOps ecosystem. By securely managing secrets and integrating seamlessly with DevOps pipelines, it helps organizations build secure, scalable, and reliable cloud-native applications. For students learning AWS cloud-driven DevOps, understanding HashiCorp Vault is essential.&lt;/p&gt;

&lt;p&gt;I would like to express my sincere thanks to &lt;a class="mentioned-user" href="https://dev.to/santhoshnc"&gt;@santhoshnc&lt;/a&gt; Sir for his valuable guidance and support.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>devsecops</category>
      <category>aws</category>
      <category>security</category>
    </item>
    <item>
      <title>CRUD Operations in MongoDB: A Beginner's Guide for College Students</title>
      <dc:creator>Haresh B</dc:creator>
      <pubDate>Wed, 08 Oct 2025 13:47:05 +0000</pubDate>
      <link>https://forem.com/haresh_511/crud-operations-in-mongodb-a-beginners-guide-for-college-students-444m</link>
      <guid>https://forem.com/haresh_511/crud-operations-in-mongodb-a-beginners-guide-for-college-students-444m</guid>
      <description>&lt;p&gt;Introduction&lt;br&gt;
As a college student, understanding database management is a fundamental skill. MongoDB, a popular NoSQL database, offers a flexible and scalable way to store data. In this guide, we’ll walk through the essential CRUD (Create, Read, Update, Delete) operations using a simple students collection schema. This is perfect for anyone getting started with MongoDB.&lt;/p&gt;

&lt;p&gt;Schema (Collection: students)&lt;br&gt;
Each document in our students collection will have the following structure:&lt;/p&gt;

&lt;p&gt;JSON&lt;/p&gt;

&lt;p&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;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create (Insert) Operations
The first step is to populate our database with data. We will insert five student records into the students collection.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Query to Insert 5 Student Records:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;db.students.insertMany([&lt;br&gt;
  { "student_id": "S001", "name": "Santhosh", "age": 20, "department": "CSBS", "year": 2, "cgpa": 9 },&lt;br&gt;
  { "student_id": "S002", "name": "Priya", "age": 21, "department": "IT", "year": 3, "cgpa": 8.5 },&lt;br&gt;
  { "student_id": "S003", "name": "Arjun", "age": 19, "department": "CSBS", "year": 1, "cgpa": 7.2 },&lt;br&gt;
  { "student_id": "S004", "name": "Deepa", "age": 22, "department": "ECE", "year": 4, "cgpa": 9.1 },&lt;br&gt;
  { "student_id": "S005", "name": "Rahul", "age": 20, "department": "IT", "year": 2, "cgpa": 7.8 }&lt;br&gt;
])&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read (Query) Operations
Querying is the most frequent operation. The find() method allows us to retrieve data based on specific criteria.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Query to Display all Student Records:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;db.students.find({})&lt;/p&gt;

&lt;p&gt;Since you have successfully performed the Read operations and have the corresponding screenshots, I will provide you with the blog post, incorporating your completed work. I will also provide the queries for the Update and Delete sections so you can complete the assignment.&lt;/p&gt;

&lt;p&gt;CRUD Operations in MongoDB: A Beginner's Guide for College Students&lt;br&gt;
Introduction&lt;br&gt;
As a college student, understanding database management is a fundamental skill. MongoDB, a popular NoSQL database, offers a flexible and scalable way to store data. In this guide, we’ll walk through the essential CRUD (Create, Read, Update, Delete) operations using a simple students collection schema. This is perfect for anyone getting started with MongoDB.&lt;/p&gt;

&lt;p&gt;Schema (Collection: students)&lt;br&gt;
Each document in our students collection will have the following structure:&lt;/p&gt;

&lt;p&gt;JSON&lt;/p&gt;

&lt;p&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;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create (Insert) Operations
The first step is to populate our database with data. We will insert five student records into the students collection.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Query to Insert 5 Student Records:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;db.students.insertMany([&lt;br&gt;
  { "student_id": "S001", "name": "Santhosh", "age": 20, "department": "CSBS", "year": 2, "cgpa": 9 },&lt;br&gt;
  { "student_id": "S002", "name": "Priya", "age": 21, "department": "IT", "year": 3, "cgpa": 8.5 },&lt;br&gt;
  { "student_id": "S003", "name": "Arjun", "age": 19, "department": "CSBS", "year": 1, "cgpa": 7.2 },&lt;br&gt;
  { "student_id": "S004", "name": "Deepa", "age": 22, "department": "ECE", "year": 4, "cgpa": 9.1 },&lt;br&gt;
  { "student_id": "S005", "name": "Rahul", "age": 20, "department": "IT", "year": 2, "cgpa": 7.8 }&lt;br&gt;
])&lt;br&gt;
Execution Result: ([Screenshot of the query result after inserting all 5 documents])&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read (Query) Operations
Querying is the most frequent operation. The find() method allows us to retrieve data based on specific criteria.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Query to Display all Student Records:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;db.students.find({})&lt;br&gt;
Execution Result:&lt;br&gt;
([Screenshot of the query results showing all 5 documents, as in your screenshot "Screenshot 2025-10-08 171200.png" or similar])&lt;/p&gt;

&lt;p&gt;Query to Find all Students with CGPA &amp;gt; 8:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;db.students.find({ "cgpa": { "$gt": 8 } })&lt;/p&gt;

&lt;p&gt;Query to Find Students from the Computer Science Department:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;db.students.find({ "department": "CSBS" })&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update Operations
Updating allows us to modify existing documents. We will use updateOne() and updateMany() for targeted and bulk updates, respectively.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Query to Update a Specific Student's CGPA:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;db.students.updateOne(&lt;br&gt;
  { "student_id": "S001" },&lt;br&gt;
  { "$set": { "cgpa": 9.2 } }&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;Query to Increase the Year of Study for all 3rd-Year Students:&lt;/p&gt;

&lt;p&gt;JavaScript&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;ol&gt;
&lt;li&gt;Delete Operations
Finally, we perform deletion to remove documents from the collection.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Query to Delete One Student Record by student_id:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;db.students.deleteOne({ "student_id": "S003" })&lt;/p&gt;

&lt;p&gt;Query to Delete all Students having CGPA &amp;lt; 7.5:&lt;/p&gt;

&lt;p&gt;JavaScript&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%2F2rxg5s03lxt8mo4j53go.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%2F2rxg5s03lxt8mo4j53go.png" alt=" " width="800" height="365"&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%2Fbvbll00hv68ittdgw6sw.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%2Fbvbll00hv68ittdgw6sw.png" alt=" " width="800" height="399"&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%2Fl00j6wyxusxao7djqupd.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%2Fl00j6wyxusxao7djqupd.png" alt=" " width="800" height="405"&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%2Fr75ggzkmorz1jtpuw4vs.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%2Fr75ggzkmorz1jtpuw4vs.png" alt=" " width="800" height="403"&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%2Fdrnuzxs1n9i68219jyov.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%2Fdrnuzxs1n9i68219jyov.png" alt=" " width="800" height="406"&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%2F25t9hnwl8gs1pfccqo3t.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%2F25t9hnwl8gs1pfccqo3t.png" alt=" " width="800" height="403"&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%2F09didkd8usigdkfrmf7h.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%2F09didkd8usigdkfrmf7h.png" alt=" " width="800" height="406"&gt;&lt;/a&gt;&lt;br&gt;
Conclusion&lt;br&gt;
Mastering these CRUD operations is crucial for anyone working with databases. MongoDB's intuitive, JSON-like syntax makes these operations straightforward and powerful. This exercise provides a solid foundation for more complex database tasks, helping you build robust applications in the future.&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>dbms</category>
      <category>nosql</category>
      <category>database</category>
    </item>
    <item>
      <title>Mastering Database Normalization with Oracle Live SQL: A Practical Guide</title>
      <dc:creator>Haresh B</dc:creator>
      <pubDate>Wed, 08 Oct 2025 08:07:21 +0000</pubDate>
      <link>https://forem.com/haresh_511/mastering-database-normalization-with-oracle-live-sql-a-practical-guide-110f</link>
      <guid>https://forem.com/haresh_511/mastering-database-normalization-with-oracle-live-sql-a-practical-guide-110f</guid>
      <description>&lt;p&gt;Introduction&lt;br&gt;
Have you ever wondered why your database tables seem a bit messy? That's where database normalization comes in. It's a structured approach to designing a database to reduce data redundancy and improve data integrity. In this guide, we'll walk through the process of normalizing a simple table to 1NF, 2NF, and 3NF using Oracle Live SQL.&lt;/p&gt;

&lt;p&gt;We'll start with a problematic base table, identify its flaws (anomalies), and then normalize it step-by-step. Let's get started!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Problematic Base Table&lt;/li&gt;
&lt;/ol&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%2Fdgobqud9wzp28rkcj57n.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%2Fdgobqud9wzp28rkcj57n.png" alt=" " width="777" height="211"&gt;&lt;/a&gt;&lt;br&gt;
Our starting point is a single table that contains all the data about students, courses, and instructors. As you'll see, this table is highly redundant.&lt;/p&gt;

&lt;p&gt;This table is a great example of what not to do. It suffers from several anomalies:&lt;/p&gt;

&lt;p&gt;Update Anomaly: If Dr. Kumar's phone number changes, we have to update multiple rows.&lt;/p&gt;

&lt;p&gt;Insertion Anomaly: We can't add a new course without a student.&lt;/p&gt;

&lt;p&gt;Deletion Anomaly: Deleting the last student in a course also deletes the course information itself.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Normalizing to 1NF (First Normal Form)
A table is in 1NF if it contains only atomic values (single values in each cell) and a unique key. Our base table is already in 1NF, as there are no repeating groups. We just need to define a composite primary key to ensure each row is unique.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's the SQL statement for our 1NF table:&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;CREATE TABLE Courses_1NF (&lt;br&gt;
    StudentID VARCHAR2(5) NOT NULL,&lt;br&gt;
    StudentName VARCHAR2(50),&lt;br&gt;
    CourseID VARCHAR2(5) NOT NULL,&lt;br&gt;
    CourseName VARCHAR2(50),&lt;br&gt;
    Instructor VARCHAR2(50),&lt;br&gt;
    InstructorPhone VARCHAR2(15),&lt;br&gt;
    PRIMARY KEY (StudentID, CourseID)&lt;br&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%2Fgwoakv9hjcrnt996i4mb.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%2Fgwoakv9hjcrnt996i4mb.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Normalizing to 2NF (Second Normal Form)
To be in 2NF, a table must be in 1NF, and all non-key attributes must be fully dependent on the entire primary key. In our 1NF table, the primary key is (StudentID, CourseID). However, StudentName only depends on StudentID, and CourseName, Instructor, and InstructorPhone only depend on CourseID.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To fix this, we'll split our table into three smaller, more focused tables: Students_2NF, Courses_Instructors_2NF, and Enrollments_2NF.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;CREATE TABLE Students_2NF (&lt;br&gt;
    StudentID VARCHAR2(5) PRIMARY KEY,&lt;br&gt;
    StudentName VARCHAR2(50)&lt;br&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%2Ftlk5s52lrztmmia3rhxg.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%2Ftlk5s52lrztmmia3rhxg.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;br&gt;
CREATE TABLE Courses_Instructors_2NF (&lt;br&gt;
    CourseID VARCHAR2(5) PRIMARY KEY,&lt;br&gt;
    CourseName VARCHAR2(50),&lt;br&gt;
    Instructor VARCHAR2(50),&lt;br&gt;
    InstructorPhone VARCHAR2(15)&lt;br&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%2Fc6jo7z4cdhoki00mw4u8.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%2Fc6jo7z4cdhoki00mw4u8.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;br&gt;
CREATE TABLE Enrollments_2NF (&lt;br&gt;
    StudentID VARCHAR2(5),&lt;br&gt;
    CourseID VARCHAR2(5),&lt;br&gt;
    PRIMARY KEY (StudentID, CourseID)&lt;br&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%2Fyfgu0qmxg1ltn0n07iq8.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%2Fyfgu0qmxg1ltn0n07iq8.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Normalizing to 3NF (Third Normal Form)
3NF requires that a table is in 2NF and has no transitive dependencies. A transitive dependency happens when a non-key attribute depends on another non-key attribute. In our Courses_Instructors_2NF table, InstructorPhone depends on Instructor, not directly on the CourseID primary key.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To achieve 3NF, we'll separate the instructor details into their own table. This gives us four normalized tables: Students, Instructors, Courses, and Enrollments.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;CREATE TABLE Students (&lt;br&gt;
    StudentID VARCHAR2(5) PRIMARY KEY,&lt;br&gt;
    StudentName VARCHAR2(50)&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;CREATE TABLE Instructors (&lt;br&gt;
    Instructor VARCHAR2(50) PRIMARY KEY,&lt;br&gt;
    InstructorPhone VARCHAR2(15)&lt;br&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%2Fdudxmy0wpldn9a6rwzap.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%2Fdudxmy0wpldn9a6rwzap.png" alt=" " width="800" height="429"&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%2Fuz2nmzbq929zgcq3k9jc.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%2Fuz2nmzbq929zgcq3k9jc.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CREATE TABLE Courses (&lt;br&gt;
    CourseID VARCHAR2(5) PRIMARY KEY,&lt;br&gt;
    CourseName VARCHAR2(50),&lt;br&gt;
    Instructor VARCHAR2(50),&lt;br&gt;
    FOREIGN KEY (Instructor) REFERENCES Instructors(Instructor)&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;CREATE TABLE Enrollments (&lt;br&gt;
    StudentID VARCHAR2(5),&lt;br&gt;
    CourseID VARCHAR2(5),&lt;br&gt;
    PRIMARY KEY (StudentID, CourseID),&lt;br&gt;
    FOREIGN KEY (StudentID) REFERENCES Students(StudentID),&lt;br&gt;
    FOREIGN KEY (CourseID) REFERENCES Courses(CourseID)&lt;br&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%2Fctwbbjcy5ld3dvsl5ezm.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%2Fctwbbjcy5ld3dvsl5ezm.png" alt=" " width="800" height="432"&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%2Fcg4udgztkjcnr5dtqif3.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%2Fcg4udgztkjcnr5dtqif3.png" alt=" " width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inserting and Querying the Normalized Data
Now that our schema is ready, we can insert the sample data and write a query to retrieve information from our new, well-structured tables.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Insert into Instructors first&lt;br&gt;
INSERT INTO Instructors (Instructor, InstructorPhone) VALUES ('Dr. Kumar', '9876543210');&lt;br&gt;
INSERT INTO Instructors (Instructor, InstructorPhone) VALUES ('Dr. Mehta', '9123456780');&lt;br&gt;
INSERT INTO Instructors (Instructor, InstructorPhone) VALUES ('Dr. Rao', '9988776655');&lt;/p&gt;

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

&lt;p&gt;-- Insert into Courses&lt;br&gt;
INSERT INTO Courses (CourseID, CourseName, Instructor) VALUES ('C101', 'DBMS', 'Dr. Kumar');&lt;br&gt;
INSERT INTO Courses (CourseID, CourseName, Instructor) VALUES ('C102', 'Data Mining', 'Dr. Mehta');&lt;br&gt;
INSERT INTO Courses (CourseID, CourseName, Instructor) VALUES ('C103', 'AI', 'Dr. Rao');&lt;/p&gt;

&lt;p&gt;-- Insert into Enrollments&lt;br&gt;
INSERT INTO Enrollments (StudentID, CourseID) VALUES ('S01', 'C101');&lt;br&gt;
INSERT INTO Enrollments (StudentID, CourseID) VALUES ('S01', 'C102');&lt;br&gt;
INSERT INTO Enrollments (StudentID, CourseID) VALUES ('S02', 'C101');&lt;br&gt;
INSERT INTO Enrollments (StudentID, CourseID) VALUES ('S03', 'C103');&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%2Fk8ecqt7epoagzfpgstwn.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%2Fk8ecqt7epoagzfpgstwn.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, here's the query to list all students, their courses, and instructor names using JOIN statements. This is much more efficient and reliable than querying the single, denormalized table.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;SELECT&lt;br&gt;
    S.StudentName,&lt;br&gt;
    C.CourseName,&lt;br&gt;
    C.Instructor&lt;br&gt;
FROM&lt;br&gt;
    Students S&lt;br&gt;
JOIN&lt;br&gt;
    Enrollments E ON S.StudentID = E.StudentID&lt;br&gt;
JOIN&lt;br&gt;
    Courses C ON E.CourseID = C.CourseID;&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%2Fsgfonfgz1n7mo8qfqo7x.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%2Fsgfonfgz1n7mo8qfqo7x.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
By normalizing our database, we've eliminated data redundancy and the risk of anomalies. Our database is now more efficient to update, easier to maintain, and ensures data consistency. This is the foundation of good database design!&lt;/p&gt;

</description>
      <category>normalization</category>
      <category>sql</category>
      <category>database</category>
      <category>oracle</category>
    </item>
    <item>
      <title>Understanding ACID Properties with Oracle Live SQL</title>
      <dc:creator>Haresh B</dc:creator>
      <pubDate>Wed, 08 Oct 2025 06:44:43 +0000</pubDate>
      <link>https://forem.com/haresh_511/understanding-acid-properties-with-oracle-live-sql-2oij</link>
      <guid>https://forem.com/haresh_511/understanding-acid-properties-with-oracle-live-sql-2oij</guid>
      <description>&lt;p&gt;INTRODUCTION&lt;br&gt;
      ACID properties are a set of principles that guarantee the reliability of database transactions. They ensure that data remains consistent and accurate, even when multiple operations are happening at the same time or when a system failure occurs. For this assignment, I used Oracle Live SQL to demonstrate these fundamental properties.&lt;/p&gt;

&lt;p&gt;What are ACID Properties?&lt;br&gt;
Atomicity: An "all-or-nothing" principle. A transaction either completes entirely or doesn't happen at all. If any part fails, the entire transaction is rolled back.&lt;/p&gt;

&lt;p&gt;Consistency: A transaction brings the database from one valid state to another. It ensures that all data integrity rules (like constraints) are maintained.&lt;/p&gt;

&lt;p&gt;Isolation: Concurrent transactions don't interfere with each other. Each transaction appears to be the only one running, even if many are happening simultaneously.&lt;/p&gt;

&lt;p&gt;Durability: Once a transaction is committed, its changes are permanent and will survive a system crash or restart.&lt;/p&gt;

&lt;p&gt;To begin, I created a simple Accounts table and inserted some sample data.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Initial setup&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 (acc_no, name, balance) VALUES (101, 'Alice', 1000);&lt;br&gt;
INSERT INTO Accounts (acc_no, name, balance) VALUES (102, 'Bob', 500);&lt;br&gt;
INSERT INTO Accounts (acc_no, name, balance) VALUES (103, 'Charlie', 2000);&lt;/p&gt;

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

&lt;p&gt;Atomicity: The All-or-Nothing Transfer&lt;br&gt;
To demonstrate atomicity, I simulated a failed money transfer from Alice to Bob. The transaction involves two steps: decreasing Alice's balance and increasing Bob's. I used a ROLLBACK to simulate a failure after the first step.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Before the transaction&lt;br&gt;
SELECT * FROM Accounts WHERE acc_no IN (101, 102);&lt;/p&gt;

&lt;p&gt;-- Start a transaction&lt;br&gt;
SET TRANSACTION READ WRITE;&lt;/p&gt;

&lt;p&gt;-- Step 1: Transfer $200 from Alice (101)&lt;br&gt;
UPDATE Accounts SET balance = balance - 200 WHERE acc_no = 101;&lt;/p&gt;

&lt;p&gt;-- Intentionally rollback&lt;br&gt;
ROLLBACK;&lt;/p&gt;

&lt;p&gt;-- After rollback, the balance returns to the original state&lt;br&gt;
SELECT * FROM Accounts WHERE acc_no IN (101, 102);&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%2F0kma4dali53ojsxnd98v.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%2F0kma4dali53ojsxnd98v.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;br&gt;
As the screenshot shows, even though the UPDATE statement was executed, the ROLLBACK command ensured that no partial changes were saved. The balances for both Alice and Bob remained at their original values, proving the all-or-nothing nature of the transaction.&lt;/p&gt;

&lt;p&gt;Consistency: Enforcing Data Rules&lt;br&gt;
Consistency ensures that a transaction maintains the integrity of the database. I demonstrated this by adding a CHECK constraint to the Accounts table to prevent negative balances.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Drop the existing table and recreate it with a CHECK constraint&lt;br&gt;
DROP TABLE Accounts;&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 CHECK (balance &amp;gt;= 0)&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;-- Reinsert valid data&lt;br&gt;
INSERT INTO Accounts (acc_no, name, balance) VALUES (101, 'Alice', 1000);&lt;br&gt;
-- ... (rest of the valid inserts)&lt;/p&gt;

&lt;p&gt;-- Attempt to insert a record with a negative balance&lt;br&gt;
INSERT INTO Accounts (acc_no, name, balance) VALUES (104, 'David', -100);&lt;br&gt;
The INSERT statement with a negative balance was immediately rejected by the database. The screenshot below shows the specific error message, confirming that the CHECK constraint prevented the database from entering an invalid state.&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%2F0s3b30vmrmxrx2pe9vqn.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%2F0s3b30vmrmxrx2pe9vqn.png" alt=" " width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Isolation: Concurrent Transactions&lt;br&gt;
Isolation ensures that concurrent transactions don't affect each other. I used two separate Oracle Live SQL tabs (representing two different sessions) to demonstrate this.&lt;/p&gt;

&lt;p&gt;Session 1 (The Updater):&lt;/p&gt;

&lt;p&gt;In the first session, I started a transaction to update Alice's balance but did not commit it.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Session 1&lt;br&gt;
UPDATE Accounts SET balance = balance - 100 WHERE acc_no = 101;&lt;br&gt;
-- The transaction is still open...&lt;br&gt;
Session 2 (The Reader):&lt;/p&gt;

&lt;p&gt;In the second session, I ran a SELECT query on Alice's account. The database returned the old balance, as the changes from Session 1 were not yet committed and therefore not visible to other sessions.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Session 2&lt;br&gt;
SELECT * FROM Accounts WHERE acc_no = 101;&lt;br&gt;
-- The result will show the original balance (1000)&lt;br&gt;
Finally, I went back to Session 1 and committed the transaction. I then re-ran the query in Session 2, and this time, the new, updated balance was visible.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Back in Session 1&lt;br&gt;
COMMIT;&lt;/p&gt;

&lt;p&gt;-- Back in Session 2&lt;br&gt;
SELECT * FROM Accounts WHERE acc_no = 101;&lt;br&gt;
-- The result will now show the new balance (900)&lt;br&gt;
This demonstrates that the uncommitted changes from one transaction were isolated and invisible to another until the COMMIT command was executed.&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%2F9b4u8z1c772y5tvtw8cv.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%2F9b4u8z1c772y5tvtw8cv.png" alt=" " width="800" height="429"&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%2F9n7b91r7i7t8h4vwd0me.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%2F9n7b91r7i7t8h4vwd0me.png" alt=" " width="800" height="428"&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%2F1qymcmizymum7qj2s8dy.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%2F1qymcmizymum7qj2s8dy.png" alt=" " width="800" height="428"&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%2Fouunslmp9dx8i55k43jc.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%2Fouunslmp9dx8i55k43jc.png" alt=" " width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Durability: Permanent Changes&lt;br&gt;
Durability ensures that once a transaction is committed, the changes are permanent. I tested this by committing an update and then logging out and back into Oracle Live SQL (simulating a database restart) to check if the data persisted.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Update Charlie's account and commit&lt;br&gt;
UPDATE Accounts SET balance = balance + 50 WHERE acc_no = 103;&lt;br&gt;
COMMIT;&lt;br&gt;
After committing the change, I started a new, fresh session. A simple SELECT query confirmed that the new balance for Charlie was still there, proving that the committed change was durable.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- In a new session&lt;br&gt;
SELECT * FROM Accounts WHERE acc_no = 103;&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%2F1bx1v03l6a10ravyku3z.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%2F1bx1v03l6a10ravyku3z.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CONCLUSION&lt;br&gt;
This exercise with Oracle Live SQL provided a practical demonstration of the ACID properties. It highlighted how these principles are fundamental to ensuring data integrity, reliability, and security in any database system, from a simple application to a large-scale enterprise system.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>database</category>
      <category>oracle</category>
      <category>acid</category>
    </item>
    <item>
      <title>Mastering DBMS: A Practical Guide to Indexing, Hashing, and Query Optimization</title>
      <dc:creator>Haresh B</dc:creator>
      <pubDate>Wed, 08 Oct 2025 04:45:10 +0000</pubDate>
      <link>https://forem.com/haresh_511/mastering-dbms-a-practical-guide-to-indexing-hashing-and-query-optimization-35p4</link>
      <guid>https://forem.com/haresh_511/mastering-dbms-a-practical-guide-to-indexing-hashing-and-query-optimization-35p4</guid>
      <description>&lt;p&gt;Introduction&lt;br&gt;
In the world of database management, performance is key. One of the most effective ways to optimize query performance is by using indexes. This blog post will walk you through a practical assignment on creating and using different types of indexes in Oracle Live SQL. We'll cover B-Tree, B+ Tree, and Hash indexes, demonstrating how they speed up data retrieval.&lt;/p&gt;

&lt;p&gt;1.Setting Up Our Database: The Students Table&lt;br&gt;
First, let's create a table to work with. We'll design a simple Students table with fields for roll number, name, department, and CGPA. We’ll also insert at least 20 sample records to have enough data for our queries.&lt;/p&gt;

&lt;p&gt;Here's the SQL code:&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Create the Students table&lt;br&gt;
CREATE TABLE Students (&lt;br&gt;
    roll_no NUMBER(5) PRIMARY KEY,&lt;br&gt;
    name VARCHAR2(50),&lt;br&gt;
    dept VARCHAR2(10),&lt;br&gt;
    cgpa NUMBER(4, 2)&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;-- Insert at least 20 sample records&lt;br&gt;
-- Student: Akhil&lt;br&gt;
INSERT INTO Students VALUES (110, 'Akhil', 'CSBS', 9.15);&lt;br&gt;
INSERT INTO Students VALUES (101, 'Aarav', 'CSE', 8.50);&lt;br&gt;
INSERT INTO Students VALUES (102, 'Bhavana', 'ECE', 7.80);&lt;br&gt;
INSERT INTO Students VALUES (103, 'Chetan', 'IT', 9.00);&lt;br&gt;
INSERT INTO Students VALUES (104, 'Divya', 'MECH', 7.25);&lt;br&gt;
INSERT INTO Students VALUES (105, 'Esha', 'CIVIL', 8.90);&lt;br&gt;
INSERT INTO Students VALUES (106, 'Farhan', 'CSE', 6.50);&lt;br&gt;
INSERT INTO Students VALUES (107, 'Gauri', 'ECE', 8.10);&lt;br&gt;
INSERT INTO Students VALUES (108, 'Harish', 'IT', 7.55);&lt;br&gt;
INSERT INTO Students VALUES (109, 'Isha', 'MECH', 9.40);&lt;br&gt;
INSERT INTO Students VALUES (111, 'Jatin', 'CIVIL', 6.80);&lt;br&gt;
INSERT INTO Students VALUES (112, 'Kavya', 'CSE', 8.30);&lt;br&gt;
INSERT INTO Students VALUES (113, 'Lakshya', 'ECE', 7.95);&lt;br&gt;
INSERT INTO Students VALUES (114, 'Meera', 'IT', 9.20);&lt;br&gt;
INSERT INTO Students VALUES (115, 'Naveen', 'MECH', 8.75);&lt;br&gt;
INSERT INTO Students VALUES (116, 'Om', 'CIVIL', 7.00);&lt;br&gt;
INSERT INTO Students VALUES (117, 'Pooja', 'CSE', 9.50);&lt;br&gt;
INSERT INTO Students VALUES (118, 'Qadir', 'ECE', 6.90);&lt;br&gt;
INSERT INTO Students VALUES (119, 'Riya', 'IT', 8.65);&lt;br&gt;
INSERT INTO Students VALUES (120, 'Samar', 'MECH', 7.10);&lt;br&gt;
INSERT INTO Students VALUES (121, 'Tanya', 'CIVIL', 8.45);&lt;br&gt;
INSERT INTO Students VALUES (122, 'Uday', 'CSE', 9.05);&lt;/p&gt;

&lt;p&gt;-- Commit the changes&lt;br&gt;
COMMIT;&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%2F8t8nj1mpzi6e9q8pybxh.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%2F8t8nj1mpzi6e9q8pybxh.png" alt=" " width="800" height="422"&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%2Fi2np8ncwrntjy6p6fajy.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%2Fi2np8ncwrntjy6p6fajy.png" alt=" " width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.B-Tree Indexing on roll_no&lt;br&gt;
A B-Tree index is a data structure that helps locate a specific row in a table quickly. When you declare a column as a PRIMARY KEY, Oracle automatically creates a B-Tree index on it. This is perfect for single-value lookups, like searching for a student by their roll_no.&lt;/p&gt;

&lt;p&gt;Let's fetch the details for the student with roll_no = 110 (Akhil). The B-Tree index on roll_no makes this a very fast operation.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Execute a query to fetch the details of a student with roll_no = 110&lt;br&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%2Fewiimugeavx8g8ud0x4z.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%2Fewiimugeavx8g8ud0x4z.png" alt=" " width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3.B+ Tree Index for cgpa (Range Queries)&lt;br&gt;
While Oracle's standard index is a B-Tree, it's designed to efficiently handle range queries as well, much like a B+ Tree. The index on cgpa will allow us to quickly find all students whose grades fall within a certain range without scanning the entire table.&lt;/p&gt;

&lt;p&gt;We'll create an index on the cgpa column and then run a query to find all students with a CGPA greater than 8.0.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Create a B-Tree index on the cgpa column of the Students table.&lt;br&gt;
CREATE INDEX idx_students_cgpa ON Students(cgpa);&lt;/p&gt;

&lt;p&gt;-- Write a query to display all students with cgpa &amp;gt; 8.0.&lt;br&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%2Ffpv9hovqa0k027av2tdn.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%2Ffpv9hovqa0k027av2tdn.png" alt=" " width="800" height="424"&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%2Fiu9k4ct1dugafskq89jn.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%2Fiu9k4ct1dugafskq89jn.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4.Hash Index on dept (Equality Queries)&lt;br&gt;
A Hash index is ideal for equality searches, where you are looking for an exact match. In Oracle, a B-Tree index is also highly effective for this, but the concept of a hash index is worth understanding for its direct-addressing nature. For our purpose, we'll create a standard index on the dept column, which Oracle's query optimizer will use efficiently for our exact match query.&lt;/p&gt;

&lt;p&gt;Let's find all students from the 'CSBS' department.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Create an index on the dept column&lt;br&gt;
CREATE INDEX idx_students_dept ON Students(dept);&lt;/p&gt;

&lt;p&gt;-- Run a query to retrieve all students from the 'CSBS' department.&lt;br&gt;
SELECT * FROM Students WHERE dept = 'CSBS';&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%2Fd4l0erviioh80m3qmrag.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%2Fd4l0erviioh80m3qmrag.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
As you can see, using indexes is crucial for database performance. Whether you're doing a single-row lookup, a range search, or an exact-match query, a well-placed index can drastically reduce the time it takes to get your results. By understanding and implementing these indexing strategies, you can ensure your database queries are as optimized as possible.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>oracle</category>
      <category>data</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Solving a DBMS Assignment on Oracle Live SQL: Transactions, Deadlocks &amp; Log-Based Recovery</title>
      <dc:creator>Haresh B</dc:creator>
      <pubDate>Tue, 07 Oct 2025 18:30:35 +0000</pubDate>
      <link>https://forem.com/haresh_511/solving-a-dbms-assignment-on-oracle-live-sql-transactions-deadlocks-log-based-recovery-2hol</link>
      <guid>https://forem.com/haresh_511/solving-a-dbms-assignment-on-oracle-live-sql-transactions-deadlocks-log-based-recovery-2hol</guid>
      <description>&lt;p&gt;For a recent database management systems (DBMS) assignment, I had to demonstrate key concepts like atomicity, deadlocks, and log-based recovery using Oracle Live SQL. The assignment used a simple Accounts table to illustrate these principles. Here’s a breakdown of the tasks and how I solved them, along with the SQL queries I used.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Setup: A Simple Accounts Table
First, I created the Accounts table and populated it with some initial data. This is the starting point for all the tasks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key Point: The CREATE TABLE and INSERT queries set up the initial schema and data. COMMIT makes the initial state permanent.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Create the Accounts 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 the initial data&lt;br&gt;
INSERT INTO Accounts VALUES (1, 'Alice', 1000);&lt;br&gt;
INSERT INTO Accounts VALUES (2, 'Bob', 1500);&lt;br&gt;
INSERT INTO Accounts VALUES (3, 'Charlie', 2000);&lt;/p&gt;

&lt;p&gt;-- Commit the initial data to make it permanent&lt;br&gt;
COMMIT;&lt;/p&gt;

&lt;p&gt;-- View the initial state&lt;br&gt;
SELECT * FROM Accounts;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Transaction – Atomicity &amp;amp; Rollback
The goal of this task was to demonstrate atomicity, the "all or nothing" property of a transaction. I needed to perform a money transfer and then use ROLLBACK to undo it completely, proving that the transfer never partially completed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key Point: A transaction starts implicitly with the first UPDATE. ROLLBACK reverts both UPDATE statements simultaneously, showcasing atomicity.&lt;/p&gt;

&lt;p&gt;Queries:&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Perform a transfer from Alice to Bob&lt;br&gt;
UPDATE Accounts&lt;br&gt;
SET balance = balance - 500&lt;br&gt;
WHERE acc_no = 1;&lt;br&gt;
UPDATE Accounts&lt;br&gt;
SET balance = balance + 500&lt;br&gt;
WHERE acc_no = 2;&lt;/p&gt;

&lt;p&gt;-- Check the balances. They are updated, but not committed yet.&lt;br&gt;
SELECT * FROM Accounts;&lt;/p&gt;

&lt;p&gt;-- Rollback the transaction&lt;br&gt;
ROLLBACK;&lt;/p&gt;

&lt;p&gt;-- Check the balances again. They are back to the original values.&lt;br&gt;
SELECT * FROM Accounts;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log-Based Recovery
This task aimed to show that a ROLLBACK operation relies on the database’s logging system. In Oracle, this is handled by the undo tablespace, which stores the "before" image of the data. When I issue a ROLLBACK, the system uses this information to restore the original state.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key Point: The database automatically uses the undo tablespace for recovery. ROLLBACK relies on this logged information to revert changes.&lt;/p&gt;

&lt;p&gt;Queries:&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Update Charlie's balance (uncommitted)&lt;br&gt;
UPDATE Accounts&lt;br&gt;
SET balance = 2500&lt;br&gt;
WHERE acc_no = 3;&lt;/p&gt;

&lt;p&gt;-- Check the updated balance&lt;br&gt;
SELECT * FROM Accounts;&lt;/p&gt;

&lt;p&gt;-- Rollback the change&lt;br&gt;
ROLLBACK;&lt;/p&gt;

&lt;p&gt;-- Check the balance again. It has been reverted.&lt;br&gt;
SELECT * FROM Accounts;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Deadlock Simulation
This was the most challenging part of the assignment because it cannot be performed with a single script in Oracle Live SQL. A deadlock occurs when two or more transactions are waiting for a resource locked by another. This requires at least two separate sessions (two distinct connections to the database).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key Point: Deadlocks can't be simulated in a single-session environment like Oracle Live SQL. They require two separate sessions to create a circular dependency of locked resources. The DBMS detects this and automatically terminates one transaction.&lt;/p&gt;

&lt;p&gt;How it works conceptually:&lt;/p&gt;

&lt;p&gt;In Session 1, I would lock Alice’s account.&lt;/p&gt;

&lt;p&gt;In Session 2, I would lock Bob’s account.&lt;/p&gt;

&lt;p&gt;Session 1 would then try to update Bob’s account, and would wait.&lt;/p&gt;

&lt;p&gt;Session 2 would then try to update Alice’s account, causing a circular wait and a deadlock.&lt;/p&gt;

&lt;p&gt;This assignment was an excellent way to learn about the fundamental principles of transaction management that are critical for any database professional. I hope this helps anyone else working on a similar assignment!&lt;/p&gt;

</description>
      <category>oracle</category>
      <category>sqlserver</category>
      <category>database</category>
      <category>sql</category>
    </item>
    <item>
      <title>Mastering SQL: A Practical Guide to Cursors and Triggers in Oracle</title>
      <dc:creator>Haresh B</dc:creator>
      <pubDate>Tue, 07 Oct 2025 17:21:51 +0000</pubDate>
      <link>https://forem.com/haresh_511/mastering-sql-a-practical-guide-to-cursors-and-triggers-in-oracle-4f7</link>
      <guid>https://forem.com/haresh_511/mastering-sql-a-practical-guide-to-cursors-and-triggers-in-oracle-4f7</guid>
      <description>&lt;p&gt;Database management is a core skill for any developer, and two of the most powerful tools in SQL are cursors and triggers. While they serve different purposes, both allow for fine-grained control and automation within your database. In this post, we'll walk through a practical example of each using Oracle Live SQL.&lt;/p&gt;

&lt;p&gt;Part 1: Cursors – Processing a Result Set Row by Row&lt;br&gt;
A cursor is a database object that enables you to iterate through the records of a query's result set one at a time. This is particularly useful for performing actions that can't be done with a single SQL statement, like conditional processing or calling a function for each row.&lt;/p&gt;

&lt;p&gt;The Task: We want to create a cursor that finds and displays the names of all employees whose salary is greater than $50,000.&lt;/p&gt;

&lt;p&gt;Step 1: Create the Employee Table&lt;br&gt;
First, we need a table to hold our employee data. Here's the SQL to create the Employee table and populate it with some sample data.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;CREATE TABLE Employee (&lt;br&gt;
    EmployeeID INT PRIMARY KEY,&lt;br&gt;
    EmployeeName VARCHAR2(100),&lt;br&gt;
    Salary NUMBER(10, 2)&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%2F7vaqg5wkyi94vazges8h.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%2F7vaqg5wkyi94vazges8h.png" alt=" " width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;INSERT INTO Employee VALUES (1, 'Ravi', 65000.00);&lt;br&gt;
INSERT INTO Employee VALUES (2, 'Ram', 48000.00);&lt;br&gt;
INSERT INTO Employee VALUES (3, 'Nivas', 72000.00);&lt;br&gt;
INSERT INTO Employee VALUES (4, 'Guhan', 51000.00);&lt;/p&gt;

&lt;p&gt;COMMIT;&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%2Fu1p3p9xeivu2ltckcfzy.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%2Fu1p3p9xeivu2ltckcfzy.png" alt=" " width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Use a PL/SQL Block to Process the Cursor&lt;br&gt;
Now, we'll write a PL/SQL block. We'll declare a cursor that selects employees with a salary over $50,000, open it, loop through the results, and print the employee's name and salary.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;SET SERVEROUTPUT ON;&lt;/p&gt;

&lt;p&gt;DECLARE&lt;br&gt;
    v_employee_name Employee.EmployeeName%TYPE;&lt;br&gt;
    v_salary Employee.Salary%TYPE;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CURSOR c_employee IS
SELECT EmployeeName, Salary
FROM Employee
WHERE Salary &amp;gt; 50000;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;BEGIN&lt;br&gt;
    OPEN c_employee;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LOOP
    FETCH c_employee INTO v_employee_name, v_salary;

    EXIT WHEN c_employee%NOTFOUND;

    DBMS_OUTPUT.PUT_LINE('Employee: ' || v_employee_name || ' | Salary: ' || v_salary);
END LOOP;

CLOSE c_employee;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;END;&lt;br&gt;
/&lt;br&gt;
As you can see from the output, the code successfully identified and printed the employees who meet the salary condition.&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%2F0by964vj2xsx1wdqkbro.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%2F0by964vj2xsx1wdqkbro.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part 2: Triggers – Automating Database Events&lt;br&gt;
A trigger is a stored procedure that automatically runs when a specific event occurs on a table, such as an INSERT, UPDATE, or DELETE. Triggers are perfect for tasks like maintaining audit logs or enforcing business rules.&lt;/p&gt;

&lt;p&gt;The Task: We want to create an AFTER INSERT trigger on our Students table. Whenever a new student is added, a log entry should be automatically inserted into a separate Student_Audit table.&lt;/p&gt;

&lt;p&gt;Step 1: Create the Students and Student_Audit Tables&lt;br&gt;
We need two tables: Students to store the student data and Student_Audit to store the log entries.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Create the Students table&lt;br&gt;
CREATE TABLE Students (&lt;br&gt;
    StudentID INT PRIMARY KEY,&lt;br&gt;
    StudentName VARCHAR2(100),&lt;br&gt;
    RegistrationDate DATE&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%2Feh9q1salfsss2umbch80.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%2Feh9q1salfsss2umbch80.png" alt=" " width="800" height="425"&gt;&lt;/a&gt;&lt;br&gt;
-- Create the Student_Audit table&lt;br&gt;
CREATE TABLE Student_Audit (&lt;br&gt;
    AuditID INT GENERATED BY DEFAULT ON NULL AS IDENTITY PRIMARY KEY,&lt;br&gt;
    StudentID INT,&lt;br&gt;
    StudentName VARCHAR2(100),&lt;br&gt;
    ActionType VARCHAR2(20),&lt;br&gt;
    ActionDate 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%2Fnwh9swm3p37z9u1jclhv.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%2Fnwh9swm3p37z9u1jclhv.png" alt=" " width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Create the AFTER INSERT Trigger&lt;br&gt;
The following trigger uses the special :NEW virtual record to access the values of the row that was just inserted and automatically logs them into the Student_Audit table.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;CREATE OR REPLACE TRIGGER trg_Student_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 (&lt;br&gt;
        StudentID,&lt;br&gt;
        StudentName,&lt;br&gt;
        ActionType,&lt;br&gt;
        ActionDate&lt;br&gt;
    ) VALUES (&lt;br&gt;
        :NEW.StudentID,&lt;br&gt;
        :NEW.StudentName,&lt;br&gt;
        'INSERT',&lt;br&gt;
        SYSTIMESTAMP&lt;br&gt;
    );&lt;br&gt;
END;&lt;br&gt;
/&lt;br&gt;
Step 3: Test the Trigger by Inserting Data&lt;br&gt;
Now, let's insert a few student records. For each INSERT statement we run, the trigger will automatically fire.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;-- Insert the new student records&lt;br&gt;
INSERT INTO Students (StudentID, StudentName, RegistrationDate) VALUES (101, 'Ravi', SYSDATE);&lt;br&gt;
INSERT INTO Students (StudentID, StudentName, RegistrationDate) VALUES (102, 'Ram', SYSDATE);&lt;br&gt;
INSERT INTO Students (StudentID, StudentName, RegistrationDate) VALUES (103, 'Nivas', SYSDATE);&lt;br&gt;
INSERT INTO Students (StudentID, StudentName, RegistrationDate) VALUES (104, 'Guhan', SYSDATE);&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%2F4vd29x1ti6hqogecf2ko.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%2F4vd29x1ti6hqogecf2ko.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, we'll query the Student_Audit table to confirm that all four INSERT actions were logged.&lt;/p&gt;

&lt;p&gt;SQL&lt;/p&gt;

&lt;p&gt;SELECT * FROM Student_Audit;&lt;br&gt;
The output clearly shows that the trigger worked perfectly. Each new student was logged with their StudentID, StudentName, and the time of the insertion.&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%2F08iw3nsdifio4er9pyvh.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%2F08iw3nsdifio4er9pyvh.png" alt=" " width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
As you can see, cursors and triggers are incredibly useful for handling specific data-processing tasks and automating operations. They give you the power to go beyond standard SQL statements and build a more robust and responsive database system.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>oracle</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>College Student &amp; Course Management System</title>
      <dc:creator>Haresh B</dc:creator>
      <pubDate>Wed, 20 Aug 2025 17:32:41 +0000</pubDate>
      <link>https://forem.com/haresh_511/college-student-course-management-system-1on3</link>
      <guid>https://forem.com/haresh_511/college-student-course-management-system-1on3</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This blog covers the implementation of a simple College Student &amp;amp; Course Management System using SQL on Oracle LiveSQL. It demonstrates key database concepts such as table creation, data insertion, constraint addition, queries with functions and aggregates, joins, views, and stored procedures.&lt;/p&gt;

&lt;p&gt;The use case focuses on managing students, courses, enrollments, and faculty members with related operations.&lt;/p&gt;




&lt;h2&gt;
  
  
  Database Schema
&lt;/h2&gt;

&lt;p&gt;The database contains four main tables: Students, Courses, Enrollments, and Faculty.&lt;/p&gt;

&lt;h3&gt;
  
  
  Students Table
&lt;/h3&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;h3&gt;
  
  
  Courses Table
&lt;/h3&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;h3&gt;
  
  
  Enrollments Table
&lt;/h3&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;h3&gt;
  
  
  Faculty Table
&lt;/h3&gt;

&lt;p&gt;CREATE TABLE Faculty (&lt;br&gt;
FacultyID NUMBER PRIMARY KEY,&lt;br&gt;
FacultyName VARCHAR2(50) NOT NULL,&lt;br&gt;
Dept VARCHAR2(30),&lt;br&gt;
Email VARCHAR2(50) UNIQUE&lt;br&gt;
);&lt;/p&gt;




&lt;h2&gt;
  
  
  Data Insertion
&lt;/h2&gt;

&lt;p&gt;Sample data was inserted into these tables to represent students, courses, and their enrollments:&lt;/p&gt;

&lt;p&gt;INSERT INTO Students (StudentID, Name, Dept, DOB, Email)&lt;br&gt;
VALUES (1, 'Alice Johnson', 'Computer Science', TO_DATE('2002-04-15', 'YYYY-MM-DD'), '&lt;a href="mailto:alice.johnson@example.com"&gt;alice.johnson@example.com&lt;/a&gt;');&lt;/p&gt;

&lt;p&gt;INSERT INTO Students (StudentID, Name, Dept, DOB, Email)&lt;br&gt;
VALUES (2, 'Bob Smith', 'Mathematics', TO_DATE('2001-11-23', 'YYYY-MM-DD'), '&lt;a href="mailto:bob.smith@example.com"&gt;bob.smith@example.com&lt;/a&gt;');&lt;/p&gt;

&lt;p&gt;INSERT INTO Students (StudentID, Name, Dept, DOB, Email)&lt;br&gt;
VALUES (3, 'Cathy Brown', 'Physics', TO_DATE('2003-07-02', 'YYYY-MM-DD'), '&lt;a href="mailto:cathy.brown@example.com"&gt;cathy.brown@example.com&lt;/a&gt;');&lt;/p&gt;

&lt;p&gt;INSERT INTO Courses (CourseID, CourseName, Credits) VALUES (101, 'Databases', 4);&lt;br&gt;
INSERT INTO Courses (CourseID, CourseName, Credits) VALUES (102, 'Algorithms', 3);&lt;br&gt;
INSERT INTO Courses (CourseID, CourseName, Credits) VALUES (103, 'Physics', 5);&lt;/p&gt;

&lt;p&gt;INSERT INTO Enrollments (EnrollID, StudentID, CourseID, Grade) VALUES (1, 1, 101, 'A');&lt;br&gt;
INSERT INTO Enrollments (EnrollID, StudentID, CourseID, Grade) VALUES (2, 2, 102, 'B+');&lt;br&gt;
INSERT INTO Enrollments (EnrollID, StudentID, CourseID, Grade) VALUES (3, 3, 103, 'A-');&lt;/p&gt;




&lt;h2&gt;
  
  
  Table Alterations and Constraints
&lt;/h2&gt;

&lt;p&gt;Added a new column &lt;code&gt;PhoneNo&lt;/code&gt; to &lt;code&gt;Students&lt;/code&gt; and a &lt;code&gt;CHECK&lt;/code&gt; constraint on the &lt;code&gt;Credits&lt;/code&gt; column of &lt;code&gt;Courses&lt;/code&gt;:&lt;/p&gt;

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

&lt;p&gt;ALTER TABLE Courses ADD CONSTRAINT chk_credits CHECK (Credits BETWEEN 1 AND 5);&lt;/p&gt;




&lt;h2&gt;
  
  
  SQL Queries with Functions and Aggregates
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Listing student names in uppercase and length of their emails:&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Calculating average course credits and counting enrolled students:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SELECT&lt;br&gt;
(SELECT AVG(Credits) FROM Courses) AS AvgCredits,&lt;br&gt;
(SELECT COUNT(DISTINCT StudentID) FROM Enrollments) AS TotalStudentsEnrolled&lt;br&gt;
FROM dual;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sample result:&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;UppercaseName&lt;/th&gt;
&lt;th&gt;EmailLength&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ALICE JOHNSON&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BOB SMITH&lt;/td&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CATHY BROWN&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;AvgCredits&lt;/th&gt;
&lt;th&gt;TotalStudentsEnrolled&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4.0&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  JOIN Queries
&lt;/h2&gt;

&lt;p&gt;Joining Students, Enrollments, and Courses to show which student is enrolled in which course along with grades:&lt;/p&gt;

&lt;p&gt;SELECT s.Name AS StudentName, c.CourseName, e.Grade&lt;br&gt;
FROM Students s&lt;br&gt;
JOIN Enrollments e ON s.StudentID = e.StudentID&lt;br&gt;
JOIN Courses c ON c.CourseID = e.CourseID;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sample result:&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;StudentName&lt;/th&gt;
&lt;th&gt;CourseName&lt;/th&gt;
&lt;th&gt;Grade&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Alice Johnson&lt;/td&gt;
&lt;td&gt;Databases&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bob Smith&lt;/td&gt;
&lt;td&gt;Algorithms&lt;/td&gt;
&lt;td&gt;B+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cathy Brown&lt;/td&gt;
&lt;td&gt;Physics&lt;/td&gt;
&lt;td&gt;A-&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  GROUP BY and HAVING Clause
&lt;/h2&gt;

&lt;p&gt;Counting students in each department and filtering departments with more than 2 students:&lt;/p&gt;

&lt;p&gt;SELECT Dept, COUNT(&lt;em&gt;) AS StudentCount&lt;br&gt;
FROM Students&lt;br&gt;
GROUP BY Dept&lt;br&gt;
HAVING COUNT(&lt;/em&gt;) &amp;gt; 2;&lt;/p&gt;




&lt;h2&gt;
  
  
  Views
&lt;/h2&gt;

&lt;p&gt;Created a view to simplify student-course-grade lookup:&lt;/p&gt;

&lt;p&gt;CREATE OR REPLACE VIEW StudentCoursesView AS&lt;br&gt;
SELECT s.Name AS StudentName, c.CourseName, e.Grade&lt;br&gt;
FROM Students s&lt;br&gt;
JOIN Enrollments e ON s.StudentID = e.StudentID&lt;br&gt;
JOIN Courses c ON c.CourseID = e.CourseID;&lt;/p&gt;




&lt;h2&gt;
  
  
  Stored Procedure
&lt;/h2&gt;

&lt;p&gt;Procedure to update a student's grade in enrollments:&lt;/p&gt;

&lt;p&gt;CREATE OR REPLACE PROCEDURE UpdateGrade (&lt;br&gt;
p_StudentID IN NUMBER,&lt;br&gt;
p_CourseID IN NUMBER,&lt;br&gt;
p_NewGrade IN CHAR&lt;br&gt;
) AS&lt;br&gt;
BEGIN&lt;br&gt;
UPDATE Enrollments&lt;br&gt;
SET Grade = p_NewGrade&lt;br&gt;
WHERE StudentID = p_StudentID AND CourseID = p_CourseID;&lt;br&gt;
COMMIT;&lt;br&gt;
END;&lt;br&gt;
/&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;This assignment reinforced understanding of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating and managing SQL database schemas&lt;/li&gt;
&lt;li&gt;Writing data manipulation queries&lt;/li&gt;
&lt;li&gt;Using SQL functions and aggregate operations&lt;/li&gt;
&lt;li&gt;Performing joins to combine related data&lt;/li&gt;
&lt;li&gt;Creating views and stored procedures to enhance SQL capabilities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to try the full script on &lt;a href="https://livesql.oracle.com" rel="noopener noreferrer"&gt;Oracle LiveSQL&lt;/a&gt; to see these operations in action.&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%2F4lzai9j26poxhcmkvcqn.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%2F4lzai9j26poxhcmkvcqn.jpg" alt=" " width="800" height="376"&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%2Fl2bpw1dh8v2yscn5xprt.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%2Fl2bpw1dh8v2yscn5xprt.jpg" alt=" " width="800" height="376"&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%2Fcnqbpczkizvh02vks7zp.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%2Fcnqbpczkizvh02vks7zp.jpg" alt=" " width="800" height="376"&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%2Fbo4yexpdvueiax3a1480.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%2Fbo4yexpdvueiax3a1480.jpg" alt=" " width="800" height="375"&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%2Fya7v1cmo3khmwpgnrzme.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%2Fya7v1cmo3khmwpgnrzme.jpg" alt=" " width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sql</category>
      <category>oracle</category>
      <category>database</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
