<?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 Nishara Samanthilake on Medium]]></title>
        <description><![CDATA[Stories by Nishara Samanthilake on Medium]]></description>
        <link>https://medium.com/@nisharathilakshi4?source=rss-27baff33cadc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Mjp7L9Ci-c22ILs8z8Itgg.png</url>
            <title>Stories by Nishara Samanthilake on Medium</title>
            <link>https://medium.com/@nisharathilakshi4?source=rss-27baff33cadc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:47:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nisharathilakshi4/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[AI Can Write SQL. So Why Am I Still Learning It?]]></title>
            <link>https://medium.com/@nisharathilakshi4/ai-can-write-sql-so-why-am-i-still-learning-it-e3c8cd450555?source=rss-27baff33cadc------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3c8cd450555</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Nishara Samanthilake]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 07:18:51 GMT</pubDate>
            <atom:updated>2026-08-18T07:18:51.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i8OcfbCJVWeUlnEEP0NELw.png" /></figure><h4>How SQL powers data analytics, data engineering and AI ready data</h4><p>When I decided to improve my SQL skills one question kept coming into my mind:</p><blockquote>If AI can already write SQL queries is learning SQL still worth my time?</blockquote><p>Today we can describe what we need in normal English and ask an AI tool to generate a query.</p><p>For example:</p><blockquote>“Show me the top five customers based on their total completed order value.”</blockquote><p>An AI assistant may immediately produce something like this:</p><pre>SELECT <br>    customer_id, <br>    SUM(order_amount) AS total_spent <br>FROM orders <br>WHERE order_status = &#39;Completed&#39; <br>GROUP BY customer_id <br>ORDER BY total_spent DESC <br>LIMIT 5;</pre><p>That looks impressive.</p><p>Google’s Gemini in BigQuery can already generate SQL using natural language prompts and information from a database schema. It can also explain existing SQL queries and suggest code for data analysis.</p><p>So why should a beginner spend weeks learning SELECT, WHERE, JOIN, GROUP BY and window functions?</p><p>After thinking about it I realised something important:</p><blockquote>I am not learning SQL because AI cannot write it. I am learning SQL because I need to know whether the answer is correct.</blockquote><h4>SQL Is More Than Writing Commands</h4><p>When we first start learning SQL it can look like a collection of commands that we need to memorise.</p><pre>SELECT<br>FROM<br>WHERE<br>GROUP BY<br>ORDER BY</pre><p>However SQL is not mainly about remembering syntax. It is about learning how to turn a real business question into a clear data question.</p><p>Consider this request:</p><blockquote>“Show me our best customers.”</blockquote><p>It sounds simple but what does <strong>best</strong> mean?</p><p>Does it mean:</p><ul><li>Customers who spent the most money?</li><li>Customers who placed the most orders?</li><li>Customers who bought something recently?</li><li>Customers who generated the highest profit?</li><li>Customers who returned the fewest products?</li></ul><p>Before writing any SQL someone must understand what the business actually wants. AI can generate a query but it cannot safely decide what “best customer” means without enough context. That is where human understanding becomes important.</p><h4>Where SQL Sits in the Modern Data World</h4><p><strong>Raw data does not normally arrive ready for a dashboard or an AI model.</strong></p><p>It may contain:</p><ul><li>Missing values</li><li>Repeated records</li><li>Incorrect dates</li><li>Different naming formats</li><li>Cancelled transactions</li><li>Test accounts</li><li>Information stored across several tables</li></ul><p>SQL helps turn this messy data into something useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MuJ_DAHifoL4_Z0gd82cKA.png" /><figcaption>Where SQL Sits in the Modern Data World</figcaption></figure><p>This is one reason SQL continues to be important.</p><p>Modern data platforms still use SQL as a major part of analytics and data engineering. Databricks supports SQL for querying, data engineering, business intelligence, dashboards and AI assisted development. Its SQL editor can also be used to write queries and create visualisations.</p><p>dbt also uses data transformations to turn raw information into reliable data products that can support analytics, business operations and AI systems.</p><h4>How Data Analysts Use SQL</h4><p>A data analyst usually starts with a business question.</p><p>For example:</p><ul><li>Which product generated the most revenue?</li><li>Why did sales decrease last month?</li><li>Which customers have stopped purchasing?</li><li>Which branch is performing the best?</li><li>How many orders were cancelled?</li></ul><p>The analyst then uses SQL to find, combine and summarise the required data.</p><p>Imagine that we have an orders table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kaZMvKqcOZxUV2qBRr4ydQ.png" /></figure><p>To calculate completed revenue we could write:</p><pre>SELECT<br>    SUM(amount) AS completed_revenue<br>FROM orders<br>WHERE order_status = &#39;Completed&#39;;</pre><p>The important part is not only knowing how to use SUM. The analyst must also know that cancelled orders should not be included. A query could run successfully while still producing the wrong total.</p><p>For example:</p><pre>SELECT<br>    SUM(amount) AS revenue<br>FROM orders;</pre><p>This query is valid SQL. But it includes completed, cancelled, refunded and possibly test orders. The database may not show an error. The final number may look believable. It can still be wrong.</p><blockquote>A successful query is not always a correct business answer.</blockquote><h4>How Data Engineers Use SQL</h4><p>Data engineers often work before the analyst creates a report. Their job includes moving, cleaning, organising and preparing data so that other people can use it reliably.</p><p>For example raw customer orders may be stored across several systems:</p><ul><li>Website Orders</li><li>Mobile App Orders</li><li>Store Purchases</li><li>Payment System</li><li>Delivery System</li></ul><p>A data engineer may need to combine these sources into one trusted order table.</p><p>They may use SQL to:</p><ul><li>Remove duplicate records</li><li>Standardise customer information</li><li>Join data from multiple systems</li><li>Create summary tables</li><li>Apply business rules</li><li>Check for missing data</li><li>Prepare data for dashboards</li><li>Prepare training data for machine-learning models</li></ul><p>Here is a simple transformation:</p><pre>SELECT<br>    customer_id,<br>    COUNT(order_id) AS completed_orders,<br>    SUM(order_amount) AS lifetime_value<br>FROM orders<br>WHERE order_status = &#39;Completed&#39;<br>GROUP BY customer_id;</pre><p>This could become a customer summary table used by several teams. A data analyst may use it in a dashboard. A marketing team may use it to identify loyal customers. A machine learning model may use it as an input. One SQL transformation can therefore support many different outputs.</p><h4>SQL Is Also Moving Closer to AI</h4><p>SQL is not only being used to prepare data for AI. Some modern platforms allow people to work with machine learning and generative AI directly through SQL.</p><p>BigQuery ML for example allows users to create and run machine learning models using GoogleSQL. BigQuery also provides AI features for tasks involving structured and unstructured data.</p><p>Microsoft also documents natural language to SQL workflows in which an AI model converts a user’s question into a SQL query for a PostgreSQL database.</p><p>This means SQL is not simply an old database language that AI will remove. Instead SQL is becoming one of the ways people connect databases, analytics systems and AI applications.</p><h4>Let’s Test AI Generated SQL</h4><p>Imagine that a manager asks:</p><blockquote>“Who are our top five customers?”</blockquote><p>We provide the following information to an AI assistant:</p><pre>Table: orders<br><br>Columns:<br>- order_id <br>- customer_id <br>- order_amount <br>- order_status <br>- order_date</pre><p>The AI generates:</p><pre>SELECT <br>    customer_id, <br>    SUM(order_amount) AS total_spent <br>FROM orders <br>GROUP BY customer_id <br>ORDER BY total_spent DESC <br>LIMIT 5;</pre><p>At first the query looks correct. But let us review it properly.</p><p><strong>Problem 1: It includes cancelled orders</strong></p><p>The query does not filter order_status.</p><p>A customer with a large cancelled order could incorrectly appear as one of the best customers.</p><p>A safer version may be:</p><pre>SELECT <br>    customer_id, <br>    SUM(order_amount) AS total_spent <br>FROM orders <br>WHERE order_status = &#39;Completed&#39; <br>GROUP BY customer_id <br>ORDER BY total_spent DESC <br>LIMIT 5;</pre><p><strong>Problem 2: It does not define a time period</strong></p><p>Did the manager mean:</p><ul><li>Top customers of all time?</li><li>Top customers this year?</li><li>Top customers this month?</li><li>Top customers during the latest campaign?</li></ul><p>For the current year we may need an additional condition:</p><pre>SELECT <br>    customer_id, <br>    SUM(order_amount) AS total_spent <br>FROM orders <br>WHERE order_status = &#39;Completed&#39; <br>  AND order_date &gt;= &#39;2026-01-01&#39; <br>GROUP BY customer_id <br>ORDER BY total_spent DESC <br>LIMIT 5;</pre><p><strong>Problem 3: Customer names are missing</strong></p><p>The manager may not want to see customer IDs.</p><p>We may need to join the customers table:</p><pre>SELECT<br>    c.customer_id,<br>    c.customer_name,<br>    SUM(o.order_amount) AS total_spent<br>FROM customers AS c<br>JOIN orders AS o<br>    ON c.customer_id = o.customer_id<br>WHERE o.order_status = &#39;Completed&#39;<br>  AND o.order_date &gt;= &#39;2026-01-01&#39;<br>GROUP BY<br>    c.customer_id,<br>    c.customer_name<br>ORDER BY total_spent DESC<br>LIMIT 5;</pre><p>AI gave us a useful starting point.</p><p>But SQL knowledge helped us ask better questions and improve the result.</p><h4>The Most Dangerous SQL Mistakes May Look Normal</h4><p>Some SQL errors are easy to notice. The query does not run and the database shows an error message. Those mistakes are often easier to fix.</p><p>The more dangerous mistakes happen when the query runs and returns a professional looking result.</p><p><strong>A wrong join can multiply the data</strong></p><p>Imagine that one customer has three orders and two saved addresses. If we join orders and addresses incorrectly the three orders may appear twice.</p><pre>3 orders × 2 addresses = 6 rows</pre><p>If we calculate revenue after this join the customer’s revenue could be doubled. The query may still run successfully.</p><p><strong>The wrong date can change the answer</strong></p><p>A table may include:</p><pre>order_created_date <br>payment_date <br>delivery_date <br>refund_date</pre><p>When someone asks for “June sales” which date should we use? AI may select a date column based on its name. A data professional must select it based on the business meaning.</p><p><strong>NULL values can hide information</strong></p><p>Suppose we write:</p><pre>SELECT *<br>FROM customers<br>WHERE country &lt;&gt; &#39;Sri Lanka&#39;;</pre><p>Rows where the country is NULL may not appear in the result. The query may need to handle missing values separately.</p><p>Understanding these behaviours is why learning SQL still matters.</p><h4>What Should AI Do, and What Should the Human Do?</h4><p>I do not believe the answer is to avoid AI. AI can make learning and working with SQL much faster.</p><p>It can help us:</p><ul><li>Create a first version of a query</li><li>Explain unfamiliar SQL</li><li>Find syntax errors</li><li>Suggest cleaner formatting</li><li>Create practice questions</li><li>Add comments and documentation</li><li>Compare two possible solutions</li></ul><p>However the human should still be responsible for:</p><ul><li>Understanding the business question</li><li>Selecting the correct tables</li><li>Checking relationships between tables</li><li>Confirming filters and date ranges</li><li>Testing totals</li><li>Protecting sensitive data</li><li>Deciding whether the answer makes sense</li></ul><p>A responsible workflow looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lyLfZ4kCQEOA-zkZaNG4mw.png" /><figcaption>How I Use AI While Learning SQL</figcaption></figure><p>The strongest data professionals may not be the people who write every line without assistance.</p><p>They may be the people who know:</p><blockquote>What to ask, what to check and when not to trust the first answer.</blockquote><h4>How I Plan to Learn SQL With AI</h4><p>As a beginner I do not want AI to complete every exercise for me. If I copy a query without understanding it I may finish the question but I will not develop the skill.</p><p>Instead I plan to use this process:</p><p><strong>Step 1: Try the question myself</strong></p><p>I will first read the problem and write my own query. Even when it is wrong the attempt helps me understand where I am struggling.</p><p><strong>Step 2: Run and investigate the error</strong></p><p>I will read the error message and try to correct it before asking AI.</p><p><strong>Step 3: Ask AI for a hint</strong></p><p>Instead of immediately asking for the final answer I can ask:</p><blockquote>“Do not give me the full query. Tell me which part of my logic is wrong.”</blockquote><p><strong>Step 4: Compare both solutions</strong></p><p>After solving the question I can ask AI to show another method. For example one question may be solved using a subquery, a Common Table Expression or a window function.</p><p><strong>Step 5: Explain the query myself</strong></p><p>I should be able to describe each part in simple English.</p><p>For example:</p><pre>SELECT department, AVG(salary)<br>FROM employees<br>GROUP BY department;</pre><p>My explanation should be:</p><blockquote>“This query puts employees into department groups and calculates the average salary for each department.”</blockquote><p>If I cannot explain the query I probably do not understand it properly yet.</p><h4>My Four Week SQL Learning Roadmap</h4><p>I am starting with a simple four week plan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wq_1ItcIqJu8EBRbagUwoA.png" /><figcaption>Simple Four Week SQL Learning Roadmap</figcaption></figure><p>My goal is not to become an expert in four weeks. My goal is to build a strong enough foundation to look at a business question and know how to begin solving it.</p><h4>So Is Learning SQL Still Worth It?</h4><p>Yes. But the reason for learning it has changed.</p><p>In the past knowing SQL may have mainly meant being able to write queries manually.</p><p>In the AI era SQL knowledge also means being able to:</p><ul><li>Give AI better instructions</li><li>Understand the query it creates</li><li>Catch incorrect assumptions</li><li>Validate results</li><li>Protect data quality</li><li>Connect business questions with technical logic</li></ul><p>AI may reduce the time required to write a query. It does not remove the need to understand the data.</p><p>A calculator can perform arithmetic but we still need to know which numbers to enter and what the answer means.</p><p>AI generated SQL works in a similar way.</p><blockquote>The future may not belong to people who compete against AI to type SQL faster.</blockquote><blockquote>It may belong to people who can use AI, understand data and recognise when a technically valid answer is logically wrong.</blockquote><p>That is why I am still learning SQL.</p><p>Not because AI cannot write it.</p><p>Because I want to understand what happens after it does.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3c8cd450555" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Put Your Money on ESG!]]></title>
            <link>https://medium.com/@nisharathilakshi4/put-your-money-on-esg-f5ef8dcd8f22?source=rss-27baff33cadc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5ef8dcd8f22</guid>
            <dc:creator><![CDATA[Nishara Samanthilake]]></dc:creator>
            <pubDate>Wed, 02 Aug 2023 16:37:52 GMT</pubDate>
            <atom:updated>2023-08-02T16:55:13.181Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d52cp-NhXUVnJGgDpptUqw.jpeg" /></figure><p>In the rapidly changing landscape of investments and finance, there’s a new buzzword that is gaining momentum and transforming the way we evaluate companies — <strong>ESG</strong>.</p><p><strong>But what exactly is ESG?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/172/1*XZF6yuvYQyJC2GPZoIdNTA.png" /></figure><p><strong>Environmental, Social, and Governance, or ESG</strong>, extends beyond a company’s financial components. It depicts the long-term and ethical consequences of a corporation’s financial objectives. While profitability is still important, ESG criteria evaluate a company’s accountability and attempts to have a <strong>beneficial impact</strong> on the environment, society, and governance practises.</p><p>In this article, we will explore each aspect of ESG and understand why CEOs are increasingly prioritising sustainability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*Fnewt-N2sqXS5_dDsKC3tA.png" /></figure><p>The recent Gartner CEO and Senior Business Executive Survey demonstrates the shifting tides of corporate priorities. For the first time in the survey’s history, environmental sustainability has made the<strong> top ten list of CEO priorities</strong>. Climate change, resource depletion, and social inequity are all important challenges that the world is waking up to. As CEOs recognise the importance of ESG initiatives, they are seeing the pull it has on investors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k02IKrx-XinnXUoSMfrNdw.png" /><figcaption><em>Source: Gartner (November 2022)</em></figcaption></figure><p>Adopting ESG practises not only aligns with ethical beliefs, but it also attracts responsible investors looking to put their money where it matters.</p><p>So, let’s delve into each principle of ESG and understand how it drives companies towards sustainability and ethical investments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/1*ubDUIjBc1hW7vcKZllFdbA.png" /></figure><p><strong>Environmental Considerations</strong></p><p>Starting with the “E” in ESG, which stands for <strong>“Environmental,”</strong> we look at how businesses are actively thinking about how to conserve our treasured <strong>natural resources</strong>. Climate change, carbon emission reduction, biodiversity conservation, water pollution, waste management, and greenhouse gas emissions are just a few of the essential environmental problems that are being addressed. Businesses that embrace sustainable practises help to shape a <strong>greener and cleaner planet</strong> for future generations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CvTMgw3Y5iBCob4XAyqrfA.png" /></figure><p><strong>Social Considerations</strong></p><p>Moving on to the “S” in ESG, we’ll look at the <strong>“Social”</strong> aspects. This component concerns how a corporation handles its employees both within and outside of its boundaries. It includes critical elements like as community relations, customer satisfaction, employee diversity, equity, and inclusion. Companies contribute to the establishment of a more just and <strong>equitable society</strong> by advocating strong <strong>human rights and labour</strong> <strong>standards</strong>, as well as aiding communities that are underprivileged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XiyGcwQjmAJBEi2O7nt70w.png" /></figure><p><strong>Governance Considerations</strong></p><p>Finally, the letter “G” in ESG stands for <strong>“Governance.”</strong> Governance considerations investigate how an <strong>organisation policies</strong> itself, with a focus on <strong>internal system controls and compliance practises</strong>. Company leadership, board composition (including diversity and structure), whistleblower programmes, executive remuneration and policies, tax strategy (including audit committee structure), internal controls and regulatory policies, donations, and political lobbying are a few examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o15nuBiTT3rriwCTMokg3A.png" /></figure><p>Embracing ESG principles is more than a passing fad or a marketing ploy; it represents a paradigm shift in how we approach business and investments. Companies that <strong>prioritise sustainability and ethical practises</strong> help society and the environment while also gaining the trust and investment of conscientious stakeholders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*FruYIHfffjHhKzR9iBq32g.png" /></figure><p>In conclusion, ESG is more than just a buzzword; it is a <strong>powerful force</strong> driving positive change in the corporate sector. By investing in ESG, you not only help to make the world a better place, but you also stand to benefit from the potential future of responsible investing. As investors and consumers, let us advocate the cause of ESG and encourage businesses to do their part to create a more sustainable and fair society for all. The time has come to embrace ESG!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5ef8dcd8f22" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>