<?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: Sonali Suri</title>
    <description>The latest articles on DEV Community by Sonali Suri (@sonalisuri).</description>
    <link>https://dev.to/sonalisuri</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%2F3320735%2Fc082c79b-ecc6-4068-af48-3e93beec88dd.png</url>
      <title>DEV Community: Sonali Suri</title>
      <link>https://dev.to/sonalisuri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sonalisuri"/>
    <language>en</language>
    <item>
      <title>SQL Confused Me for Months—Here’s What Finally Made It Click 🧠</title>
      <dc:creator>Sonali Suri</dc:creator>
      <pubDate>Thu, 03 Jul 2025 23:55:54 +0000</pubDate>
      <link>https://dev.to/sonalisuri/sql-confused-me-for-months-heres-what-finally-made-it-click-1mi5</link>
      <guid>https://dev.to/sonalisuri/sql-confused-me-for-months-heres-what-finally-made-it-click-1mi5</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;💬 &lt;em&gt;All views in this post are my own and do not represent any company, employer, or organization I'm affiliated with. This is a personal take on learning SQL.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;When I first started learning SQL, I thought it would be easy.&lt;br&gt;&lt;br&gt;
I mean, it uses real English words like &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;FROM&lt;/code&gt;, and &lt;code&gt;WHERE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How hard could it be?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well… turns out it can be pretty confusing. And if you’ve ever stared at a SQL query thinking &lt;em&gt;“Why doesn’t this make any sense?”&lt;/em&gt;, you’re not alone.&lt;/p&gt;

&lt;p&gt;Let’s break down &lt;strong&gt;why SQL feels weird&lt;/strong&gt;, and more importantly, &lt;strong&gt;how to finally get comfortable with it&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  💭 Why SQL Feels So Weird
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. It’s not like regular code
&lt;/h3&gt;

&lt;p&gt;Most programming languages are step-by-step (aka procedural).&lt;br&gt;&lt;br&gt;
SQL is &lt;em&gt;declarative&lt;/em&gt; — you describe what you want, not how to do it.&lt;/p&gt;

&lt;p&gt;It’s like ordering food at a restaurant:&lt;br&gt;&lt;br&gt;
You say what dish you want, not how to make it.&lt;/p&gt;

&lt;p&gt;That shift in thinking takes time.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Joins are sneaky tricky
&lt;/h3&gt;

&lt;p&gt;Ever done a &lt;code&gt;JOIN&lt;/code&gt; and ended up with 10,000 rows instead of 10?&lt;/p&gt;

&lt;p&gt;Yeah, same.&lt;/p&gt;

&lt;p&gt;Joins connect tables based on matching values, but one small mistake and your result becomes a mess of duplicates or empty rows.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Error messages are cryptic
&lt;/h3&gt;

&lt;p&gt;SQL doesn’t really help you debug.&lt;/p&gt;

&lt;p&gt;It’ll say something like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ERROR: invalid identifier&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And you’re left wondering &lt;em&gt;what&lt;/em&gt; went wrong &lt;em&gt;where&lt;/em&gt;. It’s like a database shrug.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. SQL doesn’t run top to bottom
&lt;/h3&gt;

&lt;p&gt;Here’s a weird thing: even though you write this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT name FROM users WHERE age &amp;gt; 30;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;…it actually runs in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;FROM&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WHERE&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GROUP BY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;HAVING&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SELECT&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ORDER BY&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once I learned that, everything started making more sense.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ How to Actually Get Better at SQL
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Use data you care about
&lt;/h3&gt;

&lt;p&gt;Don’t just practice on “employee” tables.&lt;br&gt;&lt;br&gt;
Use data you &lt;em&gt;like&lt;/em&gt;—like movies, books, games, Spotify playlists.  &lt;/p&gt;

&lt;p&gt;When the data is fun, writing queries feels way less boring.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Write the query in plain English first
&lt;/h3&gt;

&lt;p&gt;Before typing any SQL, just write out what you want in your own words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I want a list of users who signed up in the last 30 days.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then build it line by line.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Use free sandboxes to practice
&lt;/h3&gt;

&lt;p&gt;No setup needed. Just open and query:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧪 &lt;a href="https://sqlbolt.com/" rel="noopener noreferrer"&gt;SQLBolt&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🧠 &lt;a href="https://mode.com/sql-tutorial/" rel="noopener noreferrer"&gt;Mode SQL Tutorial&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🧰 &lt;a href="https://www.db-fiddle.com/" rel="noopener noreferrer"&gt;DB Fiddle&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Learn the actual execution order
&lt;/h3&gt;

&lt;p&gt;This is huge.&lt;br&gt;&lt;br&gt;
Once you know how SQL actually runs your query, you’ll understand why stuff breaks—and how to fix it.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. Draw it out
&lt;/h3&gt;

&lt;p&gt;If you're stuck on joins or multi-table queries, draw a quick diagram.&lt;br&gt;&lt;br&gt;
Even just boxes and lines can help you visualize how data is connected.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎉 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;SQL is different. It’s not always beginner-friendly. But it’s not impossible either.&lt;/p&gt;

&lt;p&gt;Once I stopped treating it like a "normal" programming language and started thinking in &lt;strong&gt;data logic&lt;/strong&gt;, it clicked.&lt;/p&gt;

&lt;p&gt;So if you’re struggling:&lt;br&gt;&lt;br&gt;
✅ Be patient.&lt;br&gt;&lt;br&gt;
✅ Google stuff.&lt;br&gt;&lt;br&gt;
✅ Break big queries into small ones.&lt;br&gt;&lt;br&gt;
✅ And don’t give up.&lt;/p&gt;

&lt;p&gt;Even the best developers once messed up a &lt;code&gt;JOIN&lt;/code&gt; and got a million duplicate rows. 😉&lt;/p&gt;

</description>
      <category>programming</category>
      <category>newbie</category>
      <category>sql</category>
      <category>code</category>
    </item>
  </channel>
</rss>
