<?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: Harshitha Madhavarapu</title>
    <description>The latest articles on DEV Community by Harshitha Madhavarapu (@harshitha_madhavarapu).</description>
    <link>https://dev.to/harshitha_madhavarapu</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4108130%2F2db1a0a7-bb68-40fa-8610-efc1b4859d7a.jpg</url>
      <title>DEV Community: Harshitha Madhavarapu</title>
      <link>https://dev.to/harshitha_madhavarapu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harshitha_madhavarapu"/>
    <language>en</language>
    <item>
      <title>SQL Basics: A Real-World Guide to Databases and Queries</title>
      <dc:creator>Harshitha Madhavarapu</dc:creator>
      <pubDate>Thu, 03 Sep 2026 14:20:10 +0000</pubDate>
      <link>https://dev.to/harshitha_madhavarapu/sql-basics-a-real-world-guide-to-databases-and-queries-3mc7</link>
      <guid>https://dev.to/harshitha_madhavarapu/sql-basics-a-real-world-guide-to-databases-and-queries-3mc7</guid>
      <description>&lt;p&gt;If you’ve come across the word “SQL” and were not sure about it, you’re in the right place. This guide explains SQL in simple language. No prior technical knowledge is needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Database?
&lt;/h2&gt;

&lt;p&gt;Every time you order food through an app like Swiggy or Zomato, a lot happens behind the scenes. Your name, address, phone number, order history, and information related to your payments all need to be stored somewhere safe and organized. That somewhere is a database.&lt;/p&gt;

&lt;p&gt;A database is a structured way to store information, organized into tables with rows and columns, similar to how you’d arrange data in Excel.&lt;/p&gt;

&lt;p&gt;Here’s what a simple customer table in a food delivery app might look like:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0321ibsbi5ywhr5bkuyo.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0321ibsbi5ywhr5bkuyo.jpg" alt=" " width="799" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each row is one customer. Each column holds one detail about them. Clean, organized, and easy to search, even with millions of customers.&lt;/p&gt;

&lt;p&gt;Almost every app you use daily — food delivery, banking, shopping — runs on a database.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SQL?
&lt;/h2&gt;

&lt;p&gt;SQL stands for Structured Query Language. It is the language used to communicate with a database to fetch information, add new records, update existing ones, or delete data you no longer need.&lt;/p&gt;

&lt;p&gt;If the database is where information lives, SQL is how you interact with it. You write a simple instruction, and the database responds instantly, even across millions of records.&lt;/p&gt;

&lt;p&gt;SQL is pronounced either “S-Q-L” or “sequel”.&lt;/p&gt;

&lt;p&gt;What makes SQL approachable is how close it reads to plain English. Even someone who has never written code before can look at a SQL statement and understand roughly what it does.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 4 Basic SQL Commands
&lt;/h2&gt;

&lt;p&gt;Almost everything you do in a database comes down to four commands. Let’s walk through each one using a food delivery orders table as our example.&lt;/p&gt;

&lt;p&gt;Here’s the data we’ll be working with:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsocoaogi3tejg278lzvb.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsocoaogi3tejg278lzvb.jpg" alt=" " width="800" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. SELECT — Retrieve Data
&lt;/h2&gt;

&lt;p&gt;SELECT is used to fetch data from a table. It is the most commonly used SQL command.&lt;/p&gt;

&lt;p&gt;Want to see all orders placed on the app?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Want only the customer names and their cities?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;CustomerName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;City&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The * means fetch everything. You can also pick just the columns you need.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. INSERT — Add New Data
&lt;/h2&gt;

&lt;p&gt;INSERT is used to add a new record.&lt;/p&gt;

&lt;p&gt;When a customer places a fresh order on a food delivery app, it gets added to the database instantly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;OrderID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CustomerName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;City&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;505&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Priya Iyer'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mumbai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Pav Bhaji'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Pending'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Priya’s order now appears as a new row in the orders table.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. UPDATE — Modify Existing Data
&lt;/h2&gt;

&lt;p&gt;UPDATE is used to change an existing record.&lt;/p&gt;

&lt;p&gt;Vikram’s order was pending. It just got delivered and needs to be updated.&lt;/p&gt;

&lt;p&gt;Now imagine running this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;Status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Delivered'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every single order in the table — including the ones still being prepared — would be marked as Delivered. That's a problem.&lt;/p&gt;

&lt;p&gt;This is the right way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;Status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Delivered'&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;OrderID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;503&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now only Vikram's order gets updated. Everything else stays exactly as it was.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. DELETE — Remove Data
&lt;/h2&gt;

&lt;p&gt;DELETE is used to remove a record.&lt;/p&gt;

&lt;p&gt;Imagine an order was added to the database by mistake, and you want to remove that order.&lt;/p&gt;

&lt;p&gt;Running this would be a disaster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The entire orders table, all records gone in one second. No warning, no undo.&lt;/p&gt;

&lt;p&gt;The correct way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;OrderID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;505&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only that order gets removed. Everyone else’s order is safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  How a Food Delivery App Could Use SQL Behind the Scenes
&lt;/h2&gt;

&lt;p&gt;Imagine a food delivery app built on SQL. Every time you open the app and check your order history, a SELECT fetches your past orders. When you place a new order, an INSERT adds it to the database. When the delivery partner picks it up, an UPDATE changes the status from Pending to Out for Delivery. And if an order needs to be removed from the database, a DELETE can remove that specific record.&lt;/p&gt;

&lt;p&gt;All of that could happen in seconds, powered entirely by SQL working behind the scenes.&lt;/p&gt;

&lt;p&gt;This is how real applications use SQL every day — fetching records, adding new data, updating statuses, and keeping everything accurate across millions of users at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why SQL is Worth Learning
&lt;/h2&gt;

&lt;p&gt;SQL is used across almost every industry — banking, healthcare, retail, logistics, and tech. If a business stores data, SQL is involved somewhere.&lt;/p&gt;

&lt;p&gt;It is one of the most beginner-friendly technical skills because it reads close to plain English. And once you know SQL, it opens up roles in data analysis, database administration, backend development, and cloud platforms like Microsoft Azure — all of which can benefit from a strong understanding of SQL.&lt;/p&gt;

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

&lt;p&gt;SQL is simply a way to talk to a database. The four commands — SELECT, INSERT, UPDATE, and DELETE — are the foundation, and everything else builds on top of them. Once these feel familiar, working with real databases becomes a lot simpler than it sounds.&lt;/p&gt;

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