<?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 Sakthivignesh.C on Medium]]></title>
        <description><![CDATA[Stories by Sakthivignesh.C on Medium]]></description>
        <link>https://medium.com/@sakthivigneshc?source=rss-4574a14ec9d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LDtiPJMIPsZx6WNwyBDGDA.png</url>
            <title>Stories by Sakthivignesh.C on Medium</title>
            <link>https://medium.com/@sakthivigneshc?source=rss-4574a14ec9d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 13:45:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sakthivigneshc/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[Weather Observation Station 4]]></title>
            <link>https://medium.com/@sakthivigneshc/weather-observation-station-4-bcda4099226f?source=rss-4574a14ec9d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcda4099226f</guid>
            <category><![CDATA[hackerrank]]></category>
            <category><![CDATA[sakthivigneshc]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[sqlhackerrankeasylevel]]></category>
            <dc:creator><![CDATA[Sakthivignesh.C]]></dc:creator>
            <pubDate>Sat, 15 Feb 2025 18:18:57 GMT</pubDate>
            <atom:updated>2025-02-24T19:09:40.784Z</atom:updated>
            <content:encoded><![CDATA[<p>Weather Observation Station 4</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*4m26Q1snghqPE61f.png" /></figure><p><strong>Question :</strong><br>Find the difference between the total number of <strong>CITY</strong> entries in the table and the number of distinct <strong>CITY</strong> entries in the table.<br>The <strong>STATION</strong> table is described as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*3xdZxTJ4spOtHhnH.jpg" /></figure><p>Image src : HackerRank<br><a href="https://www.hackerrank.com/challenges/weather-observation-station-4/problem?isFullScreen=true">This problem link</a></p><p><strong>Solution :</strong></p><pre>SELECT COUNT(CITY) - COUNT(DISTINCT CITY) FROM STATION;</pre><p><strong>Explanation :<br>SELECT</strong> is used to retrieve data from a database.</p><p>Why use <strong>count</strong> here 🤔? because as stated in the question need to get the total number of cities count so count() used here.</p><p>Why use <strong>distinct</strong> here 🤔? as stated in the question need to get distinct values(distinct means exclude duplicates).We need to get the distinct count value so using the <strong>count</strong> again.</p><p>To get the difference we use subtraction (may know already to give a full explanation mentioning 😂)</p><p><strong>FROM</strong> specifies the table from which we are selecting the data. In this case it’s the STATION table.</p><p>📌 If you found this insightful, Don’t forget to click the <strong>follow</strong> button for more such SQL HackerRank solutions explanations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcda4099226f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Weather Observation Station 3  — Solution Explanations]]></title>
            <link>https://medium.com/@sakthivigneshc/weather-observation-station-3-solution-explanations-add57bfe7d3f?source=rss-4574a14ec9d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/add57bfe7d3f</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[hackerrank-solutions-sql]]></category>
            <category><![CDATA[sqlconcepts]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[hackerrank]]></category>
            <dc:creator><![CDATA[Sakthivignesh.C]]></dc:creator>
            <pubDate>Sat, 05 Oct 2024 15:52:32 GMT</pubDate>
            <atom:updated>2024-10-05T15:53:02.978Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Weather Observation Station 3</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*8caaIqK81TGEmb53ic-N2g.png" /></figure><p><strong>Question :<br></strong>Query a list of CITY names from STATION for cities that have an even ID number. Print the results in any order, but exclude duplicates from the answer.<br>The STATION table is described as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*iebb74KrlWP0xx7O.jpg" /></figure><p>Image src : HackerRank</p><p><a href="https://www.hackerrank.com/challenges/weather-observation-station-3/problem">This problem link</a></p><p><strong>Solution :</strong></p><pre>SELECT DISTINCT CITY FROM STATION WHERE ID%2=0;</pre><p><strong>Explanation :</strong></p><p><strong>SELECT</strong> is used to retrieve data from a database.</p><p>Why we are using <strong>DISTINCT</strong> ? 🤔 because as stated in the question we need to exclude duplicates so we need to use Distinct.</p><p>Why we are using <strong>CITY</strong> column only ? 🤔 because as stated in the question CITY names only so we need to use CITY column only.</p><p><strong>FROM</strong> specifies the table from which we are selecting the data. In this case it’s the STATION table.</p><p><strong>WHERE</strong> is used to filter the records. Here we are filtering the records where the ID is an even number.(Even — remainder when ID is divided by 2 is zero)</p><p><strong>Explanation of ID%2=0 </strong><br> This checks whether the ID is an even number<br> <strong>For Example :</strong><br> If <strong>ID</strong> is 2, 2 % 2 equals 0, so it returns the row datas with the ID 2. <br> If <strong>ID</strong> is 3, 3 % 2 is not equal to 0, so it will not return that row.</p><p>📌 If you found this insightful, Don’t forget to click the <strong>follow</strong> button for more such SQL HackerRank solutions explanations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=add57bfe7d3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Japanese Cities’ Attributes  — Solution Explanations]]></title>
            <link>https://medium.com/@sakthivigneshc/japanese-cities-attributes-solution-explanation-19a9f526e6eb?source=rss-4574a14ec9d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/19a9f526e6eb</guid>
            <category><![CDATA[hackerank]]></category>
            <category><![CDATA[hackerrank-solutions-sql]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[medium]]></category>
            <dc:creator><![CDATA[Sakthivignesh.C]]></dc:creator>
            <pubDate>Sat, 21 Sep 2024 13:25:41 GMT</pubDate>
            <atom:updated>2024-09-21T13:31:46.762Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackerRank Easy level problem</h3><p>Japanese Cities’ Attributes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*8caaIqK81TGEmb53ic-N2g.png" /></figure><p><strong>Question :</strong></p><p>Query all columns (attributes) for every row in the CITY table. The COUNTRYCODE for Japan is JPN.</p><p>The <strong>CITY</strong> table is described as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/0*TtSYol5a_hKno5RT.jpg" /></figure><p>Image src : HackerRank</p><p><a href="https://www.hackerrank.com/challenges/japanese-cities-attributes/problem?isFullScreen=true">This problem link</a></p><p><strong>Solution</strong></p><pre>SELECT * FROM CITY WHERE COUNTRYCODE=&#39;JPN&#39;;</pre><p>Explanation :</p><p><strong>SELECT</strong> is used to retrieve data from a database.<br> why we using <strong>*</strong> 🤔 Because in this case(in the question ) all columns needed so we need to use * <br> 💡If a specific column specified we should use that column instead of *</p><p><strong>FROM</strong> specifies the table from which we are selecting the data. In this case it’s the CITY table.</p><p><strong>WHERE</strong> is used to filter records. Here we are filtering the data based on the countrycode for Japan so we using COUNTRYCODE=’JPN’</p><p>📌 If you found this insightful, Don’t forget to hit the <strong>follow</strong> button for more such SQL HackerRank solutions with explanations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19a9f526e6eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackerRank Easy level problem]]></title>
            <link>https://medium.com/@sakthivigneshc/hackerrank-easy-level-problem-a77b15c38355?source=rss-4574a14ec9d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a77b15c38355</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[hackerrank]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[hackerrank-solutions-sql]]></category>
            <dc:creator><![CDATA[Sakthivignesh.C]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 19:18:14 GMT</pubDate>
            <atom:updated>2024-09-10T19:18:14.984Z</atom:updated>
            <content:encoded><![CDATA[<h4>Revising the Select Query I</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*8caaIqK81TGEmb53ic-N2g.png" /></figure><p><strong>Question</strong> <strong>:</strong></p><p>Query all columns for all American cities in the <strong>CITY</strong> table with populations larger than 100000. The <strong>CountryCode</strong> for America is USA.</p><p>The <strong>CITY</strong> table is described as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/0*WRj_fe6UYDHb9FLf.jpg" /></figure><p>Image src : HackerRank</p><p><a href="https://www.hackerrank.com/challenges/revising-the-select-query/problem?isFullScreen=true">This problem Link</a></p><p><strong>Solution</strong></p><pre>SELECT * FROM City WHERE Population &gt; 100000 AND  CountryCode =&#39;USA&#39;;</pre><p><strong>Explanation:</strong></p><p><strong>SELECT</strong> is used to retrieve data from a database.<br> <strong>*</strong> means all columns from the table will be retrieved.</p><p><strong>FROM</strong> specifies the table from which we need to select the data. In this case the <strong>City</strong> table.</p><p><strong>WHERE</strong> is used to filter records. Here we are filtering cities where<br><strong>Population &gt; 100000 </strong>(cities with populations greater than 100000).<br><strong>CountryCode = ‘USA</strong>’ (cities located in the USA).</p><p><strong>AND</strong> is used to combine multiple conditions . Here we combined <strong>Population &gt; 100000 AND CountryCode = ‘USA</strong>’ . This two conditions must be true for the record to be included in the result.</p><p>📌 If you found this insightful, Don’t forget to hit the <strong>follow</strong> button for more such SQL HackerRank solutions explanations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a77b15c38355" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>