<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[databites.tech: SQL crash course 🔢]]></title><description><![CDATA[Whether you're just starting out or looking to sharpen your SQL skills, this series will take you from zero to hero with a structured, easy-to-follow approach. ]]></description><link>https://reads.databites.tech/s/sql-crash-course</link><image><url>https://substackcdn.com/image/fetch/$s_!nYiM!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F151064b1-1b76-4f6d-adaf-0efcacff80d1_281x281.png</url><title>databites.tech: SQL crash course 🔢</title><link>https://reads.databites.tech/s/sql-crash-course</link></image><generator>Substack</generator><lastBuildDate>Tue, 09 Jun 2026 19:39:21 GMT</lastBuildDate><atom:link href="https://reads.databites.tech/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Josep Ferrer]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[databites.hi@gmail.com]]></webMaster><itunes:owner><itunes:email><![CDATA[databites.hi@gmail.com]]></itunes:email><itunes:name><![CDATA[Josep Ferrer]]></itunes:name></itunes:owner><itunes:author><![CDATA[Josep Ferrer]]></itunes:author><googleplay:owner><![CDATA[databites.hi@gmail.com]]></googleplay:owner><googleplay:email><![CDATA[databites.hi@gmail.com]]></googleplay:email><googleplay:author><![CDATA[Josep Ferrer]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[SQL COURSE PROBLEM #4]]></title><description><![CDATA[SQL Crash Course - Managing Financial Services Database]]></description><link>https://reads.databites.tech/p/sql-course-problem-4</link><guid isPermaLink="false">https://reads.databites.tech/p/sql-course-problem-4</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Fri, 06 Jun 2025 11:22:18 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RryE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d8ee22-a790-4cbe-9cac-63125f0c89d7_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve for&#8230;</p>
      <p>
          <a href="https://reads.databites.tech/p/sql-course-problem-4">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[SQL COURSE PROBLEM #1]]></title><description><![CDATA[SQL Crash Course - Managing your own newsletters]]></description><link>https://reads.databites.tech/p/sql-course-problem-1</link><guid isPermaLink="false">https://reads.databites.tech/p/sql-course-problem-1</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Thu, 29 May 2025 12:02:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!YPzg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5ec4a4b-f38b-46cf-92a0-4287d031a25e_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve for&#8230;</p>
      <p>
          <a href="https://reads.databites.tech/p/sql-course-problem-1">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[SQL Crash Course – Getting into Practice! 👨🏻‍💻]]></title><description><![CDATA[SQL Crash Course Tehory Ending, and starting of hands-on! &#128640;]]></description><link>https://reads.databites.tech/p/sql-crash-course-getting-into-practice</link><guid isPermaLink="false">https://reads.databites.tech/p/sql-crash-course-getting-into-practice</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Fri, 23 May 2025 10:02:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0uya!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey everyone! Josep and Cornellius one more week of SQL learning! &#128075;&#127995;</p><p>Can you believe it&#8217;s already been <strong>2 months</strong> since <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Cornellius Yudha Wijaya&quot;,&quot;id&quot;:6000855,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8981f4c2-dc6b-42f7-a2bd-9751653af571_512x512.jpeg&quot;,&quot;uuid&quot;:&quot;9c7a043d-f76d-4e3a-964b-8e495ce09f42&quot;}" data-component-name="MentionToDOM"></span> (from <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Non-Brand Data&quot;,&quot;id&quot;:37262,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/cornellius&quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/6c0e1cde-d120-4029-8ffd-2a8c7c6e4504_1280x1280.png&quot;,&quot;uuid&quot;:&quot;24794f1a-7a13-4a47-b5c0-1e53363fa81a&quot;}" data-component-name="MentionToDOM"></span> ) and I (from <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;DataBites&quot;,&quot;id&quot;:2143185,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/rfeers&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e930fbab-b8df-40ef-9676-3d9ca5d49eae_714x714.png&quot;,&quot;uuid&quot;:&quot;560fa677-00b7-46c2-a9e4-66e5e062ef0b&quot;}" data-component-name="MentionToDOM"></span> ) kicked off our <strong>SQL Crash Course</strong>? &#127881;<br>What started as a fun idea quickly turned into a full-blown series &#8212; and today, we&#8217;re sharing a <strong>recap of everything we&#8217;ve covered&#8230; and what&#8217;s coming next!</strong> &#128588;&#127995;</p><h2>&#128293; What&#8217;s inside the course?</h2><p>We&#8217;ve structured the course into <strong>7 key modules</strong> to take you from zero to SQL hero:</p><ol><li><p><strong>Introduction</strong> &#8211; What SQL is and why it matters</p></li><li><p><strong>SQL Fundamentals</strong> &#8211; Basic commands, filtering, and aggregation</p></li><li><p><strong>Intermediate SQL</strong> &#8211; Joins, unions, and functions</p></li><li><p><strong>Advanced SQL</strong> &#8211; Subqueries, CTEs, recursion, and views</p></li><li><p><strong>Database Operations</strong> &#8211; CRUD, schema changes, and optimization</p></li><li><p><strong>Crafting Good SQL Queries</strong> &#8211; Best practices for writing efficient queries</p></li><li><p><strong>Real-world Problems</strong> &#8211; Applying SQL to practical challenges</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0uya!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0uya!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!0uya!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!0uya!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!0uya!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0uya!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png" width="1456" height="743" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:490572,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158754537?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0uya!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!0uya!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!0uya!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!0uya!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>&#9989; What We&#8217;ve Covered So Far</h3><p>We&#8217;ve completed <strong>Modules 1 through 6</strong> &#8212; all the theory and best practices you need.<br>You can catch up on each lesson here:</p><h4><strong>1&#65039;&#8419; Introduction to SQL</strong></h4><ul><li><p> <strong>#1. What is SQL? &#8594; <a href="https://www.nb-data.com/p/2-what-is-sql">link</a></strong></p></li><li><p><strong>#2. Why Learn SQL? &#8594; <a href="https://www.databites.tech/p/2-why-learn-sql">link</a></strong></p></li><li><p><strong>#3. Relational Data &amp; Models &#8594; <a href="https://www.databites.tech/p/3-relational-data-and-models">link</a></strong></p></li></ul><h4><strong>2&#65039;&#8419; SQL Fundamentals</strong></h4><ul><li><p><strong>#4. Basic Commands (SELECT, FROM, WHERE) &#8594; <a href="https://www.nb-data.com/p/4-sql-basic-commands">link</a></strong></p></li><li><p><strong>#5. Sorting &amp; Limiting (ORDER BY, LIMIT)&#8594;</strong> <strong><a href="https://www.databites.tech/p/5-sorting-and-limiting">link</a></strong></p></li><li><p><strong>#6. Aggregate Functions (SUM, AVG, COUNT, etc.) &#8594; <a href="https://www.nb-data.com/p/6-aggregate-functions">link</a></strong></p></li></ul><h4><strong>3&#65039;&#8419; Intermediate SQL</strong></h4><ul><li><p><strong>#7. JOINS (INNER, LEFT, RIGHT, FULL) &#8594; <a href="https://www.databites.tech/p/7-joins-left-right-inner-and-full">link</a> </strong></p></li><li><p><strong>#8. UNION &amp; UNION ALL &#8594;</strong> <strong><a href="https://www.nb-data.com/p/8-union-and-union-all">link</a></strong></p></li><li><p><strong>#9. Case Expressions &#8594; <a href="https://www.databites.tech/p/9-case-expressions">link</a></strong></p></li><li><p><strong>#10. Functions (String, Date, Numeric) &#8594; <a href="https://www.nb-data.com/p/10-functions-string-date-numeric">link</a></strong></p></li></ul><h4><strong>4&#65039;&#8419; Advanced SQL</strong></h4><ul><li><p><strong>#11. Subqueries &#8594; <a href="https://www.nb-data.com/p/11-subqueries">link</a></strong></p></li><li><p><strong>#12. Common Table Expressions (CTEs) &#8594;</strong> <strong><a href="https://www.databites.tech/p/12-common-table-expressions-ctes">link</a></strong></p></li><li><p><strong>#13. Recursion &#8594;</strong> <strong><a href="https://www.nb-data.com/p/13-recursion">link</a></strong></p></li><li><p><strong>#14. Views  &#8594;</strong> <strong><a href="https://www.databites.tech/p/14-views">link</a></strong></p></li></ul><h4><strong>5&#65039;&#8419; Database Operations</strong></h4><ul><li><p><strong>#15. CRUD operations (INSERT, UPDATE, DELETE) &#8594;</strong><em> </em><strong><a href="https://www.nb-data.com/p/15-crud-operations">link</a></strong></p></li><li><p><strong>#16. Database modifications (ALTER, DROP, CREATE) &#8594;</strong> <strong><a href="https://www.databites.tech/p/16-database-modifications">link</a></strong></p></li><li><p><strong>#17. Indexing &amp; Optimization &#8594; <a href="https://www.nb-data.com/p/17-indexing-and-optimization">link</a></strong></p></li></ul><h4><strong>6&#65039;&#8419; Crafting Good SQL queries</strong></h4><ul><li><p><strong>#18. Modular Code &#8594;<a href="https://www.databites.tech/p/18-generating-modular-code">link</a></strong></p></li><li><p><strong>#19. SQL Execution Order &#8594; <a href="https://www.databites.tech/p/19-sql-execution-order">link</a></strong></p></li><li><p><strong>#20. Query Optimization &#8594; <a href="https://www.nb-data.com/p/20-query-optimization">link</a></strong> </p></li></ul><p>So the following question is&#8230; </p><h3>&#128284; What&#8217;s Next?</h3><p>Now it&#8217;s time to <strong>put theory into practice</strong>! Over the next few weeks, we&#8217;ll release hands-on exercises and projects to help you apply what you&#8217;ve learned:</p><h4>7&#65039;&#8419; 7. Real-World Problems (Quick Wins)</h4><p>Easy-level problems, perfect for 30&#8211;60 minutes of practice:</p><ul><li><p>Problem 1 &#8594; 29th May</p></li><li><p>Problem 2&#8594; 29th May</p></li><li><p>Problem 3 &#8594; 5th June</p></li><li><p>Problem 4&#8594; 5th June</p></li></ul><h4>&#129514; Mini-Projects (Deeper Dives)</h4><p><strong>Medium-difficulty projects</strong> to consolidate your skills:</p><ul><li><p>Mini-Project 1 &#8594; 19th June</p></li><li><p>Mini-Project 2 &#8594; 19th June</p></li></ul><h4>&#128163; Final Projects (End-to-End Challenges)</h4><p><strong>Advanced, real-life projects</strong> released in multiple parts:</p><ul><li><p>Project 1 &#8594; 26th June (with multiple issues in the following weeks)</p></li><li><p>Project 2 &#8594; 26th June (with multiple issues in the following weeks)</p></li></ul><p>We&#8217;ll share full project briefs and walkthroughs &#8212; so stay tuned!</p><div><hr></div><h2>&#128161; Where to Follow Along?</h2><p>We&#8217;ll continue posting weekly updates in our newsletters:</p><ul><li><p><strong><a href="https://www.databites.tech">DataBites</a></strong> (<em>by Josep</em>)</p></li><li><p><strong><a href="#">Non-Brand Data</a></strong> (<em>by Cornellius</em>)</p></li></ul><p>&#128073; Check out the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">GitHub repo</a></strong> and stay tuned for the first post!</p><div><hr></div><p>Let&#8217;s dive in and <strong>make SQL less scary, more fun, and way more useful!</strong> &#128640;</p><p><strong>Josep &amp; Cornellius</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">DataBites is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[#19 SQL Execution Order]]></title><description><![CDATA[SQL Crash Course #18]]></description><link>https://reads.databites.tech/p/19-sql-execution-order</link><guid isPermaLink="false">https://reads.databites.tech/p/19-sql-execution-order</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Thu, 15 May 2025 11:03:01 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nQRO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b59985c-3a44-4fde-b097-eab424ab26d1_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve for&#8230;</p>
      <p>
          <a href="https://reads.databites.tech/p/19-sql-execution-order">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[#18 Generating Modular Code]]></title><description><![CDATA[SQL Crash Course #18]]></description><link>https://reads.databites.tech/p/18-generating-modular-code</link><guid isPermaLink="false">https://reads.databites.tech/p/18-generating-modular-code</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Fri, 09 May 2025 11:02:23 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!QHOl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99261a6f-e2fa-4c74-be13-00baae534558_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve for&#8230;</p>
      <p>
          <a href="https://reads.databites.tech/p/18-generating-modular-code">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[#16 Database Modifications ]]></title><description><![CDATA[SQL Crash Course #16]]></description><link>https://reads.databites.tech/p/16-database-modifications</link><guid isPermaLink="false">https://reads.databites.tech/p/16-database-modifications</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Fri, 02 May 2025 10:02:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!2Y-t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75944a1c-58ad-4eba-8285-b85dda072d6a_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve for&#8230;</p>
      <p>
          <a href="https://reads.databites.tech/p/16-database-modifications">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[#14 Views]]></title><description><![CDATA[SQL Crash Course #14]]></description><link>https://reads.databites.tech/p/14-views</link><guid isPermaLink="false">https://reads.databites.tech/p/14-views</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Fri, 25 Apr 2025 10:01:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!CwbU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e3b659c-6e4f-410c-83ce-debea8e41d65_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve for&#8230;</p>
      <p>
          <a href="https://reads.databites.tech/p/14-views">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[#12 Common Table Expressions (CTEs)]]></title><description><![CDATA[SQL Crash Course #12]]></description><link>https://reads.databites.tech/p/12-common-table-expressions-ctes</link><guid isPermaLink="false">https://reads.databites.tech/p/12-common-table-expressions-ctes</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Thu, 17 Apr 2025 15:01:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!NJXy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve forgotten what we&#8217;ll cover, we will examine <strong><a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">seven key SQL topics,</a></strong> each divided into multiple posts across <strong><a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a></strong> and <strong><a href="https://open.substack.com/pub/rfeers">DataBites</a>.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NJXy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NJXy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!NJXy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!NJXy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!NJXy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NJXy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png" width="1380" height="962" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1380,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:104430,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/161527508?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NJXy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!NJXy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!NJXy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!NJXy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3b1eb9-7da8-4836-8107-34c9cde824d0_1380x962.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>&#128218; <strong>Previously in SQL Basics&#8230;</strong></p><p>Remember last Thursday we already saw:</p><p>&#128204; <strong>#9 &#8211; <a href="https://www.databites.tech/p/9-case-expressions">Case Expressions</a></strong> <br>&#128204; <strong>#10 &#8211; <a href="https://www.nb-data.com/p/10-functions-string-date-numeric">Functions (String, Date, Numeric)</a></strong> </p><p>Today, we will explore an exciting new topic in our SQL learning: </p><blockquote><p><strong>Advanced SQL&#129321;</strong></p></blockquote><p>In today&#8217;s topic, we have two new brand issues:</p><p>&#128204; <strong>#11 &#8211; Subqueries: </strong><span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Cornellius Yudha Wijaya&quot;,&quot;id&quot;:6000855,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8981f4c2-dc6b-42f7-a2bd-9751653af571_512x512.jpeg&quot;,&quot;uuid&quot;:&quot;74854861-b716-4324-b78f-1d54633fa8b8&quot;}" data-component-name="MentionToDOM"></span> in <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Non-Brand Data&quot;,&quot;id&quot;:37262,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/cornellius&quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/6c0e1cde-d120-4029-8ffd-2a8c7c6e4504_1280x1280.png&quot;,&quot;uuid&quot;:&quot;4c4c6c1c-cf47-4ac9-9119-4467f59b52a1&quot;}" data-component-name="MentionToDOM"></span> will walk you through the subquery concept. </p><p>&#128204; <strong>#12 - Common Table Expressions (CTEs)</strong>: The article you are reading right now, where you will grasp CTEs and what they are used for. </p><p>So don&#8217;t miss out&#8212;let&#8217;s keep the SQL momentum going!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><h3>&#129521; What are Common Table Expressions (CTEs)?</h3><p>CTEs are named <strong>temporary result sets</strong> you define at the beginning of your SQL query using the <code>WITH</code> clause.</p><p>You can reference them multiple times <em>within the same query</em>, making your SQL <strong>modular, clean, and easy to read</strong>.</p><p>Think of CTEs as <strong>building blocks</strong> that let you break down complex queries into logical, bite-sized steps.</p><p>CTEs often follow this structure:</p><pre><code>WITH 

cte_name AS (
  SELECT ...
  FROM ...
  WHERE ...
)
SELECT ...
FROM cte_name
WHERE ...;
</code></pre><p>You can even chain multiple CTEs together:</p><pre><code>WITH 
cte1 AS (
...
),

cte2 AS (
SELECT ...
FROM cte1
WHERE ...
)

SELECT ...
FROM cte2;</code></pre><p>&#9989; <strong>When to Use CTEs:</strong></p><p>&#128073;&#127995; When you want to modularize your logic for clarity<br>&#128073;&#127995; When you need to reuse intermediate steps in your query<br>&#128073;&#127995; When working with nested aggregations or multi-step filters<br>&#128073;&#127995; When debugging or collaborating with others</p><p>Let&#8217;s see CTEs in action!&#128071;&#127995;</p><h3>#1. Modular Metric Calculation</h3><p>&#129513; Real-world scenario:<br><strong>"Compute department-level revenue and rank them by performance."</strong></p><p>Without CTEs, everything is packed into one long query:</p><pre><code>SELECT 
  n.name, 
  SUM(i.points) AS total_points
FROM newsletters n
JOIN posts p ON n.id = p.newsletter_id
JOIN interactions i ON p.id = i.post_id
GROUP BY n.name
ORDER BY total_points DESC;</code></pre><p>With CTEs, we separate concerns:</p><pre><code>WITH newsletter_points AS (
  SELECT 
    n.id AS newsletter_id,
    SUM(i.points) AS total_points
  FROM newsletters n
  JOIN posts p ON n.id = p.newsletter_id
  JOIN interactions i ON p.id = i.post_id
  GROUP BY n.id
)
SELECT n.name, np.total_points
FROM newsletter_points np
JOIN newsletters n ON n.id = np.newsletter_id
ORDER BY np.total_points DESC;
</code></pre><p>&#129504; <strong>Why CTE</strong>: Improves readability, keeps each logical unit isolated, and allows reuse for dashboards or additional transformations.</p><div><hr></div><h3>#2. Reusable Intermediate Filters</h3><p>&#129513; Real-world scenario:<br><strong>"List top-performing employees only from high-revenue departments."</strong></p><p>With multiple subqueries, this can quickly get messy.<br>CTEs make it clear and structured:</p><pre><code>WITH high_engagement_newsletters AS (
  SELECT 
    n.id AS newsletter_id
  FROM newsletters n
  JOIN posts p ON n.id = p.newsletter_id
  JOIN interactions i ON p.id = i.post_id
  GROUP BY n.id
  HAVING SUM(i.points) &gt; 10
),
top_posts AS (
  SELECT 
    p.id, 
    p.name, 
    SUM(i.points) AS total_post_points
  FROM posts p
  JOIN interactions i ON p.id = i.post_id
  GROUP BY p.id, p.name
)
SELECT tp.name, tp.total_post_points
FROM top_posts tp
JOIN posts p ON tp.id = p.id
WHERE p.newsletter_id IN (
  SELECT newsletter_id FROM high_engagement_newsletters
);</code></pre><p>&#129504; <strong>Why CTE</strong>: Makes filtering logic modular and self-explanatory. Separates <em>what qualifies a newsletter</em> from <em>what makes a post significant</em>.</p><div><hr></div><h3>#3. Step-by-Step Aggregation</h3><p>&#129513; Real-world scenario:<br><strong>"Find the average performance per region after normalizing by team size."</strong></p><p>Instead of deeply nested subqueries, use layered CTEs:</p><pre><code>WITH post_points AS (
  SELECT 
    p.id AS post_id, 
    p.newsletter_id, 
    SUM(i.points) AS total_points
  FROM posts p
  JOIN interactions i ON p.id = i.post_id
  GROUP BY p.id, p.newsletter_id
),
normalized_post_points AS (
  SELECT 
    pp.post_id,
    pp.newsletter_id,
    pp.total_points / COUNT(i.id) AS normalized_score
  FROM post_points pp
  JOIN interactions i ON pp.post_id = i.post_id
  GROUP BY pp.post_id, pp.newsletter_id, pp.total_points
),
newsletter_avg_score AS (
  SELECT 
    n.id AS newsletter_id,
    AVG(npp.normalized_score) AS avg_normalized_score
  FROM newsletters n
  JOIN normalized_post_points npp ON n.id = npp.newsletter_id
  GROUP BY n.id
)
SELECT n.name, nas.avg_normalized_score
FROM newsletter_avg_score nas
JOIN newsletters n ON nas.newsletter_id = n.id;
</code></pre><p>&#129504; <strong>Why CTE</strong>: Breaks down multi-step logic into focused blocks</p><p>&#8212;<em>total points &#8594; normalized per post &#8594; average per newsletter</em>. </p><p>Super maintainable and easy to expand later.</p><div><hr></div><h3>&#127919; Summary: Why You Should Love CTEs</h3><p><strong>CTEs = Clean, Transparent, and Reusable SQL.</strong></p><p>&#128313; <strong>Modularity:</strong> Break logic into logical units<br>&#128313; <strong>Reusability:</strong> Reference CTEs across the same query<br>&#128313; <strong>Readability:</strong> Easier to understand than nested subqueries<br>&#128313; <strong>Maintainability:</strong> Simplifies debugging and collaboration</p><h3>&#128161; Pro Tip: CTE vs Subquery</h3><p>While subqueries are great for quick logic, prefer CTEs when:</p><p>&#9989; You have <strong>multiple steps</strong><br>&#9989; You want to <strong>reuse intermediate results</strong><br>&#9989; You need <strong>collaboration-ready SQL</strong><br>&#9989; You&#8217;re debugging a <strong>complex transformation</strong></p><p>&#128073;&#127995; <a href="https://www.db-fiddle.com/f/tvtNVuMuynXcBM3ADX5ymp/0">SQL playground with all CTEs expressions examples</a></p><h2>How to Get Started &#128640;</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wQ6f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" width="1456" height="743" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:543580,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158934446?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Over the coming weeks, we&#8217;ll guide you through:</p><p><strong>&#9989; SQL Fundamentals<br>&#9989; Intermediate SQL<br>&#9989; Advanced SQL<br>&#9989; Database Operations<br>&#9989; Writing Efficient Queries</strong></p><p>Once you grasp the basics, <strong>practice is key</strong>! Start working on real-world projects and solving <strong>hands-on data problems</strong>.</p><h1>What&#8217;s Next? &#10145;&#65039;</h1><p>This is the first of many posts about the upcoming SQL Courses. It will only explain what SQL is in its crude form.</p><p>To get the <em><strong>full experience and fully immersed in the learning</strong></em>:</p><p>&#128073; Subscribe to <strong><a href="https://www.databites.tech/">Databites.tech</a></strong> (By Josep)</p><p>&#128073; Subscribe to <strong><a href="https://www.nb-data.com/">Non-Brand Data</a></strong> (By Cornellius)</p><p>&#128073; Check out the <strong>SQL Crash Course</strong> <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">GitHub repo</a></strong></p><p>&#128073; <em><strong>Share with your friend and whoever needs it!</strong></em></p><div class="pullquote"><p><em>&#128467;&#65039; <strong>Every Thursday, you will have two new issues in your inbox!</strong></em></p></div><p>Let&#8217;s dive in and <strong>make SQL less scary, more fun, and way more useful!</strong> &#128640;</p><p><strong>Josep &amp; Cornellius</strong></p><div><hr></div><p>&#127881;<strong> </strong>DataBites just hit <strong>8,000 subs &amp; #76 in Rising Tech on Substack</strong> &#8212; thanks to you!<br>To celebrate, get <strong>20% off for life</strong> on the paid plan until April 13.<br>&#128073;&#127995; <a href="https://www.databites.tech/8kbiters">Grab it here</a> if you want full access to guides, cheatsheets, and more.</p><div><hr></div><p></p>]]></content:encoded></item><item><title><![CDATA[#9 Case Expressions]]></title><description><![CDATA[SQL Crash Course #9]]></description><link>https://reads.databites.tech/p/9-case-expressions</link><guid isPermaLink="false">https://reads.databites.tech/p/9-case-expressions</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Thu, 10 Apr 2025 11:01:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!bopz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve forgotten what we&#8217;ll cover, we will examine <strong><a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">seven key SQL topics,</a></strong> each divided into multiple posts across <strong><a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a></strong> and <strong><a href="https://open.substack.com/pub/rfeers">DataBites</a>.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bopz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bopz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!bopz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!bopz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!bopz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bopz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png" width="1380" height="962" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1380,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98259,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/160763973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bopz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!bopz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!bopz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!bopz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22655d84-45c0-4bd7-9035-9d4c542b41b8_1380x962.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>&#128218; <strong>Previously in SQL Basics&#8230;</strong></p><p>Remember last Thursday we already saw</p><p>&#128204; <strong>#7 &#8211; JOINS (INNER, LEFT, RIGHT, FULL)</strong> by me in <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;DataBites&quot;,&quot;id&quot;:2143185,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/rfeers&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e930fbab-b8df-40ef-9676-3d9ca5d49eae_714x714.png&quot;,&quot;uuid&quot;:&quot;73726f2b-ac77-406c-a541-158c638c32ae&quot;}" data-component-name="MentionToDOM"></span> <br>&#128204; <strong>#8 &#8211; UNION &amp; UNION ALL</strong> by <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Cornellius Yudha Wijaya&quot;,&quot;id&quot;:6000855,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8981f4c2-dc6b-42f7-a2bd-9751653af571_512x512.jpeg&quot;,&quot;uuid&quot;:&quot;d78593e2-50b3-4908-9c3f-fb5a83999d27&quot;}" data-component-name="MentionToDOM"></span> in <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Non-Brand Data&quot;,&quot;id&quot;:37262,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/cornellius&quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/6c0e1cde-d120-4029-8ffd-2a8c7c6e4504_1280x1280.png&quot;,&quot;uuid&quot;:&quot;40f01091-ad2f-4845-95a8-226da0918510&quot;}" data-component-name="MentionToDOM"></span>.</p><p>Today, two fresh issues just dropped:</p><p>&#128204; <strong>#9 &#8211; Case Expressions</strong> &#8211; the one you're reading right now is all about combining understanding CASE expressions in SQL. <br>&#128204; <strong>#10 &#8211; Functions (String, Date, Numeric)</strong> &#8211; where Cornellius explains how to work with SQL functions.</p><p>So don&#8217;t miss out&#8212;let&#8217;s keep the SQL momentum going!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><h3>&#127919; Why CASE expressions matter</h3><p>Sometimes you want your query to behave <em>differently</em> depending on values in your data &#8212; like showing &#8220;High&#8221;, &#8220;Medium&#8221;, or &#8220;Low&#8221; based on a score or defining a concrete category according to a numerical value. </p><p>Instead of running multiple queries or post-processing in Python or Excel&#8230;<br>you can do it <em>right in SQL</em> using a <code>CASE</code> expression.</p><div><hr></div><h3>&#129521; What is a CASE expression?</h3><p>Think of it as an <strong>IF / ELSE IF / ELSE</strong> block in SQL.</p><p>You check conditions one by one, and return a value when the first match is found.</p><p>It works inside <code>SELECT</code>, <code>WHERE</code>, <code>ORDER BY</code>, even <code>GROUP BY</code>.</p><p>The most common structure: </p><pre><code>SELECT 
  CASE 
    WHEN condition1 THEN result1
    WHEN condition2 THEN result2
    ELSE default_result
  END AS alias
FROM your_table;</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zhfL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zhfL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png 424w, https://substackcdn.com/image/fetch/$s_!zhfL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png 848w, https://substackcdn.com/image/fetch/$s_!zhfL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png 1272w, https://substackcdn.com/image/fetch/$s_!zhfL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zhfL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png" width="1456" height="823" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/caa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:823,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:749760,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/160763973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zhfL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png 424w, https://substackcdn.com/image/fetch/$s_!zhfL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png 848w, https://substackcdn.com/image/fetch/$s_!zhfL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png 1272w, https://substackcdn.com/image/fetch/$s_!zhfL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaa633b9-115a-4347-9a86-88b80c0251d0_3706x2094.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>CASE</strong>: Begins the conditional logic block.</p></li><li><p>WHEN <strong>condition</strong> THEN <strong>result</strong>: If condition is TRUE, return result.</p></li><li><p>Multiple <strong>WHEN</strong> clauses: You can include as many WHEN clauses as needed, each testing a different condition.</p></li><li><p><strong>ELSE</strong> default_result: Returned if no WHEN conditions are true.</p></li><li><p><strong>END</strong>: Closes the CASE block.</p></li><li><p><strong>AS</strong> alias: Names the resulting column.</p></li></ul><h3>&#128269; Example 1 &#8211; Categorizing Interaction Volume</h3><p>Let&#8217;s use our <code>POSTS</code> and <code>INTERACTIONS</code> tables.</p><p>We&#8217;ll count how many interactions each post received and categorize them:</p><pre><code>SELECT 
    P.name AS post_name,
    COUNT(I.id) AS num_interactions,
    CASE 
        WHEN COUNT(I.id) = 0 THEN '&#128997; No Interactions'
        WHEN COUNT(I.id) BETWEEN 1 AND 3 THEN '&#129000; Low'
        WHEN COUNT(I.id) BETWEEN 4 AND 6 THEN '&#128999; Medium'
        ELSE '&#129001; High'
    END AS interaction_level
FROM POSTS P
LEFT JOIN INTERACTIONS I
    ON P.id = I.post_id
GROUP BY P.name;</code></pre><p>&#129504; This is great for building dashboards or summaries that are easier to understand at a glance.</p><h3>&#128269; Example 2 &#8211; Conditional Filtering in WHERE</h3><p>Want to only show interactions that are <strong>likes</strong> or <strong>comments</strong>, and group all other types as &#8220;Other&#8221;? Use <code>CASE</code> in a <code>WHERE</code> clause:</p><pre><code>SELECT 
    I.id,
    I.type_of_interaction,
    CASE 
        WHEN I.type_of_interaction = 'like' THEN 'Like'
        WHEN I.type_of_interaction = 'comment' THEN 'Comment'
        ELSE 'Other'
    END AS interaction_category
FROM INTERACTIONS I;</code></pre><p>&#129504; This helps you simplify messy or inconsistent data directly in your query logic.</p><h3>&#128260; Bonus: CASE in ORDER BY</h3><p>You can also use <code>CASE</code> to <strong>custom sort</strong> results. For example, prioritize posts with no interactions:</p><pre><code>SELECT 
    P.name,
    COUNT(I.id) AS num_interactions
FROM POSTS P
LEFT JOIN INTERACTIONS I
    ON P.id = I.post_id
GROUP BY P.name
ORDER BY 
  CASE 
    WHEN COUNT(I.id) = 0 THEN 0
    ELSE 1
  END,
  P.name;</code></pre><p>&#129504; Super helpful when you want certain categories to float to the top &#8212; without changing your database.</p><div><hr></div><h3>&#9989; Summary: Use CASE When You Want To&#8230;</h3><ul><li><p><strong>Add custom labels</strong> or <strong>categorical buckets</strong> to your query output</p></li><li><p><strong>Transform values</strong> based on conditions</p></li><li><p><strong>Simulate IF/ELSE</strong> logic directly in SQL</p></li><li><p><strong>Clean or normalize data</strong> on the fly</p></li><li><p><strong>Control sorting, filtering, and grouping</strong> dynamically</p></li></ul><p>&#128073;&#127995; <a href="https://www.db-fiddle.com/f/sTGiHfN435PP2xCSWGd5q7/0">SQL playground with all CASE expressions examples</a></p><h2>How to Get Started &#128640;</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wQ6f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" width="1456" height="743" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:543580,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158934446?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Over the coming weeks, we&#8217;ll guide you through:</p><p><strong>&#9989; SQL Fundamentals<br>&#9989; Intermediate SQL<br>&#9989; Advanced SQL<br>&#9989; Database Operations<br>&#9989; Writing Efficient Queries</strong></p><p>Once you grasp the basics, <strong>practice is key</strong>! Start working on real-world projects and solving <strong>hands-on data problems</strong>.</p><h1>What&#8217;s Next? &#10145;&#65039;</h1><p>This is the first of many posts about the upcoming SQL Courses. It will only explain what SQL is in its crude form.</p><p>To get the <em><strong>full experience and fully immersed in the learning</strong></em>:</p><p>&#128073; Subscribe to <strong><a href="https://www.databites.tech/">Databites.tech</a></strong> (By Josep)</p><p>&#128073; Subscribe to <strong><a href="https://www.nb-data.com/">Non-Brand Data</a></strong> (By Cornellius)</p><p>&#128073; Check out the <strong>SQL Crash Course</strong> <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">GitHub repo</a></strong></p><p>&#128073; <em><strong>Share with your friend and whoever needs it!</strong></em></p><div class="pullquote"><p><em>&#128467;&#65039; <strong>Every Thursday, you will have two new issues in your inbox!</strong></em></p></div><p>Let&#8217;s dive in and <strong>make SQL less scary, more fun, and way more useful!</strong> &#128640;</p><p><strong>Josep &amp; Cornellius</strong></p><div><hr></div><p>&#127881;<strong> </strong>DataBites just hit <strong>8,000 subs &amp; #76 in Rising Tech on Substack</strong> &#8212; thanks to you!<br>To celebrate, get <strong>20% off for life</strong> on the paid plan until April 13.<br>&#128073;&#127995; <a href="https://www.databites.tech/8kbiters">Grab it here</a> if you want full access to guides, cheatsheets, and more.</p><div><hr></div><p></p>]]></content:encoded></item><item><title><![CDATA[#7 JOINs (Left, Right, Inner & Full)]]></title><description><![CDATA[SQL Crash Course #7]]></description><link>https://reads.databites.tech/p/7-joins-left-right-inner-and-full</link><guid isPermaLink="false">https://reads.databites.tech/p/7-joins-left-right-inner-and-full</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Thu, 03 Apr 2025 11:03:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!faTc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve forgotten what we&#8217;ll cover, we will examine <strong><a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">seven key SQL topics,</a></strong> each divided into multiple posts across <strong><a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a></strong> and <strong><a href="https://open.substack.com/pub/rfeers">DataBites</a>.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!faTc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!faTc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!faTc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!faTc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!faTc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!faTc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png" width="1380" height="962" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1380,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:87674,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/160446275?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!faTc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!faTc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!faTc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!faTc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F304b6fb4-988c-4ed0-aa6a-d98591f163e2_1380x962.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>&#128218; <strong>Previously in SQL Basics&#8230;</strong></p><p>Remember last Thursday we already saw</p><p>&#128204; <strong>#5 <a href="https://www.databites.tech/p/5-sorting-and-limiting">Filtering and Sorting</a></strong> by <strong>me in </strong><a href="https://open.substack.com/pub/rfeers">DataBites</a><br>&#128204; <strong>#6 <a href="https://www.nb-data.com/p/6-aggregate-functions">Aggregate Functions</a></strong> by <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> in <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a>.</p><p>Today, two fresh issues just dropped:</p><p>&#128204; <strong>#7 &#8211; JOINS (INNER, LEFT, RIGHT, FULL)</strong> &#8211; the one you're reading right now, all about combining tables to unlock richer insights<br>&#128204; <strong>#8 &#8211; UNION &amp; UNION ALL</strong> &#8211; where Cornellius explains how to stack query results efficiently</p><p>This marks the beginning of a four-part Intermediate SQL journey:</p><ol><li><p>JOINS (INNER, LEFT, RIGHT, FULL)</p></li><li><p>UNION &amp; UNION ALL</p></li><li><p>CASE Expressions</p></li><li><p>Functions (String, Date, Numeric)</p></li></ol><p>So don&#8217;t miss out&#8212;let&#8217;s keep the SQL momentum going!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><h2>&#128279; SQL JOINS &#8211; Unlocking Relationships Between Tables</h2><p>In relational databases, data often lives across multiple tables. <strong>JOINS</strong> are the bridge that connects these tables, allowing us to extract insights that would otherwise remain hidden.</p><p>But let&#8217;s be honest &#8212; JOINS can be confusing at first.</p><p>Which one should you use? What happens to unmatched rows?</p><p>No worries &#8212; we&#8217;ve got your back. We&#8217;ll break it down using:</p><ul><li><p>Two generic tables (<code>TableA</code>, <code>TableB</code>) for structure</p></li><li><p>Real examples using three concrete tables: <code>POSTS</code>, <code>INTERACTIONS</code>, and <code>NEWSLETTERS</code></p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LGlK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LGlK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png 424w, https://substackcdn.com/image/fetch/$s_!LGlK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png 848w, https://substackcdn.com/image/fetch/$s_!LGlK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png 1272w, https://substackcdn.com/image/fetch/$s_!LGlK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LGlK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png" width="1456" height="252" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:252,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:169380,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/160446275?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LGlK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png 424w, https://substackcdn.com/image/fetch/$s_!LGlK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png 848w, https://substackcdn.com/image/fetch/$s_!LGlK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png 1272w, https://substackcdn.com/image/fetch/$s_!LGlK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53ca1fdd-b9cd-4eb3-8009-72d9a7fb0a68_2702x468.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>There are seven main types of JOIN we can perform using SQL. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8trN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8trN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png 424w, https://substackcdn.com/image/fetch/$s_!8trN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png 848w, https://substackcdn.com/image/fetch/$s_!8trN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png 1272w, https://substackcdn.com/image/fetch/$s_!8trN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8trN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png" width="1456" height="1579" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1579,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:794407,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/160446275?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8trN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png 424w, https://substackcdn.com/image/fetch/$s_!8trN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png 848w, https://substackcdn.com/image/fetch/$s_!8trN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png 1272w, https://substackcdn.com/image/fetch/$s_!8trN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfbaa92-06db-4d7a-a762-e4ad76849ff2_2821x3060.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><p>Now let&#8217;s break them down &#128071;&#127995;</p><h3>&#9989; LEFT JOIN</h3><p>&#128313; <strong>What it does:</strong><br>Returns <strong>all records from TableA (left table)</strong> and the <strong>matching records from TableB (right table)</strong>. If no match exists, you still get the row from A with <code>NULL</code> values from B.</p><p>&#128313; <strong>Use case:</strong><br>List all posts &#8212; even those that received no interaction.</p><p><strong>Structure:</strong></p><pre><code><code>SELECT *  
FROM A  
LEFT JOIN B  
ON A.KEY = B.KEY  </code></code></pre><p><strong>Real Example:</strong></p><pre><code><code>SELECT 
    P.name AS post_name, 
    I.type_of_interaction 
FROM POSTS P 
LEFT JOIN INTERACTIONS I 
  ON P.id = I.post_id;</code></code></pre><p>&#129504; <em>Posts with no interactions will still appear &#8212; with NULLs for the interaction fields.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h3>&#9989; RIGHT JOIN</h3><p>&#128313; <strong>What it does:</strong><br>Returns <strong>all records from TableB</strong>, and any matching rows from TableA. If there&#8217;s no match, A&#8217;s fields will be <code>NULL</code>.</p><p>&#128313; <strong>Use case:</strong><br>Show all interactions, even if the referenced post is missing.</p><p><strong>Structure:</strong></p><pre><code><code>SELECT *  
FROM A  
RIGHT JOIN B  
   ON A.KEY = B.KEY  </code></code></pre><p><strong>Example with our newsletter&#8217;s data: </strong></p><pre><code><code>SELECT 
    I.id AS interaction_id,
    P.name AS post_name,
    I.type_of_interaction
FROM POSTS P
RIGHT JOIN INTERACTIONS I
    ON P.id = I.post_id;</code></code></pre><p>&#129504; <em>Helpful for identifying orphaned interactions &#8212; though in this dataset, all are valid.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h3>&#9989; LEFT JOIN (Without Overlapping)</h3><p>&#128313; <strong>What it does:</strong><br>Returns rows from A <strong>that don&#8217;t have a match in B</strong>.</p><p>&#128313; <strong>Use case:</strong><br>Find posts that have received <strong>no interactions</strong>.</p><p><strong>Structure:</strong></p><pre><code><code>SELECT *  
FROM A  
LEFT JOIN B  
  ON A.KEY = B.KEY  
WHERE B.KEY IS NULL  </code></code></pre><p><strong>Example with our newsletter&#8217;s data: </strong></p><pre><code><code>SELECT 
    P.name
FROM POSTS P
LEFT JOIN INTERACTIONS I
    ON P.id = I.post_id
WHERE I.id IS NULL;</code></code></pre><p>&#129504; <em>Great to identify content that might need promotion or a second look.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h3>&#9989; RIGHT JOIN (Without Overlapping)</h3><p>&#128313; <strong>What it does:</strong><br>Returns rows from B <strong>that don&#8217;t match anything in A</strong>.</p><p>&#128313; <strong>Use case:</strong><br>Spot inconsistent data &#8212; e.g., interactions without matching posts.</p><p><strong>Structure:</strong></p><pre><code><code>SELECT *  
FROM A  
RIGHT JOIN B  
  ON A.KEY = B.KEY  
WHERE A.KEY IS NULL  </code></code></pre><p><strong>Example with our newsletter&#8217;s data: </strong></p><pre><code><code>SELECT 
    I.id,
    I.post_id
FROM POSTS P
RIGHT JOIN INTERACTIONS I
    ON P.id = I.post_id
WHERE P.id IS NULL;</code></code></pre><p>&#129504; <em>Useful for quality assurance &#8212; even if the current data has no such issues.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h3>&#9989; FULL OUTER JOIN (Simulated via UNION)</h3><p>&#128313; <strong>What it does:</strong><br>Returns <strong>all records from both tables</strong>, matching where possible. Rows with no match in either table will have <code>NULL</code>s on one side.</p><p>&#128313; <strong>Use case:</strong><br>Get a <strong>complete overview</strong> of all posts and interactions.</p><p><strong>Structure:</strong></p><pre><code><code>SELECT *  
FROM A  
FULL OUTER JOIN B  
  ON A.KEY = B.KEY  </code></code></pre><p><strong>Query Example: </strong>Combines all rows from both tables &#8212; matching where possible, keeping everything else.</p><pre><code><code>SELECT 
    P.name AS post_name,
    I.type_of_interaction
FROM POSTS P
OUTER JOIN INTERACTIONS I
    ON P.id = I.post_id
</code></code></pre><p>&#129504; <em>You&#8217;ll get everything &#8212; connected or not.</em></p><p>&#128313; <strong>Important for MySQL users:</strong><br>&#10071; MySQL does <strong>not</strong> support <code>FULL OUTER JOIN</code> directly. To achieve this behavior, you'll need to <strong>combine a LEFT JOIN and a RIGHT JOIN using </strong><code>UNION</code>.</p><pre><code>-- Simulated FULL OUTER JOIN in MySQL using UNION
SELECT 
    P.name AS post_name,
    I.type_of_interaction
FROM posts P
LEFT JOIN interactions I
    ON P.id = I.post_id

UNION

SELECT 
    P.name AS post_name,
    I.type_of_interaction
FROM posts P
RIGHT JOIN interactions I
    ON P.id = I.post_id;
</code></pre><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h3>&#9989; FULL JOIN (Without Overlapping)</h3><p>&#128313; <strong>What it does:</strong><br>Shows <strong>only the non-matching records</strong> from both tables &#8212; highlighting differences.</p><p>&#128313; <strong>Use case:</strong><br>Identify <strong>discrepancies</strong> between two datasets.</p><p><strong>Structure:</strong></p><pre><code><code>SELECT *  
FROM A  
FULL OUTER JOIN B  
  ON A.KEY = B.KEY  
WHERE A.KEY IS NULL OR B.KEY IS NULL  </code></code></pre><p>Query Example:</p><pre><code><code>SELECT
    A.A_KEY,
    A.A_NAME,
    B.B_KEY,
    B.DEPARTMENT
FROM TableA A
FULL OUTER JOIN TableB B
    ON A.A_KEY = B.B_KEY
WHERE A.A_KEY IS NULL
   OR B.B_KEY IS NULL;
</code></code></pre><p>&#129504; <em>This query isolates what&#8217;s not connected &#8212; a powerful tool for data validation.</em></p><p>&#10071; <code>FULL OUTER JOIN</code> is <strong>not available in MySQL</strong>, so you'll need to simulate this logic using a <code>UNION</code> between a <code>LEFT JOIN ... WHERE IS NULL</code> and a <code>RIGHT JOIN ... WHERE IS NULL</code>.</p><pre><code>-- Simulated FULL OUTER JOIN (no match only) in MySQL using UNION
SELECT 
    P.name AS post_name,
    I.type_of_interaction
FROM posts P
LEFT JOIN interactions I
    ON P.id = I.post_id
WHERE I.post_id IS NULL

UNION

SELECT 
    P.name AS post_name,
    I.type_of_interaction
FROM posts P
RIGHT JOIN interactions I
    ON P.id = I.post_id
WHERE P.id IS NULL;</code></pre><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h3>&#9989; INNER JOIN</h3><p>&#128313; <strong>What it does:</strong><br>Returns <strong>only matching rows</strong> from both tables.</p><p>&#128313; <strong>Use case:</strong><br>See which posts have at least one interaction.</p><p><strong>Structure:</strong></p><pre><code><code>SELECT *  
FROM A  
INNER JOIN B  
  ON A.KEY = B.KEY  </code></code></pre><p>Real Example:</p><pre><code>SELECT 
    P.name AS post_name, 
    I.type_of_interaction 
FROM POSTS P 
INNER JOIN INTERACTIONS I 
   ON P.id = I.post_id;</code></pre><p>&#129504; <em>Great when you&#8217;re only interested in records that exist in both tables.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h3>&#128161; BONUS: Joining 3 Tables</h3><p>&#128313; <strong>What it does:</strong><br>Connects <code>NEWSLETTERS</code>, <code>POSTS</code>, and <code>INTERACTIONS</code> for full context.</p><p>&#128313; <strong>Use case:</strong><br>List the newsletter name, post title, and interaction type &#8212; all in one view.</p><pre><code>SELECT 
    N.name AS newsletter_name,
    P.name AS post_title,
    I.type_of_interaction
FROM NEWSLETTERS N
JOIN POSTS P
    ON N.id = P.newsletter_id
JOIN INTERACTIONS I
    ON P.id = I.post_id;</code></pre><p>&#129504; <em>This is how you create powerful multi-table reports and dashboards.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>&#129504; Summary Table &#8211; How to Read JOIN Results</h2><ul><li><p><strong>LEFT JOIN</strong> &#8594; All from left table + matches from right</p></li><li><p><strong>RIGHT JOIN</strong> &#8594; All from right table + matches from left</p></li><li><p><strong>LEFT JOIN (no match)</strong> &#8594; Rows from left with no match in right</p></li><li><p><strong>RIGHT JOIN (no match)</strong> &#8594; Rows from right with no match in left</p></li><li><p><strong>FULL OUTER JOIN (via UNION)</strong> &#8594; All records from both tables, matched or not</p></li><li><p><strong>FULL JOIN (no match)</strong> &#8594; Only non-matching records from both tables</p></li><li><p><strong>INNER JOIN</strong> &#8594; Only matching records from both tables</p></li></ul><p>And now? <strong>It is your turn to play in our SQL playground with these two clauses.</strong></p><p>&#128073;&#127995; <a href="https://www.db-fiddle.com/f/8rkgKHYSFEmmhjdR9P4iii/3">SQL playground with all the different types of JOINs</a></p><h2>How to Get Started &#128640;</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wQ6f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" width="1456" height="743" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:543580,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158934446?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Over the coming weeks, we&#8217;ll guide you through:</p><p><strong>&#9989; SQL Fundamentals<br>&#9989; Intermediate SQL<br>&#9989; Advanced SQL<br>&#9989; Database Operations<br>&#9989; Writing Efficient Queries</strong></p><p>Once you grasp the basics, <strong>practice is key</strong>! Start working on real-world projects and solving <strong>hands-on data problems</strong>.</p><h1>What&#8217;s Next? &#10145;&#65039;</h1><p>This is the first of many posts about the upcoming SQL Courses. It will only explain what SQL is in its crude form.</p><p>To get the <em><strong>full experience and fully immersed in the learning</strong></em>:</p><p>&#128073; Subscribe to <strong><a href="https://www.databites.tech/">Databites.tech</a></strong> (By Josep)</p><p>&#128073; Subscribe to <strong><a href="https://www.nb-data.com/">Non-Brand Data</a></strong> (By Cornellius)</p><p>&#128073; Check out the <strong>SQL Crash Course</strong> <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">GitHub repo</a></strong></p><p>&#128073; <em><strong>Share with your friend and whoever needs it!</strong></em></p><div class="pullquote"><p><em>&#128467;&#65039; <strong>Every Thursday, you will have two new issues in your inbox!</strong></em></p></div><p>Let&#8217;s dive in and <strong>make SQL less scary, more fun, and way more useful!</strong> &#128640;</p><p><strong>Josep &amp; Cornellius</strong></p><p></p>]]></content:encoded></item><item><title><![CDATA[#5 Sorting & Limiting]]></title><description><![CDATA[SQL Crash Course #5]]></description><link>https://reads.databites.tech/p/5-sorting-and-limiting</link><guid isPermaLink="false">https://reads.databites.tech/p/5-sorting-and-limiting</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Thu, 27 Mar 2025 12:03:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!iY02!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve forgotten what we&#8217;ll cover, we will examine <strong><a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">seven key SQL topics,</a></strong> each divided into multiple posts across <strong><a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a></strong> and <strong><a href="https://open.substack.com/pub/rfeers">DataBites</a>.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iY02!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iY02!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!iY02!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!iY02!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!iY02!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iY02!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png" width="1380" height="962" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1380,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77619,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/159969490?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iY02!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!iY02!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!iY02!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!iY02!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf5ce2f7-7424-4289-9354-5e135d9a0a00_1380x962.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>&#128218; <strong>Previously in SQL Basics&#8230;</strong></p><p>Remember last Thursday we already saw</p><p><strong>&#128204; #3 <a href="https://www.databites.tech/p/3-relational-data-and-models">Relational Data &amp; Models</a> </strong>by <strong>me in </strong><a href="https://open.substack.com/pub/rfeers">DataBites</a></p><p><strong>&#128204; #4 <a href="https://www.nb-data.com/p/4-sql-basic-commands">Basic Commands</a> </strong>by <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> in <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a>.</p><p>Today, two fresh issues just dropped:</p><p>&#128204; <strong>#5 Filtering and Sorting</strong> (the one you're reading now) &#8211; where we focus on two essential commands: <code>ORDER BY</code> and <code>LIMIT</code><br>&#128204; <strong>#6 Aggregate Functions</strong> &#8211; in which Cornellius walks you through the most commonly used aggregates like <code>SUM</code>, <code>AVG</code>, and <code>COUNT</code></p><p>With these, we wrap up <strong>Section 2: SQL Basics</strong> &#127881;<br>Next week, we jump into <strong>Intermediate SQL</strong> with four exciting topics:</p><ul><li><p><strong>JOINS</strong> (INNER, LEFT, RIGHT, FULL)</p></li><li><p><strong>UNION &amp; UNION ALL</strong></p></li><li><p><strong>CASE Expressions</strong></p></li><li><p><strong>Functions</strong> (String, Date, Numeric)</p></li></ul><p>So don&#8217;t miss out&#8212;let&#8217;s keep the SQL momentum going!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><h3>SQL Filtering &amp; Sorting &#129529;&#128202;</h3><p>Previously, we explored the <strong>SELECT</strong>, <strong>FROM</strong>, and <strong>WHERE</strong> commands &#8212; the building blocks of SQL.<br>Now, it&#8217;s time to take things up a notch.</p><p>Once you&#8217;ve filtered your data using <strong>WHERE</strong>, what if you want to sort the results? Or limit how many rows are returned?</p><blockquote><p>That&#8217;s where <strong>ORDER BY</strong> and <strong>LIMIT</strong> come in.</p></blockquote><p>These commands let you organize and control your query results. You&#8217;ll learn how to:</p><p>&#128204; <strong>ORDER BY</strong> to sort your data (ascending/descending).<br>&#128204; <strong>LIMIT</strong> to return only a specific number of rows.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RvTG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RvTG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png 424w, https://substackcdn.com/image/fetch/$s_!RvTG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png 848w, https://substackcdn.com/image/fetch/$s_!RvTG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png 1272w, https://substackcdn.com/image/fetch/$s_!RvTG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RvTG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png" width="1456" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:95520,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/159969490?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RvTG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png 424w, https://substackcdn.com/image/fetch/$s_!RvTG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png 848w, https://substackcdn.com/image/fetch/$s_!RvTG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png 1272w, https://substackcdn.com/image/fetch/$s_!RvTG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1a675b0-a952-458a-8ae4-97504d91e055_1857x612.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Combine them for cleaner, faster results.</p><p>Let&#8217;s dive in.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>&#9989; <strong>ORDER BY Command</strong></h2><p>The <strong>ORDER BY</strong> clause answers the question: <strong>&#8220;How should I sort the results?&#8221;</strong></p><h3>What It Does</h3><p>Sorts the result set by one or more columns.<br>Defaults to <strong>ascending order (ASC)</strong>, but you can use <strong>descending (DESC)</strong> too.</p><pre><code>SELECT column1, column2  
FROM table_name  
ORDER BY column1 [ASC|DESC];</code></pre><p>Let&#8217;s see <strong>various examples</strong> for the SELECT command:</p><p>&#128073; <strong>Sort Products by Price (Low to High)</strong></p><pre><code>SELECT product_name, price  
FROM products  
ORDER BY price ASC;</code></pre><p>&#128073; <strong>Sort Products by Price (High to Low)</strong></p><pre><code>SELECT product_name, price  
FROM products  
ORDER BY price DESC;</code></pre><p>&#128073; <strong>Sort by Multiple Columns</strong></p><pre><code>SELECT product_name, category, price  
FROM products  
ORDER BY category ASC, price DESC;</code></pre><p>The Syntax for ORDER BY is always in the later part of our queries, as this command <strong>signifies that we want to order our final output</strong> in a specific way.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>&#9989; <strong>LIMIT Command</strong></h2><p>The <strong>LIMIT</strong> clause answers: <strong>&#8220;How many results do I want to see?&#8221;</strong></p><h3>What It Does</h3><p>Restricts the number of rows returned by your query.<br>Very useful when previewing data or working with large datasets. Its main advantages are two: </p><ul><li><p>To control the number of data processed when running a quick query. </p></li><li><p>To set a maximum number of output records that the system can return. </p></li></ul><p>The Syntax is present as follows:</p><pre><code>SELECT column1  
FROM table_name  
LIMIT number;</code></pre><p>Let&#8217;s see <strong>various examples</strong> for the SELECT command:</p><p>&#128073; <strong>Get the First 10 Products</strong></p><pre><code>SELECT product_name  
FROM products  
LIMIT 10;</code></pre><p>&#128073; <strong>Top 5 Most Expensive Products</strong></p><pre><code>SELECT product_name, price  
FROM products  
ORDER BY price DESC  
LIMIT 5;</code></pre><p>&#128073; <strong>Combine WHERE, ORDER BY, and LIMIT</strong></p><pre><code>SELECT product_name, price  
FROM products  
WHERE category = 'Electronics'  
ORDER BY price DESC  
LIMIT 3;</code></pre><p>The LIMIT clause always goes in the end as it limits the number of records that the output can return. </p><p>And now? <strong>It is your turn to play in our SQL playground with these two clauses. </strong></p><p>&#128073;&#127995; <a href="https://www.db-fiddle.com/f/gsJfafADqkwjrHBLernRZP/0">SQL playground with ORDER BY and LIMIT</a></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>And there you have it &#8212; your toolkit to <strong>filter</strong>, <strong>sort</strong>, and <strong>focus</strong> your queries.<br>These two commands might look simple, but they make your SQL results way more useful.</p><p>Stay tuned as we move deeper into SQL! &#128105;&#8205;&#128187;&#128104;&#8205;&#128187;</p><h2>How to Get Started &#128640;</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wQ6f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" width="1456" height="743" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:543580,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158934446?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Over the coming weeks, we&#8217;ll guide you through:</p><p><strong>&#9989; SQL Fundamentals<br>&#9989; Intermediate SQL<br>&#9989; Advanced SQL<br>&#9989; Database Operations<br>&#9989; Writing Efficient Queries</strong></p><p>Once you grasp the basics, <strong>practice is key</strong>! Start working on real-world projects and solving <strong>hands-on data problems</strong>.</p><h1>What&#8217;s Next? &#10145;&#65039;</h1><p>This is the first of many posts about the upcoming SQL Courses. It will only explain what SQL is in its crude form.</p><p>To get the <em><strong>full experience and fully immersed in the learning</strong></em>:</p><p>&#128073; Subscribe to <strong><a href="https://www.databites.tech/">Databites.tech</a></strong> (By Josep)</p><p>&#128073; Subscribe to <strong><a href="https://www.nb-data.com/">Non-Brand Data</a></strong> (By Cornellius)</p><p>&#128073; Check out the <strong>SQL Crash Course</strong> <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">GitHub repo</a></strong></p><p>&#128073; <em><strong>Share with your friend and whoever needs it!</strong></em></p><div class="pullquote"><p><em>&#128467;&#65039; <strong>Every Thursday, you will have two new issues in your inbox!</strong></em></p></div><p>Let&#8217;s dive in and <strong>make SQL less scary, more fun, and way more useful!</strong> &#128640;</p><p><strong>Josep &amp; Cornellius</strong></p><p></p>]]></content:encoded></item><item><title><![CDATA[#3 Relational Data & Models]]></title><description><![CDATA[SQL Crash Course #3]]></description><link>https://reads.databites.tech/p/3-relational-data-and-models</link><guid isPermaLink="false">https://reads.databites.tech/p/3-relational-data-and-models</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Thu, 20 Mar 2025 12:03:39 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!oVzb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="pullquote"><p><em>All the course material is stored in the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">SQL Crash Course repository</a></strong>.</em></p></div><p>Hi everyone! <strong>Josep</strong> and <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> from <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> here &#128075;&#127995;</p><p>As promised, today we are publishing the next two issues of our <a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">SQL Crash Course &#8211; From Zero to Hero!</a> &#128640;</p><p>I am sure you are here to continue our <strong>SQL Crash Course Journey!&#128218;</strong></p><p>If this is your first time or you&#8217;ve forgotten what we&#8217;ll cover, we will examine <strong><a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">seven key SQL topics,</a></strong> each divided into multiple posts across <strong><a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a></strong> and <strong><a href="https://open.substack.com/pub/rfeers">DataBites</a>.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oVzb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oVzb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!oVzb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!oVzb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!oVzb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oVzb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png" width="1380" height="962" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1380,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:99134,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/159463871?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oVzb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!oVzb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!oVzb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!oVzb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21156943-6e45-44cb-9da9-e15ff53edce2_1380x962.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Remember last Thursday we already saw</p><p><strong>&#128204; #1 <a href="https://www.nb-data.com/p/2-what-is-sql">What is SQL?</a></strong></p><p><strong>&#128204; #2 <a href="https://www.databites.tech/p/2-why-learn-sql">Why learn SQL?</a></strong></p><p>Today&#8217;s turn is for:</p><p><strong>&#128204; #3 Relational Data &amp; Models </strong>by <strong>me in </strong><a href="https://open.substack.com/pub/rfeers">DataBites</a></p><p><strong>&#128204; #4 <a href="https://www.nb-data.com/p/4-sql-basic-commands">Basic Commands</a> </strong>by <a href="https://open.substack.com/users/6000855-cornellius-yudha-wijaya?utm_source=mentions">Cornellius Yudha Wijaya</a> in <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a></p><p>So, let&#8217;s dive in!</p><h2>SQL &amp; NoSQL Databases</h2><p>Databases are the backbone of data science and application development, determining how data is stored, retrieved, and processed.</p><p>There are two main types of databases:</p><ul><li><p>SQL (Structured Query Language) &#8594; Relational</p></li><li><p>NoSQL (Not Only SQL) &#8594; Non-Relational</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SgN3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SgN3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png 424w, https://substackcdn.com/image/fetch/$s_!SgN3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png 848w, https://substackcdn.com/image/fetch/$s_!SgN3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png 1272w, https://substackcdn.com/image/fetch/$s_!SgN3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SgN3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png" width="1456" height="448" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:448,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:222445,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/159463871?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SgN3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png 424w, https://substackcdn.com/image/fetch/$s_!SgN3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png 848w, https://substackcdn.com/image/fetch/$s_!SgN3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png 1272w, https://substackcdn.com/image/fetch/$s_!SgN3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b341b4-b19d-4dee-bc7c-65f42572bdcd_4253x1310.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>They both serve different purposes depending on the nature of the data and the application requirements. This lesson  delves into SQL databases, their characteristics, advantages, and real-world applications.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><h2><strong>What is Relational Model?</strong></h2><p>Now you might be wondering.<em>.. <strong>what is really a Relational Model?</strong></em></p><p>So let's try to understand this concept easily. </p><p>The relational model organizes data into <strong>tables</strong> where each record is stored as a <strong>row</strong> and attributes are represented as <strong>columns</strong>. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7TVv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7TVv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png 424w, https://substackcdn.com/image/fetch/$s_!7TVv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png 848w, https://substackcdn.com/image/fetch/$s_!7TVv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png 1272w, https://substackcdn.com/image/fetch/$s_!7TVv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7TVv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png" width="1360" height="788" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:788,&quot;width&quot;:1360,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:71420,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/159463871?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7TVv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png 424w, https://substackcdn.com/image/fetch/$s_!7TVv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png 848w, https://substackcdn.com/image/fetch/$s_!7TVv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png 1272w, https://substackcdn.com/image/fetch/$s_!7TVv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd101a85e-cb4e-44bd-9500-c8fa69beb720_1360x788.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Relationships between tables are established using <strong>keys</strong>, such as: </p><ul><li><p><strong>Primary keys</strong> (unique identifiers for each record)</p></li><li><p><strong>Foreign keys</strong> (linking records across tables). </p></li></ul><p>This structure ensures data consistency and allows for complex queries by connecting related information efficiently.</p><p>So let's go step by step...</p><p>Imagine we run a couple of Newsletters (*wink wink*). We will have a <strong>Newsletter</strong> table that will register all our newsletters and then a second <strong>Posts </strong>table that will collect all published posts. </p><p>So now we have two main tables: <strong>NEWSLETTERS</strong> and <strong>POSTS</strong>. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_vNa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_vNa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png 424w, https://substackcdn.com/image/fetch/$s_!_vNa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png 848w, https://substackcdn.com/image/fetch/$s_!_vNa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png 1272w, https://substackcdn.com/image/fetch/$s_!_vNa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_vNa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png" width="1456" height="334" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:334,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:579747,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/159463871?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_vNa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png 424w, https://substackcdn.com/image/fetch/$s_!_vNa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png 848w, https://substackcdn.com/image/fetch/$s_!_vNa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png 1272w, https://substackcdn.com/image/fetch/$s_!_vNa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8255c8fb-794b-4527-be7f-f01cf161df4c_4890x1122.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>In this case the records of both tables are easily relatable using: </p><ul><li><p>The <strong>id</strong> column in the <strong>NEWSLETTERS</strong> table, which uniquely identifies each newsletter. This serves as the <strong>Primary Key</strong>.</p></li><li><p>The <strong>newsletter_id</strong> column in the <strong>POSTS</strong> table, which associates each post with its corresponding newsletter. This acts as the <strong>Foreign Key</strong>.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GItY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GItY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png 424w, https://substackcdn.com/image/fetch/$s_!GItY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png 848w, https://substackcdn.com/image/fetch/$s_!GItY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png 1272w, https://substackcdn.com/image/fetch/$s_!GItY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GItY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png" width="1456" height="385" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:385,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:584171,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/159463871?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GItY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png 424w, https://substackcdn.com/image/fetch/$s_!GItY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png 848w, https://substackcdn.com/image/fetch/$s_!GItY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png 1272w, https://substackcdn.com/image/fetch/$s_!GItY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71dde770-d50f-4cb5-85b0-10ee335cdc1b_4890x1293.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>1.1 Characteristics of SQL Databases</strong></h3><p>In SQL databases, the relational model serves as the conceptual foundation, organizing data into structured and interconnected tables. SQL databases are made up of schemas and tables:</p><ul><li><p><strong>Schema:</strong> defines the structure of the database, including tables, their fields, data types, available values, and relationships.</p></li><li><p><strong>Tables:</strong> The foundational units of a database, representing entities with rows containing individual records for each entity and columns storing specific attributes about the entity.</p></li><li><p><strong>Keys and Relationships</strong></p><ul><li><p><strong>Primary Key</strong>: A unique identifier for each record in a table (<code>id</code> in the Product Table).</p></li><li><p><strong>Foreign Key</strong>: A column that establishes a relationship between two tables ( product<code>_id</code> in a Sales table referencing Products).</p></li><li><p>Supports <strong>one-to-many</strong> and <strong>many-to-many</strong> relationships between tables.</p></li></ul></li><li><p><strong>Normalization</strong></p><ul><li><p>The process of <strong>organizing data to reduce redundancy</strong> and improve consistency.</p></li></ul></li></ul><p>SQL, or Structured Query Language, serves as the interface for managing these databases, enabling the creation, retrieval, updating, and deletion of data through standardized commands. A list of these commands and SQL&#8217;s capabilities can be seen in my <a href="https://www.databites.tech/p/a-special-sql-gift-for-you-to-kickstart">SQL Basics Cheat Sheet</a>.</p><h3><strong>1.2 Advantages of SQL</strong></h3><p>SQL provides a standard set of commands for defining, querying, updating, and administering data in a relational database management system (RDBMS). Key SQL operations include:</p><ul><li><p><strong>SELECT</strong> (querying data)</p></li><li><p><strong>INSERT</strong> (adding new records)</p></li><li><p><strong>UPDATE</strong> (modifying existing records)</p></li><li><p><strong>DELETE</strong> (removing records)</p></li></ul><p>When using these commands, SQL ensures that ACID (Atomicity, Consistency, Isolation, and Durability) properties are maintained. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1xxM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1xxM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png 424w, https://substackcdn.com/image/fetch/$s_!1xxM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png 848w, https://substackcdn.com/image/fetch/$s_!1xxM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png 1272w, https://substackcdn.com/image/fetch/$s_!1xxM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1xxM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png" width="1456" height="1106" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1106,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:461882,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/159463871?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1xxM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png 424w, https://substackcdn.com/image/fetch/$s_!1xxM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png 848w, https://substackcdn.com/image/fetch/$s_!1xxM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png 1272w, https://substackcdn.com/image/fetch/$s_!1xxM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81100b96-d78d-4098-9c7d-1d1108b17e38_2335x1774.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This ensures the reliability and consistency of database changes.</p><ul><li><p><strong>Atomicity</strong>: Ensures that each transaction is treated as a single, indivisible unit of work. If any part of the transaction fails, none of its changes are applied to the database. Either the entire transaction is committed, or none of it takes effect.</p></li><li><p><strong>Consistency</strong>: Guarantees that a transaction transitions the database from one valid state to another, preserving predefined integrity constraints. The database remains consistent both before and after the transaction.</p></li><li><p><strong>Isolation</strong>: Ensures that concurrent transactions do not interfere with each other, preventing inconsistencies. Each transaction executes as if it were the only one running, maintaining data integrity even in a multi-user environment.</p></li><li><p><strong>Durability</strong>: Ensures that once a transaction is committed, its changes are permanently recorded in the database. The effects persist even in the event of system failures, such as crashes or power outages.</p></li></ul><p>These fundamental properties of SQL databases ensure that database systems are reliable and consistent, even in the case of unexpected events or system failures.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://reads.databites.tech/subscribe?"><span>Subscribe now</span></a></p><h3><strong>1.3 Common SQL Databases</strong></h3><p><strong>There are three commonly used RDBMS:</strong></p><ul><li><p><strong><a href="https://www.mysql.com/">MySQL</a></strong>: An open-source RDBMS, now maintained by Oracle, known for its speed, reliability, and ease of use. It is widely used in <strong>LAMP stacks</strong> (Linux, Apache, MySQL, PHP/Python/Perl) and is a popular choice for small to medium-sized web applications. <a href="https://www.mysql.com/"> </a></p></li><li><p><strong><a href="https://www.postgresql.org/">PostgreSQL</a></strong>: A powerful open-source <strong>object-relational database system</strong> with advanced capabilities, including support for custom functions, complex queries, indexing, and ACID-compliant transactions. It is well-suited for <strong>large-scale applications, data warehousing, and geospatial data processing</strong>.</p></li><li><p><strong><a href="https://www.microsoft.com/en-us/sql-server">Microsoft SQL Server</a></strong><a href="https://www.microsoft.com/en-us/sql-server">:</a> A <strong>proprietary RDBMS</strong> developed by Microsoft, available in multiple editions (Express, Standard, Enterprise) to cater to different use cases. It seamlessly integrates with the <strong>Microsoft ecosystem</strong>, making it a strong choice for businesses of all sizes, from small enterprises to large corporations.</p></li></ul><h2>How to Get Started &#128640;</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wQ6f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" width="1456" height="743" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:543580,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158934446?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Over the coming weeks, we&#8217;ll guide you through:</p><p><strong>&#9989; SQL Fundamentals<br>&#9989; Intermediate SQL<br>&#9989; Advanced SQL<br>&#9989; Database Operations<br>&#9989; Writing Efficient Queries</strong></p><p>Once you grasp the basics, <strong>practice is key</strong>! Start working on real-world projects and solving <strong>hands-on data problems</strong>.</p><h1>What&#8217;s Next? &#10145;&#65039;</h1><p>This is the first of many posts about the upcoming SQL Courses. It will only explain what SQL is in its crude form.</p><p>To get the <em><strong>full experience and fully immersed in the learning</strong></em>:</p><p>&#128073; Subscribe to <strong><a href="https://www.databites.tech/">Databites.tech</a></strong> (By Josep)</p><p>&#128073; Subscribe to <strong><a href="https://www.nb-data.com/">Non-Brand Data</a></strong> (By Cornellius)</p><p>&#128073; Check out the <strong>SQL Crash Course</strong> <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">GitHub repo</a></strong></p><p>&#128073; <em><strong>Share with your friend and whoever needs it!</strong></em></p><div class="pullquote"><p><em>&#128467;&#65039; <strong>Every Thursday, you will have two new issues in your inbox!</strong></em></p></div><p>Let&#8217;s dive in and <strong>make SQL less scary, more fun, and way more useful!</strong> &#128640;</p><p><strong>Josep &amp; Cornellius</strong></p><p></p>]]></content:encoded></item><item><title><![CDATA[#2 Why learn SQL?]]></title><description><![CDATA[SQL Crash Course #2]]></description><link>https://reads.databites.tech/p/2-why-learn-sql</link><guid isPermaLink="false">https://reads.databites.tech/p/2-why-learn-sql</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Thu, 13 Mar 2025 12:31:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!UYi3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi everyone! <strong>Josep</strong> and <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Cornellius Yudha Wijaya&quot;,&quot;id&quot;:6000855,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F082a74ab-7da0-4612-ad7a-caa607514571_675x900.png&quot;,&quot;uuid&quot;:&quot;77a522dc-c885-4fb8-827b-0c8471adc272&quot;}" data-component-name="MentionToDOM"></span> from<strong> </strong><span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Non-Brand Data&quot;,&quot;id&quot;:37262,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/cornellius&quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/6c0e1cde-d120-4029-8ffd-2a8c7c6e4504_1280x1280.png&quot;,&quot;uuid&quot;:&quot;21224ba4-e752-406e-8e7c-5134f125ed5d&quot;}" data-component-name="MentionToDOM"></span> here &#128075;&#127995;</p><p>As promised, today we are starting our SQL Crash Course, which will take you <strong>from zero to hero!&#128640;</strong></p><p>As a reminder, we will cover <strong><a href="https://www.databites.tech/p/launching-the-sql-crash-course-from">seven SQL key topics,</a></strong> each separated into multiple posts across <a href="https://open.substack.com/pub/cornellius">Non-Brand Data</a> and <a href="https://open.substack.com/pub/rfeers">DataBites</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UYi3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UYi3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!UYi3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!UYi3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!UYi3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UYi3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png" width="1380" height="962" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75feee05-8120-44e6-b933-1430161dc165_1380x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1380,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:94110,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158934446?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UYi3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!UYi3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!UYi3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!UYi3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75feee05-8120-44e6-b933-1430161dc165_1380x962.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Today&#8217;s turn is for: </p><p><strong>&#128204; What is SQL? </strong>by <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Cornellius Yudha Wijaya&quot;,&quot;id&quot;:6000855,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F082a74ab-7da0-4612-ad7a-caa607514571_675x900.png&quot;,&quot;uuid&quot;:&quot;8ad62d9b-6088-438d-b66f-07260d8d30f9&quot;}" data-component-name="MentionToDOM"></span> in <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Non-Brand Data&quot;,&quot;id&quot;:37262,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/cornellius&quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/6c0e1cde-d120-4029-8ffd-2a8c7c6e4504_1280x1280.png&quot;,&quot;uuid&quot;:&quot;1b6c3e3d-13e9-4451-b275-246d1993d788&quot;}" data-component-name="MentionToDOM"></span> </p><p><strong>&#128204; Why learn SQL? </strong>by <strong>me in </strong><span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;DataBites&quot;,&quot;id&quot;:2143185,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/rfeers&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e930fbab-b8df-40ef-9676-3d9ca5d49eae_714x714.png&quot;,&quot;uuid&quot;:&quot;b179e91d-d4dc-4362-9c40-96ab2425b58d&quot;}" data-component-name="MentionToDOM"></span> </p><p>So, let&#8217;s dive in!</p><div><hr></div><h3>Why SQL? &#128640;</h3><p>If you're looking to break into <strong>data science</strong>, one of the biggest questions is:</p><p>&#128073; <em>What tool should I learn first?</em></p><p>The answer? <strong>SQL.</strong></p><p>SQL remains the <strong>#1 data language</strong> and is by far the easiest to learn. If you want to succeed in data science, here&#8217;s the best advice we can give you:</p><blockquote><p><strong>START</strong><br><strong>LEARNING</strong><br><strong>SQL</strong><br><strong>RIGHT</strong><br><strong>NOW!</strong></p></blockquote><p>Still unsure? Let&#8217;s break it down. &#128071;&#127995;</p><h2>The Power of SQL &#128293;</h2><p>Humankind has always been strongly shaped by its ability to store and share information. Studies indicate that a key distinction between humans and other animals lies in <strong>our ability to create, preserve, and inherit knowledge and culture across generations.</strong></p><p><em>And guess what&#8230; <strong>all of this is just DATA!</strong></em></p><p>Today we are amid a significant shift in how our world works: </p><blockquote><p>Data has become the fuel of the XXI century. </p></blockquote><p>All fields and sectors rely on it to make decisions.</p><p>One thing is certain: <strong>The need for data-related skills will only keep surging.</strong></p><p>Organisations today gather raw data from both internal and external sources at an unprecedented rate. By analysing this data, they can use reporting applications, dashboards, and other tools to answer questions and gain valuable insights.</p><blockquote><p><em>So the right question to be done is how to manage all this data?</em></p></blockquote><p>And the answer is quite simple: <strong>SQL remains the best option to do so.</strong></p><h3>But why SQL specifically? &#129300;</h3><p>Check out the <strong><a href="https://survey.stackoverflow.co/2024/technology#most-popular-technologies-language-prof">StackOverflow Developer Survey 2024</a></strong>&#8212;SQL ranks as the <strong>2nd (&#8252;&#65039;) most used programming language</strong> (and <strong>#1 in data science</strong> &#129351;).</p><p>Now, let&#8217;s explore <strong>SQL&#8217;s biggest advantages.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8g6m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8g6m!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png 424w, https://substackcdn.com/image/fetch/$s_!8g6m!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png 848w, https://substackcdn.com/image/fetch/$s_!8g6m!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png 1272w, https://substackcdn.com/image/fetch/$s_!8g6m!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8g6m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png" width="1456" height="310" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:310,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:74530,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158934446?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8g6m!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png 424w, https://substackcdn.com/image/fetch/$s_!8g6m!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png 848w, https://substackcdn.com/image/fetch/$s_!8g6m!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png 1272w, https://substackcdn.com/image/fetch/$s_!8g6m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6787b81-f498-4abe-9e3f-4cbbd8822ac6_2274x484.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>So let&#8217;s try to understand better SQL&#8217;s advantages &#128165;</p><h2>SQL&#8217;s main advantages</h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!15us!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!15us!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png 424w, https://substackcdn.com/image/fetch/$s_!15us!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png 848w, https://substackcdn.com/image/fetch/$s_!15us!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png 1272w, https://substackcdn.com/image/fetch/$s_!15us!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!15us!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png" width="1456" height="332" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9aabf713-2434-466d-959e-4116543c06bd_3700x843.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:332,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:390380,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!15us!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png 424w, https://substackcdn.com/image/fetch/$s_!15us!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png 848w, https://substackcdn.com/image/fetch/$s_!15us!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png 1272w, https://substackcdn.com/image/fetch/$s_!15us!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aabf713-2434-466d-959e-4116543c06bd_3700x843.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3><strong>#1. It can deal with big amounts of Data</strong></h3><p>SQL is designed to work with big data and can handle complex queries on large datasets much faster than other tools like spreadsheets or even some programming languages like Python.</p><p>Learning SQL helps you <strong>manage and analyze big data effectively.</strong></p><p>In many organizations, the core of the data environment is typically a data warehouse, where SQL is the primary language for interaction.</p><h3><strong>#2. It can be easily integrated with other tools</strong></h3><p>SQL integrates seamlessly with other data science tools and programming languages, such as Python and R. Libraries like pandas (Python) and dplyr (R) allow you to run SQL queries directly within your code.</p><p>This interoperability makes it easier to combine SQL's data handling capabilities with the advanced analytics, visualization and ML features of these languages.</p><h3><strong>#3. It is standardized</strong></h3><p>To query or manipulate data with SQL, you use statements with keywords such as <code>SELECT</code> and <code>FROM</code>. This SQL syntax is standardized by ANSI and ISO-certified, ensuring consistency across the hundreds of databases and data tools that support SQL today.</p><p>While some databases and tools may extend the syntax with specialized operators, commands, or functions, the fundamental principles of SQL remain consistent.</p><p>Once you master the basics of SQL, you can apply this knowledge universally across different platforms.</p><h3><strong>#4. It is easy to understand</strong></h3><p><strong>Basic SQL syntax is highly readable, resembling natural language.</strong> It outlines how data should be retrieved or manipulated.</p><p>Consider the following example query:</p><pre><code><code>SELECT 
    first_name, 
    last_name, 
    date_of_hire
FROM employees
WHERE date_of_hire &gt; '2018-12-31'
ORDER BY date_of_hire, last_name</code></code></pre><p>In this query, the SQL keywords <code>SELECT</code>, <code>FROM</code>, <code>WHERE</code>, and <code>ORDER BY</code> define the actions to be performed and any person can understand the main purpose of the query.</p><p>&#9888;&#65039; <strong>Pro Tip:</strong> SQL keywords don&#8217;t need to be capitalized, but doing so improves readability.</p><h2>How to Get Started &#128640;</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wQ6f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png" width="1456" height="743" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:543580,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158934446?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wQ6f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!wQ6f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9014add9-9d0c-4622-b78f-b1a82a8bfd6c_2870x1465.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Over the coming weeks, we&#8217;ll guide you through:</p><p><strong>&#9989; SQL Fundamentals<br>&#9989; Intermediate SQL<br>&#9989; Advanced SQL<br>&#9989; Database Operations<br>&#9989; Writing Efficient Queries</strong></p><p>Once you grasp the basics, <strong>practice is key</strong>! Start working on real-world projects and solving <strong>hands-on data problems</strong>.</p><h1>What&#8217;s Next? &#10145;&#65039;</h1><p>This is the first of many posts about the upcoming SQL Courses. It will only explain what SQL is in its crude form.</p><p>To get the <em><strong>full experience and fully immersed in the learning</strong></em>:</p><p>&#128073; Subscribe to <strong><a href="https://www.databites.tech/">Databites.tech</a></strong> (By Josep)</p><p>&#128073; Subscribe to <strong><a href="https://www.nb-data.com/">Non-Brand Data</a></strong> (By Cornellius)</p><p>&#128073; Check out the <strong>SQL Crash Course</strong> <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">GitHub repo</a></strong></p><p>&#128073; <em><strong>Share with your friend and whoever needs it!</strong></em></p><div class="pullquote"><p><em>&#128467;&#65039; <strong>Every Thursday, you will have two new issues in your inbox!</strong></em></p></div><p>Let&#8217;s dive in and <strong>make SQL less scary, more fun, and way more useful!</strong> &#128640;</p><p><strong>Josep &amp; Cornellius</strong></p>]]></content:encoded></item><item><title><![CDATA[Launching the SQL Crash Course – From Zero to Hero! 🚀]]></title><description><![CDATA[SQL Crash Course #0]]></description><link>https://reads.databites.tech/p/launching-the-sql-crash-course-from</link><guid isPermaLink="false">https://reads.databites.tech/p/launching-the-sql-crash-course-from</guid><dc:creator><![CDATA[Josep Ferrer]]></dc:creator><pubDate>Tue, 11 Mar 2025 11:02:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ZA_u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey everyone, this is Josep one more week! &#128075;&#127995;</p><p>Today I&#8217;m teaming up with <strong>Cornellius</strong> from <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Non-Brand Data&quot;,&quot;id&quot;:37262,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/cornellius&quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/6c0e1cde-d120-4029-8ffd-2a8c7c6e4504_1280x1280.png&quot;,&quot;uuid&quot;:&quot;ed1fa602-ca7b-450a-a02d-1d7c3c4d7c28&quot;}" data-component-name="MentionToDOM"></span> to bring you something special&#8212;a brand-new <strong>SQL Crash Course</strong>! &#127881;</p><p>Whether you're just starting out or looking to sharpen your SQL skills, this series will take you <strong>from zero to hero</strong> with a structured, easy-to-follow approach. Each post will break down essential SQL concepts, helping you <strong>crash into SQL</strong> with confidence, following the same style of my previous SQL courses. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZA_u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZA_u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!ZA_u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!ZA_u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!ZA_u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZA_u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png" width="1380" height="962" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1380,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:109152,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158754537?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZA_u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png 424w, https://substackcdn.com/image/fetch/$s_!ZA_u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png 848w, https://substackcdn.com/image/fetch/$s_!ZA_u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png 1272w, https://substackcdn.com/image/fetch/$s_!ZA_u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5894157-a2e9-46c1-8d34-8186afee693b_1380x962.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>&#128293; What&#8217;s in the course?</h2><p>We will structure the series into <strong>seven key topics</strong> to guide you step by step:</p><ol><li><p><strong>Introduction</strong> &#8211; What SQL is and why it matters</p></li><li><p><strong>SQL Fundamentals</strong> &#8211; Basic commands, filtering, and aggregation</p></li><li><p><strong>Intermediate SQL</strong> &#8211; Joins, unions, and functions</p></li><li><p><strong>Advanced SQL</strong> &#8211; Subqueries, CTEs, recursion, and views</p></li><li><p><strong>Database Operations</strong> &#8211; CRUD, schema changes, and optimization</p></li><li><p><strong>Crafting Good SQL Queries</strong> &#8211; Best practices for writing efficient queries</p></li><li><p><strong>Real-world Problems</strong> &#8211; Applying SQL to practical challenges</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0uya!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0uya!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!0uya!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!0uya!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!0uya!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0uya!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png" width="1456" height="743" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:490572,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.databites.tech/i/158754537?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0uya!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 424w, https://substackcdn.com/image/fetch/$s_!0uya!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 848w, https://substackcdn.com/image/fetch/$s_!0uya!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 1272w, https://substackcdn.com/image/fetch/$s_!0uya!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7f40ab-eb8f-4cc0-b9be-c1a1e2b0808b_2870x1465.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>&#127919; Who is this course for?</h2><p>This <strong>SQL Crash Course</strong> is designed for <strong>two main audiences</strong>:</p><h4>- <strong>Juniors &amp; Beginners</strong> </h4><p>If you're new to SQL or want to <strong>crash into the world of databases</strong>, this course will guide you step by step, making SQL easy and approachable.</p><h4>- <strong>Seasoned Professionals &amp; Seniors</strong> </h4><p>In the later editions, we&#8217;ll <strong>tackle real-world projects</strong> and <strong>develop end-to-end solutions</strong> that you can add to your portfolio, helping you level up your skills and showcase practical experience.</p><p><em>No matter where you are in your SQL journey, this course will help you <strong>learn, apply, and master SQL</strong> with real examples and structured learning.</em></p><h2>&#128467;&#65039; <strong>When will it be available?</strong></h2><p>We&#8217;ll post the first two issues this Thursday, 13th March! &#9888;&#65039;</p><p>Afterwards, every Thursday, you will have two new issues right in your inbox! </p><p><strong>Make sure to subscribe to both <a href="https://www.databites.tech/">databites.tech</a> and <a href="https://www.nb-data.com/">Non-Brand Data</a>!! &#128064;</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">DataBites is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>&#128161; <strong>Where to find it?</strong></h2><p>We&#8217;ll be publishing weekly issues in both our newsletters: </p><ul><li><p><a href="https://www.databites.tech/">Databites.tech</a> (By Josep)</p></li><li><p><a href="https://www.nb-data.com/">Non-Brand Data</a> (By Cornellius)</p></li></ul><p>We will make it&nbsp;<strong>open-source</strong>&nbsp;on&nbsp;<strong>GitHub</strong> so you can follow along, experiment, and contribute!</p><p>&#128073; Check out the <strong><a href="https://github.com/CornelliusYW/SQL-Crash-Course">GitHub repo</a></strong> and stay tuned for the first post!</p><div><hr></div><h3>&#128218; SQL Crash Course &#8211; Published Articles</h3><h4><strong>1&#65039;&#8419; Introduction to SQL</strong></h4><p>&#9989; <strong>#1. What is SQL? &#8594; <a href="https://www.nb-data.com/p/2-what-is-sql">link</a></strong><br>&#9989; <strong>#2. Why Learn SQL? &#8594; <a href="https://www.databites.tech/p/2-why-learn-sql">link</a></strong><br>&#9989; <strong>#3. Relational Data &amp; Models &#8594; <a href="https://www.databites.tech/p/3-relational-data-and-models">link</a></strong></p><h4><strong>2&#65039;&#8419; SQL Fundamentals</strong></h4><p>&#9989; <strong>#4. Basic Commands (SELECT, FROM, WHERE) &#8594; <a href="https://www.nb-data.com/p/4-sql-basic-commands">link</a></strong><br>&#9989; <strong>#5. Sorting &amp; Limiting (ORDER BY, LIMIT)&#8594;</strong> <strong><a href="https://www.databites.tech/p/5-sorting-and-limiting">link</a></strong><br>&#9989; <strong>#6. Aggregate Functions (SUM, AVG, COUNT, etc.) &#8594; <a href="https://www.nb-data.com/p/6-aggregate-functions">link</a></strong></p><h4><strong>3&#65039;&#8419; Intermediate SQL</strong></h4><p>&#9989;  <strong>#7. JOINS (INNER, LEFT, RIGHT, FULL) &#8594; <a href="https://www.databites.tech/p/7-joins-left-right-inner-and-full">link</a> </strong><br>&#9989;  <strong>#8. UNION &amp; UNION ALL &#8594;</strong> <strong><a href="https://www.nb-data.com/p/8-union-and-union-all">link</a></strong><br>&#9989;  <strong>#9. Case Expressions &#8594; <a href="https://www.databites.tech/p/9-case-expressions">link</a></strong><br>&#9989;  <strong>#10. Functions (String, Date, Numeric) &#8594; <a href="https://www.nb-data.com/p/10-functions-string-date-numeric">link</a></strong><em><br></em> </p><h4><strong>4&#65039;&#8419; Advanced SQL</strong></h4><p>&#9989;  <strong>#11. Subqueries &#8594; <a href="https://www.nb-data.com/p/11-subqueries">link</a></strong><br>&#9989;  <strong>#12. Common Table Expressions (CTEs) &#8594;</strong> <strong><a href="https://www.databites.tech/p/12-common-table-expressions-ctes">link</a></strong><br>&#9989; <strong>#13. Recursion &#8594;</strong> <strong><a href="https://www.nb-data.com/p/13-recursion">link</a></strong><br>&#9989; <strong>#14. Views  &#8594;</strong> <strong><a href="https://www.databites.tech/p/14-views">link</a></strong></p><h4><strong>5&#65039;&#8419; Database Operations</strong></h4><p>&#9989;  <strong>#15. CRUD operations (INSERT, UPDATE, DELETE) &#8594;</strong><em> </em><strong><a href="https://www.nb-data.com/p/15-crud-operations">link</a></strong><br>&#9989;  <strong>#16. Database modifications (ALTER, DROP, CREATE) &#8594;</strong> <strong><a href="https://www.databites.tech/p/16-database-modifications">link</a></strong><br>&#9989;  <strong>#17. Indexing &amp; Optimization &#8594; <a href="https://www.nb-data.com/p/17-indexing-and-optimization">link</a></strong></p><h4><strong>6&#65039;&#8419; Crafting Good SQL queries</strong></h4><p>&#9989;  <strong>#18. Modular Code &#8594; <a href="https://www.databites.tech/p/18-generating-modular-code">link</a></strong><br>&#9989;  <strong>#19. SQL Execution Order &#8594; <a href="https://www.databites.tech/p/19-sql-execution-order">link</a></strong><br>&#9989;  <strong>#20. Query Optimization &#8594; <a href="https://www.nb-data.com/p/20-query-optimization">link</a></strong> </p><div><hr></div><p>Let&#8217;s dive in and <strong>make SQL less scary, more fun, and way more useful!</strong> &#128640;</p><p><strong>Josep &amp; Cornellius</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://reads.databites.tech/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">DataBites is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>