<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sowrabh on Medium]]></title>
        <description><![CDATA[Stories by Sowrabh on Medium]]></description>
        <link>https://medium.com/@sowrabh850?source=rss-87c30bed94a1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QM_Fsl3J7XYsyhTt</url>
            <title>Stories by Sowrabh on Medium</title>
            <link>https://medium.com/@sowrabh850?source=rss-87c30bed94a1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 21:13:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sowrabh850/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SQL WHERE Clause Explained: 10 Simple Examples for Beginners]]></title>
            <link>https://medium.com/@sowrabh850/sql-where-clause-explained-10-simple-examples-for-beginners-d639108891ed?source=rss-87c30bed94a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d639108891ed</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[beginner]]></category>
            <dc:creator><![CDATA[Sowrabh]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 03:31:10 GMT</pubDate>
            <atom:updated>2026-10-14T03:31:10.856Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine you have a database containing information about 1,000 students.</p><p>Now, your teacher asks you three questions:</p><ul><li>Find students who scored more than 80 marks.</li><li>Find students who belong to the IS branch.</li><li>Find students whose names start with the letter A.</li></ul><p>Would you manually check all 1,000 records?</p><p>Of course not!</p><p>This is exactly where the SQL WHERE clause becomes useful.</p><p>In this article, we’ll understand WHERE through 10 simple examples. You don&#39;t need advanced SQL knowledge to follow along.</p><h3>First, Let’s Understand Our Table</h3><p>Throughout this tutorial, we’ll use a table called Students.</p><p>IDNameBranchMarks1RahulCSE852PriyaIS923ArunECE764SnehaIS885KiranCSE656AnanyaECE95</p><p>Our goal is to retrieve only the records that match a particular condition.</p><h3>What Is the WHERE Clause?</h3><p>The WHERE clause filters rows based on a condition.</p><p>Here’s the basic syntax:</p><pre>SELECT column_name<br>FROM table_name<br>WHERE condition;</pre><p>For example:</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt; 80;</pre><p>This query returns only students whose marks are greater than 80.</p><p><strong>Remember:</strong> SELECT chooses the columns, while WHERE decides which rows should appear.</p><p>Let’s look at some practical examples.</p><h3>1. Find Students Who Scored More Than 80</h3><p>Suppose we want to find students who scored more than 80 marks.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt; 80;</pre><p>Output:</p><p>IDNameBranchMarks1RahulCSE852PriyaIS924SnehaIS886AnanyaECE95</p><p>Here, &gt; means greater than.</p><p>SQL supports several comparison operators:</p><p>OperatorMeaning=Equal to&gt;Greater than&lt;Less than&gt;=Greater than or equal to&lt;=Less than or equal to&lt;&gt;Not equal to</p><p>These operators form the foundation of SQL filtering.</p><h3>2. Find Students From a Particular Branch</h3><p>Suppose we want only students who belong to the IS branch.</p><pre>SELECT *<br>FROM Students<br>WHERE Branch = &#39;IS&#39;;</pre><p>Output:</p><p>IDNameBranchMarks2PriyaIS924SnehaIS88</p><p>Notice that we used single quotes around &#39;IS&#39;.</p><p>That’s because we’re comparing the column with a text value.</p><p>A simple rule to remember:</p><ul><li>Numbers generally don’t need quotes.</li><li>Text values are generally written inside single quotes.</li></ul><h3>3. Find Students Who Scored 80 or More</h3><p>What if the condition includes 80 itself?</p><p>We can use &gt;=.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt;= 80;</pre><p>This returns students with marks greater than or equal to 80.</p><p>The difference between &gt; and &gt;= is small but important.</p><p>If someone scores exactly 80, they won’t match Marks &gt; 80, but they will match Marks &gt;= 80.</p><h3>4. Find Students Who Scored Between 60 and 90</h3><p>Suppose we want students whose marks fall between 60 and 90, including both endpoints.</p><p>We can use BETWEEN.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks BETWEEN 60 AND 90;</pre><p>This includes marks of 60 and 90 as well as values between them.</p><p>In our table, Rahul, Arun, Sneha and Kiran match this condition.</p><p>You could also write:</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt;= 60 AND Marks &lt;= 90;</pre><p>Both queries express the same range condition.</p><p><strong>Beginner tip:</strong> BETWEEN includes its endpoints.</p><h3>5. Find Students From Either IS or CSE</h3><p>Suppose we want students from two branches: IS and CSE.</p><p>One option is to use OR.</p><pre>SELECT *<br>FROM Students<br>WHERE Branch = &#39;IS&#39; OR Branch = &#39;CSE&#39;;</pre><p>This returns students who belong to either branch.</p><p>OR means that at least one of the specified conditions must be true.</p><p>For example, a student can match because their branch is IS, or because their branch is CSE.</p><h3>6. Find Students Who Match Two Conditions</h3><p>Now suppose we want students who belong to the IS branch <strong>and</strong> scored more than 90.</p><p>We can use AND.</p><pre>SELECT *<br>FROM Students<br>WHERE Branch = &#39;IS&#39; AND Marks &gt; 90;</pre><p>Output:</p><p>IDNameBranchMarks2PriyaIS92</p><p>Both conditions must be true for a row to appear.</p><p>Compare the two:</p><ul><li>AND requires both conditions to be true.</li><li>OR requires at least one condition to be true.</li></ul><p>Understanding this difference will help you solve many SQL problems.</p><h3>7. Find Students From Multiple Branches Using IN</h3><p>What if we want students from IS, CSE or ECE?</p><p>We could write several OR conditions, but there&#39;s a simpler option: IN.</p><pre>SELECT *<br>FROM Students<br>WHERE Branch IN (&#39;IS&#39;, &#39;CSE&#39;, &#39;ECE&#39;);</pre><p>This returns students whose branch matches any value in the list.</p><p>IN is especially useful when you have several possible values to check.</p><p>For example, instead of writing:</p><pre>WHERE Branch = &#39;IS&#39;<br>   OR Branch = &#39;CSE&#39;<br>   OR Branch = &#39;ECE&#39;</pre><p>you can use:</p><pre>WHERE Branch IN (&#39;IS&#39;, &#39;CSE&#39;, &#39;ECE&#39;)</pre><p>Both approaches express the same membership condition.</p><h3>8. Find Students Whose Names Start With A</h3><p>Now let’s try something different.</p><p>Suppose we want to find students whose names begin with the letter A.</p><p>We can use LIKE with the % wildcard.</p><pre>SELECT *<br>FROM Students<br>WHERE Name LIKE &#39;A%&#39;;</pre><p>Output:</p><p>IDNameBranchMarks3ArunECE766AnanyaECE95</p><p>What does &#39;A%&#39; mean?</p><ul><li>A means the name must begin with A.</li><li>% matches zero or more characters after A.</li></ul><p>Here are three useful patterns:</p><p>PatternMeaning&#39;A%&#39;Starts with A&#39;%a&#39;Ends with a&#39;%an%&#39;Contains an</p><p>For example, Name LIKE &#39;%an%&#39; matches names containing the sequence an.</p><p><strong>Important:</strong> Case sensitivity depends on the database and its collation settings.</p><h3>9. Find Students Whose Marks Are Not 85</h3><p>Suppose we want everyone except students who scored exactly 85.</p><p>We can use the not-equal operator &lt;&gt;.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &lt;&gt; 85;</pre><p>This returns all rows whose marks are different from 85.</p><p>You may also encounter != in SQL systems that support it.</p><p>For beginner SQL, learning &lt;&gt; is a good starting point.</p><h3>10. Combine Filtering and Sorting</h3><p>Let’s finish with a more realistic query.</p><p>Suppose we want students who scored at least 80, sorted from highest marks to lowest.</p><pre>SELECT Name, Marks<br>FROM Students<br>WHERE Marks &gt;= 80<br>ORDER BY Marks DESC;</pre><p>Output:</p><p>NameMarksAnanya95Priya92Sneha88Rahul85</p><p>This query combines three ideas:</p><ul><li>SELECT chooses the columns.</li><li>WHERE filters the rows.</li><li>ORDER BY sorts the results.</li></ul><p>You can combine SQL clauses to answer increasingly complex questions without making the query unnecessarily complicated.</p><h3>Common WHERE Clause Mistakes</h3><p>Before you move on, watch out for these mistakes.</p><p><strong>1. Using </strong><strong>= incorrectly with text</strong></p><p>Incorrect:</p><pre>WHERE Branch = IS</pre><p>Correct:</p><pre>WHERE Branch = &#39;IS&#39;</pre><p><strong>2. Forgetting that BETWEEN includes endpoints</strong></p><p>Marks BETWEEN 60 AND 90 includes both 60 and 90.</p><p><strong>3. Confusing AND with OR</strong></p><p>If you use AND, both conditions must be true. If you use OR, either condition can be true.</p><p><strong>4. Using </strong><strong>= NULL to check missing values</strong></p><p>SQL uses a special condition for missing values:</p><pre>WHERE Marks IS NULL</pre><p>To find rows where marks are present:</p><pre>WHERE Marks IS NOT NULL</pre><p>Don’t use Marks = NULL for this purpose.</p><h3>Practice These 3 Questions</h3><p>Before looking at the answers, try writing these queries yourself.</p><p><strong>Question 1:</strong> Find students who scored less than 80 marks.</p><p><strong>Question 2:</strong> Find students from the CSE branch who scored more than 70.</p><p><strong>Question 3:</strong> Find students whose names end with the letter a.</p><h3>Answers</h3><p><strong>Question 1</strong></p><pre>SELECT *<br>FROM Students<br>WHERE Marks &lt; 80;</pre><p><strong>Question 2</strong></p><pre>SELECT *<br>FROM Students<br>WHERE Branch = &#39;CSE&#39; AND Marks &gt; 70;</pre><p><strong>Question 3</strong></p><pre>SELECT *<br>FROM Students<br>WHERE Name LIKE &#39;%a&#39;;</pre><p>If you got these right, you’re already learning how to translate a question into SQL.</p><h3>Final Thoughts</h3><p>The WHERE clause is one of the most useful concepts in SQL because real-world databases can contain thousands or even millions of records.</p><p>You rarely need every row at once. Usually, you need specific information that satisfies certain conditions.</p><p>Start by practising comparison operators. Then move on to AND, OR, IN, BETWEEN and LIKE.</p><p>Don’t just read these queries. Run them, change the conditions and observe how the results change.</p><p>That’s how you build real SQL skills.</p><p><strong>Coming next:</strong> SQL JOINs Explained With Simple Tables — A Beginner’s Guide.SQL WHERE Clause Explained: 10 Simple Examples for Beginners</p><p>Imagine you have a database containing information about 1,000 students.</p><p>Now, your teacher asks you three questions:</p><ul><li>Find students who scored more than 80 marks.</li><li>Find students who belong to the IS branch.</li><li>Find students whose names start with the letter A.</li></ul><p>Would you manually check all 1,000 records?</p><p>Of course not!</p><p>This is exactly where the SQL WHERE clause becomes useful.</p><p>In this article, we’ll understand WHERE through 10 simple examples. You don&#39;t need advanced SQL knowledge to follow along.</p><h3>First, Let’s Understand Our Table</h3><p>Throughout this tutorial, we’ll use a table called Students.</p><p>IDNameBranchMarks1RahulCSE852PriyaIS923ArunECE764SnehaIS885KiranCSE656AnanyaECE95</p><p>Our goal is to retrieve only the records that match a particular condition.</p><h3>What Is the WHERE Clause?</h3><p>The WHERE clause filters rows based on a condition.</p><p>Here’s the basic syntax:</p><pre>SELECT column_name<br>FROM table_name<br>WHERE condition;</pre><p>For example:</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt; 80;</pre><p>This query returns only students whose marks are greater than 80.</p><p><strong>Remember:</strong> SELECT chooses the columns, while WHERE decides which rows should appear.</p><p>Let’s look at some practical examples.</p><h3>1. Find Students Who Scored More Than 80</h3><p>Suppose we want to find students who scored more than 80 marks.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt; 80;</pre><p>Output:</p><p>IDNameBranchMarks1RahulCSE852PriyaIS924SnehaIS886AnanyaECE95</p><p>Here, &gt; means greater than.</p><p>SQL supports several comparison operators:</p><p>OperatorMeaning=Equal to&gt;Greater than&lt;Less than&gt;=Greater than or equal to&lt;=Less than or equal to&lt;&gt;Not equal to</p><p>These operators form the foundation of SQL filtering.</p><h3>2. Find Students From a Particular Branch</h3><p>Suppose we want only students who belong to the IS branch.</p><pre>SELECT *<br>FROM Students<br>WHERE Branch = &#39;IS&#39;;</pre><p>Output:</p><p>IDNameBranchMarks2PriyaIS924SnehaIS88</p><p>Notice that we used single quotes around &#39;IS&#39;.</p><p>That’s because we’re comparing the column with a text value.</p><p>A simple rule to remember:</p><ul><li>Numbers generally don’t need quotes.</li><li>Text values are generally written inside single quotes.</li></ul><h3>3. Find Students Who Scored 80 or More</h3><p>What if the condition includes 80 itself?</p><p>We can use &gt;=.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt;= 80;</pre><p>This returns students with marks greater than or equal to 80.</p><p>The difference between &gt; and &gt;= is small but important.</p><p>If someone scores exactly 80, they won’t match Marks &gt; 80, but they will match Marks &gt;= 80.</p><h3>4. Find Students Who Scored Between 60 and 90</h3><p>Suppose we want students whose marks fall between 60 and 90, including both endpoints.</p><p>We can use BETWEEN.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks BETWEEN 60 AND 90;</pre><p>This includes marks of 60 and 90 as well as values between them.</p><p>In our table, Rahul, Arun, Sneha and Kiran match this condition.</p><p>You could also write:</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt;= 60 AND Marks &lt;= 90;</pre><p>Both queries express the same range condition.</p><p><strong>Beginner tip:</strong> BETWEEN includes its endpoints.</p><h3>5. Find Students From Either IS or CSE</h3><p>Suppose we want students from two branches: IS and CSE.</p><p>One option is to use OR.</p><pre>SELECT *<br>FROM Students<br>WHERE Branch = &#39;IS&#39; OR Branch = &#39;CSE&#39;;</pre><p>This returns students who belong to either branch.</p><p>OR means that at least one of the specified conditions must be true.</p><p>For example, a student can match because their branch is IS, or because their branch is CSE.</p><h3>6. Find Students Who Match Two Conditions</h3><p>Now suppose we want students who belong to the IS branch <strong>and</strong> scored more than 90.</p><p>We can use AND.</p><pre>SELECT *<br>FROM Students<br>WHERE Branch = &#39;IS&#39; AND Marks &gt; 90;</pre><p>Output:</p><p>IDNameBranchMarks2PriyaIS92</p><p>Both conditions must be true for a row to appear.</p><p>Compare the two:</p><ul><li>AND requires both conditions to be true.</li><li>OR requires at least one condition to be true.</li></ul><p>Understanding this difference will help you solve many SQL problems.</p><h3>7. Find Students From Multiple Branches Using IN</h3><p>What if we want students from IS, CSE or ECE?</p><p>We could write several OR conditions, but there&#39;s a simpler option: IN.</p><pre>SELECT *<br>FROM Students<br>WHERE Branch IN (&#39;IS&#39;, &#39;CSE&#39;, &#39;ECE&#39;);</pre><p>This returns students whose branch matches any value in the list.</p><p>IN is especially useful when you have several possible values to check.</p><p>For example, instead of writing:</p><pre>WHERE Branch = &#39;IS&#39;<br>   OR Branch = &#39;CSE&#39;<br>   OR Branch = &#39;ECE&#39;</pre><p>you can use:</p><pre>WHERE Branch IN (&#39;IS&#39;, &#39;CSE&#39;, &#39;ECE&#39;)</pre><p>Both approaches express the same membership condition.</p><h3>8. Find Students Whose Names Start With A</h3><p>Now let’s try something different.</p><p>Suppose we want to find students whose names begin with the letter A.</p><p>We can use LIKE with the % wildcard.</p><pre>SELECT *<br>FROM Students<br>WHERE Name LIKE &#39;A%&#39;;</pre><p>Output:</p><p>IDNameBranchMarks3ArunECE766AnanyaECE95</p><p>What does &#39;A%&#39; mean?</p><ul><li>A means the name must begin with A.</li><li>% matches zero or more characters after A.</li></ul><p>Here are three useful patterns:</p><p>PatternMeaning&#39;A%&#39;Starts with A&#39;%a&#39;Ends with a&#39;%an%&#39;Contains an</p><p>For example, Name LIKE &#39;%an%&#39; matches names containing the sequence an.</p><p><strong>Important:</strong> Case sensitivity depends on the database and its collation settings.</p><h3>9. Find Students Whose Marks Are Not 85</h3><p>Suppose we want everyone except students who scored exactly 85.</p><p>We can use the not-equal operator &lt;&gt;.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &lt;&gt; 85;</pre><p>This returns all rows whose marks are different from 85.</p><p>You may also encounter != in SQL systems that support it.</p><p>For beginner SQL, learning &lt;&gt; is a good starting point.</p><h3>10. Combine Filtering and Sorting</h3><p>Let’s finish with a more realistic query.</p><p>Suppose we want students who scored at least 80, sorted from highest marks to lowest.</p><pre>SELECT Name, Marks<br>FROM Students<br>WHERE Marks &gt;= 80<br>ORDER BY Marks DESC;</pre><p>Output:</p><p>NameMarksAnanya95Priya92Sneha88Rahul85</p><p>This query combines three ideas:</p><ul><li>SELECT chooses the columns.</li><li>WHERE filters the rows.</li><li>ORDER BY sorts the results.</li></ul><p>You can combine SQL clauses to answer increasingly complex questions without making the query unnecessarily complicated.</p><h3>Common WHERE Clause Mistakes</h3><p>Before you move on, watch out for these mistakes.</p><p><strong>1. Using </strong><strong>= incorrectly with text</strong></p><p>Incorrect:</p><pre>WHERE Branch = IS</pre><p>Correct:</p><pre>WHERE Branch = &#39;IS&#39;</pre><p><strong>2. Forgetting that BETWEEN includes endpoints</strong></p><p>Marks BETWEEN 60 AND 90 includes both 60 and 90.</p><p><strong>3. Confusing AND with OR</strong></p><p>If you use AND, both conditions must be true. If you use OR, either condition can be true.</p><p><strong>4. Using </strong><strong>= NULL to check missing values</strong></p><p>SQL uses a special condition for missing values:</p><pre>WHERE Marks IS NULL</pre><p>To find rows where marks are present:</p><pre>WHERE Marks IS NOT NULL</pre><p>Don’t use Marks = NULL for this purpose.</p><h3>Practice These 3 Questions</h3><p>Before looking at the answers, try writing these queries yourself.</p><p><strong>Question 1:</strong> Find students who scored less than 80 marks.</p><p><strong>Question 2:</strong> Find students from the CSE branch who scored more than 70.</p><p><strong>Question 3:</strong> Find students whose names end with the letter a.</p><h3>Answers</h3><p><strong>Question 1</strong></p><pre>SELECT *<br>FROM Students<br>WHERE Marks &lt; 80;</pre><p><strong>Question 2</strong></p><pre>SELECT *<br>FROM Students<br>WHERE Branch = &#39;CSE&#39; AND Marks &gt; 70;</pre><p><strong>Question 3</strong></p><pre>SELECT *<br>FROM Students<br>WHERE Name LIKE &#39;%a&#39;;</pre><p>If you got these right, you’re already learning how to translate a question into SQL.</p><h3>Final Thoughts</h3><p>The WHERE clause is one of the most useful concepts in SQL because real-world databases can contain thousands or even millions of records.</p><p>You rarely need every row at once. Usually, you need specific information that satisfies certain conditions.</p><p>Start by practising comparison operators. Then move on to AND, OR, IN, BETWEEN and LIKE.</p><p>Don’t just read these queries. Run them, change the conditions and observe how the results change.</p><p>That’s how you build real SQL skills.</p><p><strong>Coming next:</strong> SQL JOINs Explained With Simple Tables — A Beginner’s Guide.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d639108891ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL SELECT Explained: The First Command Every Beginner Should Learn]]></title>
            <link>https://medium.com/@sowrabh850/sql-select-explained-the-first-command-every-beginner-should-learn-5c751da8c5f3?source=rss-87c30bed94a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c751da8c5f3</guid>
            <category><![CDATA[query]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[select]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Sowrabh]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 12:47:33 GMT</pubDate>
            <atom:updated>2026-10-05T12:47:33.352Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started learning SQL, one of the first commands I came across was SELECT.</p><p>At first, it seemed almost too simple. You write a command, run it, and the database returns some data.</p><p>But as I started practicing, I realized something important: <strong>understanding SELECT properly makes learning the rest of SQL much easier.</strong></p><p>So, let’s understand it with simple examples.</p><h3>1. What Does SELECT Actually Do?</h3><p>Imagine you have a table containing information about students.</p><p>IDNameBranchMarks1RahulCSE852PriyaIS923ArunECE764SnehaIS885KiranCSE67</p><p>Suppose you want to see the names of these students.</p><p>You don’t need to display the entire table. You only need the Name column.</p><p>That’s where SELECT comes in.</p><pre>SELECT Name<br>FROM Students;</pre><p><strong>Output:</strong></p><p>NameRahulPriyaArunSnehaKiran</p><p>That’s it! We asked the database for one column, and it returned that column.</p><h3>2. What Does SELECT * Mean?</h3><p>Now imagine you want to see every column in the table.</p><p>You could write:</p><pre>SELECT ID, Name, Branch, Marks<br>FROM Students;</pre><p>But there’s a shorter way.</p><pre>SELECT *<br>FROM Students;</pre><p>The asterisk (*) means all columns.</p><p>Think of it like this:</p><ul><li>SELECT Name → Show only the Name column.</li><li>SELECT Marks → Show only the Marks column.</li><li>SELECT * → Show all columns.</li></ul><p>One small tip: SELECT * is useful while learning and exploring data. In larger projects, selecting only the columns you need can make your queries easier to understand and sometimes more efficient.</p><h3>3. Can We Select Multiple Columns?</h3><p>Of course!</p><p>Suppose you want to see each student’s name and marks, but you don’t need their ID or branch.</p><p>Write:</p><pre>SELECT Name, Marks<br>FROM Students;</pre><p><strong>Output:</strong></p><p>NameMarksRahul85Priya92Arun76Sneha88Kiran67</p><p>Notice that we separated the column names with commas.</p><p>This is a small detail, but it’s important when writing queries.</p><h3>4. What Is FROM, and Why Do We Need It?</h3><p>Look at this query again:</p><pre>SELECT Name<br>FROM Students;</pre><p>We already know that SELECT Name means we want the Name column.</p><p>But where should SQL find that column?</p><p>That’s what FROM tells the database.</p><p>In this example:</p><ul><li>SELECT Name tells SQL what information we want.</li><li>FROM Students tells SQL which table contains that information.</li></ul><p>A simple way to remember it:</p><p><strong>SELECT = What do I want?</strong></p><p><strong>FROM = Where should I get it from?</strong></p><p>Once you understand these two parts, basic SQL queries become much easier to read.</p><h3>5. Can We Give a Column a Different Name?</h3><p>Yes! This is called using a column alias.</p><p>Suppose you want the Marks column to appear as Student_Marks in your results.</p><p>You can write:</p><pre>SELECT Name, Marks AS Student_Marks<br>FROM Students;</pre><p>The result will contain a column named Student_Marks instead of Marks.</p><p>The original table is not changed. We’re only changing how the column is labelled in the query output.</p><p>Aliases are particularly useful when working with reports and data analysis.</p><h3>6. Can We Perform Calculations Inside SELECT?</h3><p>Yes, and this is where things get interesting.</p><p>Suppose every student receives five bonus marks. You want to see their current marks and their marks after the bonus.</p><p>You can write:</p><pre>SELECT<br>    Name,<br>    Marks,<br>    Marks + 5 AS Updated_Marks<br>FROM Students;</pre><p><strong>Output:</strong></p><p>NameMarksUpdated_MarksRahul8590Priya9297Arun7681Sneha8893Kiran6772</p><p>Notice something important: the query calculates the new values for the result, but it does not permanently update the Marks column in the original table.</p><p>That requires a different SQL command.</p><p>This is one reason SQL is useful for data analysis. We can calculate and display information without changing the original data.</p><h3>7. What Mistakes Should Beginners Avoid?</h3><p>Here are a few common mistakes to watch out for.</p><p><strong>Mistake 1: Forgetting commas</strong></p><p>Incorrect:</p><pre>SELECT Name Marks<br>FROM Students;</pre><p>Correct:</p><pre>SELECT Name, Marks<br>FROM Students;</pre><p><strong>Mistake 2: Using the wrong table name</strong></p><pre>SELECT Name<br>FROM Student;</pre><p>If your table is named Students, using Student may cause an error.</p><p><strong>Mistake 3: Thinking SELECT changes the original data</strong></p><p>SELECT retrieves data. It does not permanently modify the table.</p><p><strong>Mistake 4: Trying to learn everything at once</strong></p><p>You don’t need to master every SQL command today. Get comfortable selecting columns and reading queries first.</p><h3>8. Let’s Test What We’ve Learned</h3><p>Try answering these three questions before looking at the solutions.</p><p>Assume the table is called Students.</p><p><strong>Question 1:</strong> How would you display every column?</p><p><strong>Question 2:</strong> How would you display only the Name and Branch columns?</p><p><strong>Question 3:</strong> How would you display Name and Marks, but show the Marks column under the heading Score?</p><h3>Solutions</h3><p><strong>Answer 1</strong></p><pre>SELECT *<br>FROM Students;</pre><p><strong>Answer 2</strong></p><pre>SELECT Name, Branch<br>FROM Students;</pre><p><strong>Answer 3</strong></p><pre>SELECT Name, Marks AS Score<br>FROM Students;</pre><p>If you got these right, you’ve understood the foundation of the SELECT statement.</p><h3>Final Thoughts</h3><p>When learning SQL, it’s tempting to jump straight into complicated topics like JOINs and window functions.</p><p>But the basics matter more than we sometimes realize.</p><p>Today, we learned how to:</p><ul><li>Select specific columns.</li><li>Display all columns using *.</li><li>Retrieve data from a table using FROM.</li><li>Rename output columns using AS.</li><li>Perform simple calculations inside a query.</li></ul><p>These might look like small things, but almost every SQL learning journey starts here.</p><p><strong>Next, I’ll explore the WHERE clause — how to retrieve only the rows that match a condition.</strong></p><p>If you’re learning SQL too, practice these examples with a small dataset. Reading queries is helpful, but writing them yourself is where the real learning happens.</p><p><em>This is Article 2 in my SQL learning series. More beginner-friendly SQL tutorials coming soon.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c751da8c5f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“I Started Learning SQL — Here’s What I Wish I Knew Before Writing My First Query”]]></title>
            <link>https://medium.com/@sowrabh850/i-started-learning-sql-heres-what-i-wish-i-knew-before-writing-my-first-query-46fc72075782?source=rss-87c30bed94a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/46fc72075782</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[query]]></category>
            <category><![CDATA[it-jobs]]></category>
            <category><![CDATA[software-enginnering]]></category>
            <dc:creator><![CDATA[Sowrabh]]></dc:creator>
            <pubDate>Sun, 04 Oct 2026 16:52:36 GMT</pubDate>
            <atom:updated>2026-10-04T16:52:36.159Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first decided to learn SQL, I thought it would be difficult.</p><p>I kept seeing things like JOIN, GROUP BY, SUBQUERY, CTE, and WINDOW FUNCTIONS, and honestly, it looked like a completely different language.</p><p>But after actually starting to learn SQL, I realized something:</p><p><strong>SQL isn’t as complicated as it looks.</strong></p><p>The difficult part is usually not writing the query.</p><p>The difficult part is understanding <strong>what you’re actually asking the database to do.</strong></p><p>So, in this article, I want to share what I learned as a beginner before getting into more advanced SQL.</p><h3>What exactly is SQL?</h3><p>Let’s start with the simplest explanation.</p><p><strong>SQL stands for Structured Query Language.</strong></p><p>It is a language used to communicate with databases.</p><p>Imagine a college has a database containing information about its students.</p><p>It might look something like this:</p><p>IDNameBranchMarks1RahulCSE852PriyaIS923ArunECE764SnehaIS88</p><p>Now suppose I want to ask:</p><blockquote><em>“Show me all students who scored more than 80.”</em></blockquote><p>Instead of manually searching through the table, I can ask the database using SQL:</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt; 80;</pre><p>And the database gives me the required rows.</p><p>That’s basically what SQL allows us to do.</p><p><strong>We ask questions. The database finds the answers.</strong></p><h3>Database, SQL, and MySQL — What’s the difference?</h3><p>This was one of the first things that confused me.</p><p>I initially thought SQL and MySQL were basically the same thing.</p><p>They’re not.</p><h3>Database</h3><p>A <strong>database</strong> is where the data is stored and organized.</p><p>For example:</p><pre>College Database<br>│<br>├── Students<br>├── Teachers<br>├── Courses<br>└── Marks</pre><h3>SQL</h3><p><strong>SQL is the language</strong> we use to communicate with the database.</p><p>For example:</p><pre>SELECT * FROM Students;</pre><h3>MySQL</h3><p><strong>MySQL is a database management system (DBMS)</strong> that can store and manage databases and allows us to use SQL.</p><p>There are also other database systems such as PostgreSQL, Oracle Database, SQL Server, and SQLite.</p><p>So a simple way to remember it is:</p><blockquote><strong><em>Database = Where the data lives</em></strong><em><br></em><strong><em>SQL = Language used to communicate with it</em></strong><em><br></em><strong><em>MySQL = One system that manages databases</em></strong></blockquote><p>Once I understood this distinction, SQL started making much more sense.</p><h3>My First SQL Query</h3><p>One of the first queries I learned was:</p><pre>SELECT * <br>FROM Students;</pre><p>At first, this looked very simple.</p><p>But understanding each part is important.</p><h3>SELECT</h3><p>SELECT tells the database:</p><blockquote><em>“I want to see something.”</em></blockquote><h3>*</h3><p>The * means:</p><blockquote><em>“Give me all columns.”</em></blockquote><h3>FROM</h3><p>FROM tells the database which table we want the data from.</p><p>So:</p><pre>SELECT * FROM Students;</pre><p>basically means:</p><blockquote><strong><em>Show me everything from the Students table.</em></strong></blockquote><h3>What if I only want specific columns?</h3><p>We don’t always need every column.</p><p>Suppose I only want the student’s name and marks.</p><p>I can write:</p><pre>SELECT Name, Marks<br>FROM Students;</pre><p>Now the database returns only those two columns.</p><p>This was one of the first things that made SQL feel powerful to me.</p><p>Instead of manually going through a large table, I can tell the database exactly what information I need.</p><h3>Then I learned about WHERE</h3><p>Now let’s make the query more useful.</p><p>Suppose I only want students who scored more than 80.</p><p>We can use WHERE.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt; 80;</pre><p>The important idea is:</p><pre>SELECT → What do I want?</pre><pre>FROM → Where is the data?</pre><pre>WHERE → Which rows do I want?</pre><p>This simple way of thinking helped me understand SQL much better.</p><h3>The first SQL commands I focused on</h3><p>As a beginner, I didn’t try to memorize hundreds of SQL commands.</p><p>I focused on understanding a few important ones first.</p><h3>1. SELECT</h3><p>Used to choose the columns we want.</p><pre>SELECT Name, Marks<br>FROM Students;</pre><h3>2. WHERE</h3><p>Used to filter rows.</p><pre>SELECT *<br>FROM Students<br>WHERE Marks &gt; 80;</pre><h3>3. ORDER BY</h3><p>Used to sort the results.</p><pre>SELECT *<br>FROM Students<br>ORDER BY Marks DESC;</pre><p>DESC means descending order.</p><p>So the student with the highest marks appears first.</p><h3>4. GROUP BY</h3><p>Used to group similar data together.</p><p>For example, if we have students from different branches:</p><pre>SELECT Branch, COUNT(*)<br>FROM Students<br>GROUP BY Branch;</pre><p>This can tell us how many students belong to each branch.</p><h3>5. JOIN</h3><p>This was probably one of the concepts that initially looked scary.</p><p>A JOIN allows us to combine related information from different tables.</p><p>For example, we might have:</p><p><strong>Students</strong></p><p>IDName1Rahul2Priya</p><p><strong>Marks</strong></p><p>IDMarks185292</p><p>We can combine them using:</p><pre>SELECT Students.Name, Marks.Marks<br>FROM Students<br>JOIN Marks<br>ON Students.ID = Marks.ID;</pre><p>And suddenly we can get:</p><p>NameMarksRahul85Priya92</p><p>At first, JOIN looked complicated.</p><p>Later, I realized that the basic idea is simply:</p><blockquote><strong><em>“Take related information from two tables and bring it together.”</em></strong></blockquote><h3>What confused me the most</h3><p>The biggest mistake I made was trying to memorize SQL syntax without understanding the logic.</p><p>For example, I could memorize:</p><pre>SELECT column<br>FROM table<br>WHERE condition;</pre><p>But if I didn’t understand what each part was doing, I would get confused as soon as the question changed.</p><p>So I started thinking about SQL queries as questions.</p><p>Instead of thinking:</p><blockquote><em>“What syntax should I write?”</em></blockquote><p>I started thinking:</p><blockquote><em>“What exactly am I asking the database?”</em></blockquote><p>For example:</p><p><strong>Question:</strong></p><blockquote><em>Show the names of students who scored more than 80.</em></blockquote><p>Then break it down:</p><pre>What do I need?<br>→ Name</pre><pre>Where is it?<br>→ Students table</pre><pre>Which students?<br>→ Marks &gt; 80</pre><p>Then the query becomes:</p><pre>SELECT Name<br>FROM Students<br>WHERE Marks &gt; 80;</pre><p>This way of thinking made SQL much easier.</p><h3>What I’m learning next</h3><p>After understanding the basics, I started moving toward more interesting SQL concepts:</p><ul><li>Aggregate functions</li><li>Different types of JOINs</li><li>Subqueries</li><li>CTEs</li><li>Window functions</li><li>Real-world SQL problems</li><li>Interview questions</li></ul><p>And I’m still learning.</p><p>That’s actually the reason I wanted to write this article.</p><p>I’m not writing this as someone who already knows everything about SQL.</p><p>I’m writing this as someone <strong>learning SQL and documenting what I discover along the way.</strong></p><p>If you’re also starting SQL, hopefully this gives you a simpler starting point.</p><h3>Final Thought</h3><p>If you’re a beginner, don’t let words like JOIN, CTE, or WINDOW FUNCTION scare you.</p><p>You don’t need to learn everything at once.</p><p>Start with:</p><pre>SELECT<br>   ↓<br>FROM<br>   ↓<br>WHERE<br>   ↓<br>ORDER BY<br>   ↓<br>GROUP BY<br>   ↓<br>JOIN</pre><p>Understand what each one actually does.</p><p>Then start solving small problems.</p><p>Eventually, SQL stops looking like a collection of confusing commands and starts feeling more like <strong>asking questions to your data.</strong></p><p>And that’s when it starts getting fun.</p><p><strong>This is just the beginning of my SQL learning journey.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46fc72075782" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>