<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lucy Joan</title>
    <description>The latest articles on DEV Community by Lucy Joan (@lucy_joan_b56ae069a2a9f17).</description>
    <link>https://dev.to/lucy_joan_b56ae069a2a9f17</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2988400%2Fb69cd5e8-006f-4472-a047-f54240723c50.png</url>
      <title>DEV Community: Lucy Joan</title>
      <link>https://dev.to/lucy_joan_b56ae069a2a9f17</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lucy_joan_b56ae069a2a9f17"/>
    <language>en</language>
    <item>
      <title>Unlocking the Full Potential of AI-Powered ERP Systems</title>
      <dc:creator>Lucy Joan</dc:creator>
      <pubDate>Thu, 23 Jul 2026 11:42:59 +0000</pubDate>
      <link>https://dev.to/lucy_joan_b56ae069a2a9f17/unlocking-the-full-potential-of-ai-powered-erp-systems-gph</link>
      <guid>https://dev.to/lucy_joan_b56ae069a2a9f17/unlocking-the-full-potential-of-ai-powered-erp-systems-gph</guid>
      <description>&lt;p&gt;The finance function has continually evolved alongside technological innovation, from manual bookkeeping to spreadsheets, and from standalone accounting software to Enterprise Resource Planning (ERP) systems. &lt;/p&gt;

&lt;p&gt;This technological advancement has transformed how financial information is recorded, processed, analyzed, and reported. Today, the finance profession is undergoing another significant transformation as Artificial Intelligence (AI) becomes an integral component of modern ERP systems. &lt;/p&gt;

&lt;p&gt;AI technologies such as machine learning (ML), natural language processing and predictive analytics are integrated into ERP systems. These AI-powered systems can automate routine tasks, provide advanced data analysis and forecasting, and enhance decision-making so as to improve operational efficiency and streamline business processes&lt;a href="https://www.ibm.com/think/topics/ai-in-erp" rel="noopener noreferrer"&gt;(Hayes &amp;amp; Downie, 2024)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;What This Article Covers:&lt;u&gt;&lt;/u&gt;&lt;/u&gt;&lt;/p&gt;
&lt;u&gt;&lt;u&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The Evolution of ERP Systems: From Automation to Intelligence&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prompt Engineering: The Language of AI-Powered ERP Systems&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Practical Applications of Prompt Engineering Across the Finance Function&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Best Practices for Prompt Engineering in Finance&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When Good AI Produces Poor Results: Common Prompting Mistakes in Finance&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Governance, Ethics, and Human Oversight: Building Trust in AI-Powered Finance&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Future of Prompt Engineering in Finance&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Industry Perspectives: Why Prompt Engineering Matters&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conclusion&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/u&gt;&lt;/u&gt;&lt;p&gt;&lt;a id="Level1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Evolution of ERP Systems: From Automation to Intelligence
&lt;/h3&gt;

&lt;p&gt;Every month, finance teams spend considerable time preparing management reports, reconciling accounts, investigating variances, monitoring budgets, and providing decision support to management. Many of these activities can now be accelerated by AI embedded within ERP systems. &lt;/p&gt;

&lt;p&gt;However, despite these capabilities, many organizations have yet to realize the full value of AI-powered ERP solutions. The challenge is no longer access to AI; rather, it is the ability to use AI effectively.&lt;/p&gt;

&lt;p&gt;ERP systems have been at the heart of organizational operations for more than three decades. Originally they were developed to integrate business processes across departments such as finance, procurement, inventory, manufacturing, human resources, and sales.&lt;/p&gt;

&lt;p&gt;Their primary role was to standardize business processes, improve data accuracy, and automate routine transactions, enabling organizations to operate more efficiently.&lt;/p&gt;

&lt;p&gt;For finance professionals, ERP systems fundamentally transformed the accounting functions such as manual journal entries, spreadsheet-based reconciliations, fragmented reporting, and disconnected financial records gradually gave way to integrated financial management. &lt;/p&gt;

&lt;p&gt;Month-end closing became more structured, financial reports could be generated in real time, and regulatory compliance became easier through standardized workflows and centralized data management.&lt;/p&gt;

&lt;p&gt;The next phase in ERP evolution was emergence of cloud computing. Cloud-based ERP platforms provided organizations with greater scalability, real-time collaboration, automatic updates, and improved accessibility. &lt;/p&gt;

&lt;p&gt;Finance teams could access financial information from anywhere, integrate data across multiple business units, and leverage dashboards that offered greater visibility into organizational performance. &lt;/p&gt;

&lt;p&gt;Today, the integration of Artificial Intelligence represents the most significant advancement in ERP technology since its inception. Rather than functioning solely as systems for recording and retrieving information, AI-powered ERP platforms actively assist users by interpreting data, identifying patterns, generating insights, and supporting decision-making. &lt;/p&gt;

&lt;p&gt;Embedded AI assistants can summarize financial reports, explain unusual transactions, recommend corrective actions, forecast future performance, automate repetitive tasks, and even generate narrative reports using natural language.&lt;/p&gt;

&lt;p&gt;The progression from transaction processing to intelligent decision support reflects a broader shift in the role of ERP systems. They are no longer limited to storing organizational data; they are increasingly capable of transforming that data into meaningful knowledge. &lt;/p&gt;

&lt;p&gt;&lt;a id="Level2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Prompt Engineering: The Language of AI-Powered ERP Systems
&lt;/h3&gt;

&lt;p&gt;While these interfaces remain important, AI introduces a more intuitive way of working natural language. &lt;strong&gt;Natural language&lt;/strong&gt; interaction enables users to communicate with ERP systems in much the same way they would engage with a colleague.&lt;/p&gt;

&lt;p&gt;AI does not possess an inherent understanding of an organization's financial policies, reporting objectives, industry-specific requirements, or management expectations. Its responses are shaped by the instructions it receives. A vague request is likely to produce a generic response&lt;/p&gt;

&lt;p&gt;This practice of designing effective instructions is known as &lt;strong&gt;prompt engineering&lt;/strong&gt;. According to &lt;a href="https://www.deloitte.com/us/en/services/consulting/articles/prompt-engineering-for-finance.html" rel="noopener noreferrer"&gt;Glover and Peters (2025)&lt;/a&gt;, Prompt engineering is the process of designing and refining everyday language text/voice prompts for use in Large Language Models. &lt;/p&gt;

&lt;p&gt;In the context of AI-powered ERP systems, prompt engineering enables finance professionals to transform business questions into structured instructions that AI can interpret effectively.&lt;/p&gt;

&lt;p&gt;An effective finance prompt is more than a simple question. It provides sufficient context for the AI to understand the business problem, the financial objective, the reporting period, and the expected format of the response. Consider the difference between the following prompts:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prompt 1&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Analyze this financial report.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Prompt 2&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Analyze the attached income statement for the second quarter of 2026. Compare actual results against budget, identify all expense variances exceeding Z%, explain the possible business drivers, calculate the gross and operating profit margins, and present your findings in a concise executive summary for senior management.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second prompt is significantly more effective because it defines the reporting period, specifies the analytical tasks, provides the business context, and clearly states the desired output. &lt;/p&gt;

&lt;p&gt;By reducing ambiguity, it enables AI to generate responses that are more relevant and aligned with the user's needs.&lt;/p&gt;

&lt;p&gt;&lt;a id="Level3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Practical Applications of Prompt Engineering Across the Finance Function
&lt;/h3&gt;

&lt;p&gt;The following examples illustrate how prompt engineering can be applied across key finance functions.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Financial Reporting and Management Reporting
&lt;/h4&gt;

&lt;p&gt;Preparing financial reports often involves consolidating information from multiple sources, analyzing performance, and communicating findings to management. AI-powered ERP systems can assist by summarizing financial statements, explaining significant movements, and drafting management reports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Analyze the June 2026 Income Statement and Balance Sheet. Compare actual performance against budget, identify all material variances exceeding X%, explain the possible business drivers, and prepare a one-page executive summary for the Board of Directors. Present the findings in a table showing the variance, financial impact, and recommended management action.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  2. Budgeting and Forecasting
&lt;/h4&gt;

&lt;p&gt;Budget preparation and forecasting require finance professionals to evaluate historical trends, consider business assumptions, and assess future scenarios. AI can accelerate this process by analyzing historical performance and modelling different business outcomes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Using the last three years of revenue and expenditure data, prepare a cash flow forecast for the next six months under optimistic, expected, and pessimistic business scenarios. Clearly explain the assumptions used for each scenario and highlight potential liquidity risks.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  3. Variance Analysis
&lt;/h4&gt;

&lt;p&gt;Variance analysis is essential for monitoring financial performance and identifying operational issues. Rather than manually reviewing numerous reports, finance professionals can use AI to explain the underlying causes of significant deviations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Review the Budget versus Actual Report for the second quarter of 2026. Identify all revenue and expense variances greater than Y%, categorize them as operational or strategic, explain the likely causes, assess their financial impact, and recommend corrective actions.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  4. Internal Audit and Risk Management
&lt;/h4&gt;

&lt;p&gt;Internal auditors spend significant time reviewing transactions, identifying anomalies, and assessing compliance with internal controls. AI-powered ERP systems can assist by rapidly analyzing transaction data and highlighting unusual patterns that warrant further investigation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Review all journal entries posted outside normal business hours during the month-end closing process. Identify unusual transactions based on value, timing, account combinations, and user activity. Rank each exception according to its potential audit risk and explain why it requires further investigation.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  5. Cash Flow and Treasury Management
&lt;/h4&gt;

&lt;p&gt;Effective cash flow management is critical to maintaining organizational liquidity. AI can analyze historical payment behaviour, forecast cash inflows and outflows, and identify potential liquidity constraints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Analyze the organization's projected cash inflows and outflows over the next 90 days. Identify periods where liquidity may fall below the minimum operating threshold, explain the underlying causes, and recommend practical strategies to improve cash availability.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  6. Compliance and Financial Governance
&lt;/h4&gt;

&lt;p&gt;Maintaining compliance with accounting standards, internal policies, and regulatory requirements is a fundamental responsibility of every finance function. AI can assist by reviewing financial records, identifying inconsistencies, and highlighting areas requiring management attention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Review the attached lease accounting schedules and assess whether they comply with IFRS 16 recognition and measurement requirements. Identify any inconsistencies, explain the relevant accounting treatment, and recommend corrective actions where necessary.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  7. Financial Analysis and Executive Decision Support
&lt;/h4&gt;

&lt;p&gt;Finance professionals play a strategic role in helping management interpret financial information and evaluate business performance. AI can support this role by transforming complex financial data into concise and actionable insights.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Analyze the organization's financial performance for the first half of 2026 using profitability, liquidity, efficiency, and solvency ratios. Identify the three most significant business risks, the three strongest performance indicators, and recommend strategic priorities for the next quarter.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a id="Level4"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Best Practices for Prompt Engineering in Finance
&lt;/h3&gt;

&lt;p&gt;The following best practices can help finance professionals maximize the value of AI embedded within modern ERP systems.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Be Clear and Specific
&lt;/h4&gt;

&lt;p&gt;Ambiguous prompts often result in broad or generic responses. AI performs more effectively when the task is clearly defined and the expected outcome is explicitly stated.&lt;/p&gt;

&lt;p&gt;Instead of writing:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Analyze this report.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Consider:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Analyze the June 2026 Income Statement, identify all operating expenses that exceeded budget by more than x%, explain the likely business drivers, and recommend corrective actions.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Specific prompts reduce ambiguity and produce outputs that require less revision.&lt;/p&gt;




&lt;h4&gt;
  
  
  2. Provide Adequate Business Context
&lt;/h4&gt;

&lt;p&gt;Financial data rarely exists in isolation. Business performance is influenced by industry conditions, organizational strategy, accounting policies, and operational circumstances. Including this context enables AI to generate more meaningful insights.&lt;/p&gt;

&lt;p&gt;For example, specifying that the organization is a manufacturing company reporting under IFRS provides information that influences the interpretation of financial data.&lt;/p&gt;

&lt;p&gt;The more relevant context provided, the more tailored the response is likely to be.&lt;/p&gt;




&lt;h4&gt;
  
  
  3. Define the Desired Output
&lt;/h4&gt;

&lt;p&gt;Finance professionals communicate with diverse stakeholders, including senior management, boards of directors, auditors, regulators, lenders, and investors. Each audience requires information presented differently.&lt;/p&gt;

&lt;p&gt;When prompting AI, specify how the results should be presented.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Executive summary&lt;/li&gt;
&lt;li&gt;Board report&lt;/li&gt;
&lt;li&gt;Financial commentary&lt;/li&gt;
&lt;li&gt;Variance analysis table&lt;/li&gt;
&lt;li&gt;Risk assessment matrix&lt;/li&gt;
&lt;li&gt;Dashboard narrative&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Defining the output format improves consistency and reduces the need for manual editing.&lt;/p&gt;




&lt;h4&gt;
  
  
  4. Break Complex Tasks into Smaller Steps
&lt;/h4&gt;

&lt;p&gt;Complex financial analyses often involve multiple stages. Rather than asking AI to perform every task in a single prompt, divide the work into logical steps.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Summarize the financial statements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Identify material variances.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Explain the causes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Recommend management actions.&lt;/p&gt;

&lt;p&gt;This iterative approach generally produces more accurate and transparent results while allowing finance professionals to review and validate each stage of the analysis.&lt;/p&gt;




&lt;h4&gt;
  
  
  5. Verify AI-Generated Outputs
&lt;/h4&gt;

&lt;p&gt;AI should support not replace professional judgment. Although AI can accelerate analysis, it may occasionally misinterpret information, overlook important context, or generate incorrect conclusions.&lt;/p&gt;

&lt;p&gt;Finance professionals should therefore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validate financial calculations.&lt;/li&gt;
&lt;li&gt;Confirm compliance with accounting standards.&lt;/li&gt;
&lt;li&gt;Review assumptions.&lt;/li&gt;
&lt;li&gt;Cross-check figures against source data.&lt;/li&gt;
&lt;li&gt;Exercise professional skepticism before relying on AI-generated outputs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The responsibility for financial accuracy remains with the finance professional.&lt;/p&gt;




&lt;h4&gt;
  
  
  6. Protect Confidential and Sensitive Information
&lt;/h4&gt;

&lt;p&gt;Financial records often contain confidential information relating to customers, suppliers, employees, pricing strategies, and organizational performance. Before sharing data with AI systems, finance professionals should understand their organization's data governance policies and ensure that confidential information is handled appropriately.&lt;/p&gt;

&lt;p&gt;Where possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove personally identifiable information (PII).&lt;/li&gt;
&lt;li&gt;Mask sensitive financial information.&lt;/li&gt;
&lt;li&gt;Use approved enterprise AI solutions integrated within the organization's ERP environment.&lt;/li&gt;
&lt;li&gt;Comply with applicable data protection and privacy regulations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Responsible AI usage begins with responsible data management.&lt;/p&gt;




&lt;h4&gt;
  
  
  7. Refine Prompts Through Iteration
&lt;/h4&gt;

&lt;p&gt;Prompt engineering is an iterative process. The first response generated by AI is not always the final answer.&lt;/p&gt;

&lt;p&gt;Finance professionals should build on previous responses by asking follow-up questions such as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Explain the largest variance in greater detail.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Present the findings as a dashboard narrative.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Compare these results with the previous financial year.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Highlight only the risks requiring immediate management attention.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Each refinement improves the quality and usefulness of the analysis while enabling AI to produce increasingly focused outputs.&lt;/p&gt;




&lt;h4&gt;
  
  
  8. Combine AI with Professional Expertise
&lt;/h4&gt;

&lt;p&gt;AI excels at processing information quickly, identifying patterns, and generating summaries. Finance professionals contribute business understanding, ethical judgment, regulatory knowledge, and strategic insight.&lt;/p&gt;

&lt;p&gt;The greatest value is achieved when these capabilities work together.&lt;/p&gt;

&lt;p&gt;&lt;a id="Level5"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  When Good AI Produces Poor Results: Common Prompting Mistakes in Finance
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Asking Vague or Ambiguous Questions
&lt;/h4&gt;

&lt;p&gt;One of the most common mistakes is providing AI with insufficient direction. Broad instructions leave too much room for interpretation, increasing the likelihood of generic responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Poor Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Analyze this financial report.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The AI has no information about the reporting period, the business objective, the audience, or the aspects of the report that require attention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Improved Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Analyze the June 2026 Income Statement, identify operating expenses that exceeded budget by more than x%, explain the likely business drivers, and prepare a one-page executive summary for senior management.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Providing a clear objective and scope enables AI to deliver focused and actionable insights.&lt;/p&gt;




&lt;h4&gt;
  
  
  2. Failing to Provide Business Context
&lt;/h4&gt;

&lt;p&gt;Financial data does not exist in isolation. Industry conditions, accounting policies, organizational strategy, and operational circumstances all influence how financial information should be interpreted.&lt;/p&gt;

&lt;p&gt;Without sufficient context, AI may produce technically correct but commercially inappropriate recommendations.&lt;/p&gt;

&lt;p&gt;For example, recommending aggressive cost reductions without understanding that the organization is investing in a strategic expansion could lead to misleading conclusions.&lt;/p&gt;

&lt;p&gt;Providing relevant background allows AI to align its analysis with the organization's operating environment.&lt;/p&gt;




&lt;h4&gt;
  
  
  3. Ignoring Accounting Standards and Organizational Policies
&lt;/h4&gt;

&lt;p&gt;Finance operates within well-defined regulatory and professional frameworks. AI cannot automatically determine whether an organization follows IFRS, GAAP, IPSAS, or internal accounting policies unless this information is explicitly provided.&lt;/p&gt;

&lt;p&gt;For example, a prompt requesting advice on lease accounting should specify the applicable accounting framework to ensure that the response reflects the relevant reporting requirements.&lt;/p&gt;

&lt;p&gt;Including accounting standards and organizational policies improves the reliability and compliance of AI-generated outputs.&lt;/p&gt;




&lt;h4&gt;
  
  
  4. Attempting to Solve Too Many Problems in One Prompt
&lt;/h4&gt;

&lt;p&gt;Finance professionals sometimes expect AI to perform multiple unrelated tasks simultaneously, such as analyzing financial statements, forecasting cash flows, assessing investment opportunities, preparing board reports, and identifying compliance risks within a single request.&lt;/p&gt;

&lt;p&gt;Although AI can manage complex instructions, combining too many objectives often reduces the clarity and quality of the response.&lt;/p&gt;

&lt;p&gt;A more effective approach is to divide large assignments into smaller, sequential tasks. This allows each stage of the analysis to be reviewed and validated before proceeding to the next.&lt;/p&gt;




&lt;h4&gt;
  
  
  5. Accepting AI Outputs Without Verification
&lt;/h4&gt;

&lt;p&gt;Perhaps the most significant risk is assuming that AI-generated responses are automatically accurate. While AI can produce impressive analyses and summaries, it may occasionally misinterpret financial data, overlook important information, or generate unsupported conclusions.&lt;/p&gt;

&lt;p&gt;Finance professionals remain responsible for verifying:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Financial calculations.&lt;/li&gt;
&lt;li&gt;Accounting treatments.&lt;/li&gt;
&lt;li&gt;Regulatory compliance.&lt;/li&gt;
&lt;li&gt;Supporting assumptions.&lt;/li&gt;
&lt;li&gt;Source data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Professional skepticism remains just as important in the age of AI as it has always been in the finance profession.&lt;/p&gt;




&lt;h4&gt;
  
  
  6. Sharing Sensitive Financial Information Inappropriately
&lt;/h4&gt;

&lt;p&gt;Financial data often includes confidential information relating to customers, suppliers, employees, pricing, and organizational performance. Uploading sensitive information into AI tools without considering organizational policies or data protection requirements can expose organizations to significant legal, regulatory, and reputational risks.&lt;/p&gt;

&lt;p&gt;Finance professionals should ensure that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only approved AI solutions are used.&lt;/li&gt;
&lt;li&gt;Organizational data governance policies are followed.&lt;/li&gt;
&lt;li&gt;Sensitive information is anonymized or masked where appropriate.&lt;/li&gt;
&lt;li&gt;Confidential financial information is protected throughout the prompting process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Responsible prompt engineering begins with responsible data stewardship.&lt;/p&gt;




&lt;h4&gt;
  
  
  7. Treating AI as a Decision Maker Rather Than a Decision Support Tool
&lt;/h4&gt;

&lt;p&gt;AI is designed to assist finance professionals—not replace them.&lt;/p&gt;

&lt;p&gt;While AI can rapidly analyze financial information and generate recommendations, it cannot fully understand organizational culture, strategic priorities, stakeholder expectations, or emerging business risks.&lt;/p&gt;

&lt;p&gt;Critical financial decisions continue to require human expertise, professional judgment, ethical reasoning, and accountability.&lt;/p&gt;

&lt;p&gt;The role of AI is to enhance decision-making by providing timely insights, not to make decisions on behalf of the organization.&lt;/p&gt;

&lt;p&gt;&lt;a id="Level6"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Governance, Ethics, and Human Oversight: Building Trust in AI-Powered Finance
&lt;/h3&gt;

&lt;p&gt;The integration of AI into ERP systems has introduce new governance responsibilities. As organizations increasingly rely on AI to assist with financial reporting, budgeting, forecasting, auditing, and compliance, maintaining trust in AI-generated outputs becomes just as important as improving productivity.&lt;/p&gt;

&lt;p&gt;One of the most important principles of AI adoption in finance is that &lt;strong&gt;accountability cannot be delegated to technology&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;While AI can generate analyses, recommendations, and forecasts, the responsibility for financial decisions remains with finance professionals and organizational leadership. AI should therefore be viewed as a decision-support tool rather than an autonomous decision-maker.&lt;/p&gt;

&lt;p&gt;Organizations should establish clear governance frameworks that define how AI is used within financial processes. These frameworks should specify approved AI applications, data access permissions, validation procedures, documentation requirements, and approval workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data governance&lt;/strong&gt; is equally important. AI systems often process highly sensitive financial information, including payroll data, customer records, supplier contracts, pricing strategies, and confidential management reports. Organizations should implement appropriate controls to ensure that data shared with AI complies with internal security policies and applicable data protection regulations. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ethical considerations&lt;/strong&gt; should also guide the adoption of AI within finance. AI-generated recommendations must be transparent, explainable, and free from inappropriate bias. &lt;/p&gt;

&lt;p&gt;Finance professionals should understand the assumptions underlying AI-generated outputs, challenge recommendations where necessary, and avoid overreliance on automated analyses. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Internal controls&lt;/strong&gt; should evolve alongside AI adoption. Organizations should regularly monitor AI performance, document significant AI-assisted decisions, review prompt quality, and periodically assess whether AI-generated outputs remain accurate and aligned with organizational policies. &lt;/p&gt;

&lt;p&gt;Integrating AI governance into existing risk management and internal control frameworks helps ensure that innovation does not compromise accountability or financial integrity.&lt;/p&gt;

&lt;p&gt;&lt;a id="Level7"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Future of Prompt Engineering in Finance
&lt;/h3&gt;

&lt;p&gt;Future ERP platforms are expected to move beyond responding to prompts and towards &lt;strong&gt;proactive intelligence&lt;/strong&gt;. Instead of waiting for users to request analyses, AI will continuously monitor business performance, detect emerging risks, identify unusual transactions, recommend corrective actions, and alert management to significant changes in real time.&lt;a href="https://www.financialprofessionals.org/training-resources/resources/articles/details/the-role-of-prompt-engineering-in-finance-and-where-it-falls-short" rel="noopener noreferrer"&gt;(AFP Staff, 2026)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Prompt engineering will therefore evolve from asking isolated questions to guiding ongoing collaboration between finance professionals and intelligent systems.&lt;/p&gt;

&lt;p&gt;The role of finance professionals will also continue to evolve. Routine transactional work will become increasingly automated, allowing finance teams to devote more time to strategic planning, business partnering, performance management, and value creation. &lt;/p&gt;

&lt;p&gt;Educational institutions and professional accounting bodies are already beginning to incorporate AI-related competencies into curricula and continuing professional development programmes, recognizing that effective collaboration with intelligent systems is becoming an essential aspect of modern financial management.&lt;/p&gt;

&lt;p&gt;&lt;a id="Level8"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Industry Perspectives: Why Prompt Engineering Matters
&lt;/h3&gt;

&lt;p&gt;As AI becomes embedded within enterprise software, organizations increasingly recognize that achieving value from AI depends not only on technological investment but also on developing the capabilities of the people who use it.&lt;/p&gt;

&lt;p&gt;Research consistently shows that organizations adopting AI expect improvements in productivity, operational efficiency, and decision-making. In finance, this means combining accounting expertise with digital competencies such as data literacy, AI literacy, and prompt engineering.&lt;/p&gt;

&lt;p&gt;Major ERP vendors have also repositioned AI as a core component of enterprise applications rather than a standalone technology. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Microsoft has integrated Copilot across the Dynamics 365 ecosystem to assist users with financial analysis, reporting, reconciliation, and workflow automation.&lt;/li&gt;
&lt;li&gt;SAP has introduced Joule as an AI assistant across its enterprise applications.&lt;/li&gt;
&lt;li&gt;Oracle has embedded generative AI capabilities within Oracle Fusion Cloud ERP to enhance financial planning, procurement, and operational decision-making. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These developments illustrate a broader industry trend toward conversational enterprise systems that enable users to interact with business data using natural language.&lt;/p&gt;

&lt;p&gt;The future finance professional will require a combination of technical accounting expertise, business understanding, digital literacy, and the ability to collaborate effectively with AI.&lt;/p&gt;

&lt;p&gt;Industry analysts also predict that AI will fundamentally reshape enterprise software over the coming decade. Rather than replacing ERP systems, AI is expected to enhance them by transforming operational data into actionable insights and enabling more proactive decision-making. &lt;/p&gt;

&lt;p&gt;&lt;a id="Level9"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Artificial Intelligence is transforming Enterprise Resource Planning systems from platforms that primarily record transactions into intelligent systems that assist finance professionals in analyzing data, generating insights, and supporting strategic decision-making. &lt;/p&gt;

&lt;p&gt;As AI becomes embedded within everyday financial processes, the nature of work in finance is changing. The question is no longer whether organizations should adopt AI-powered ERP systems, but how effectively finance professionals can use them to create value.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.financialprofessionals.org/training-resources/resources/articles/details/the-role-of-prompt-engineering-in-finance-and-where-it-falls-short" rel="noopener noreferrer"&gt;AFP Staff. (2026). Trending articles and topics in Treasury and finance. AFP.&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.deloitte.com/us/en/services/consulting/articles/prompt-engineering-for-finance.html" rel="noopener noreferrer"&gt;Glover, J., &amp;amp; Peters, R. (2025). Prompt engineering for finance 101 | Deloitte US. In Deloitte.&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.ibm.com/think/topics/ai-in-erp" rel="noopener noreferrer"&gt;Hayes, M., &amp;amp; Downie, A. (2024). Artificial intelligence in ERP | IBM. In Ibm.com.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Connect with me via:&lt;br&gt;
&lt;a href="//www.linkedin.com/in/lucy-joan-600914193"&gt;LinkedIn&lt;/a&gt; | &lt;a href="//lucyjoanwere2@gmail.com"&gt;Email&lt;/a&gt;&lt;/p&gt;



</description>
      <category>ai</category>
      <category>analytics</category>
      <category>automation</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Introduction to Supervised Machine Learning for Beginners</title>
      <dc:creator>Lucy Joan</dc:creator>
      <pubDate>Sat, 02 Aug 2025 08:10:15 +0000</pubDate>
      <link>https://dev.to/lucy_joan_b56ae069a2a9f17/introduction-to-supervised-machine-learning-for-beginners-105a</link>
      <guid>https://dev.to/lucy_joan_b56ae069a2a9f17/introduction-to-supervised-machine-learning-for-beginners-105a</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Machine learning might sound complex, but at its core, it’s simply about teaching computers to learn from examples — just like humans do. &lt;/p&gt;

&lt;p&gt;One of the most common and important ways machines learn is called supervised learning. This article will walk you through what supervised learning is, how it works, and why it matters — all explained in simple, beginner-friendly language.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Supervised Learning?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Supervised learning&lt;/strong&gt; is a type of machine learning where the model learns from a labeled dataset — meaning each input comes with a correct answer (or label).&lt;/p&gt;

&lt;p&gt;Supervised learning is like having a teacher guide you through a subject, giving you the questions and the correct answers so you can learn how to solve similar problems on your own.&lt;/p&gt;

&lt;p&gt;The “supervised” part means the machine is guided by examples.&lt;/p&gt;

&lt;p&gt;These examples come with labels (the correct answers), so the machine knows what the right outcome should be.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Imagine you’re learning to identify fruits.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You see a picture of a red, round fruit labeled “apple.”&lt;/li&gt;
&lt;li&gt;You see another picture of a long, yellow fruit labeled banana.”&lt;/li&gt;
&lt;li&gt;Over time, you can correctly identify an apple or a banana on your own because you’ve seen labeled examples.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;That’s exactly what supervised learning does — but with data instead of fruit pictures!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's use an example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose we want to teach a computer to distinguish between emails that are &lt;strong&gt;"Spam"&lt;/strong&gt; and those that are &lt;strong&gt;"Not Spam."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Data&lt;/strong&gt;: We gather a large collection of emails.&lt;br&gt;
&lt;strong&gt;The Labels&lt;/strong&gt;: For each email, we manually mark it as either "Spam" or "Not Spam."&lt;/p&gt;

&lt;p&gt;Our labeled dataset would look something like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Email 1&lt;/strong&gt;: "Congratulations! You've won a free vacation! Click here!" – &lt;strong&gt;Label: Spam&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Email 2:&lt;/strong&gt; "Meeting notes from yesterday's team sync." – &lt;strong&gt;Label: Not Spam&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Email 3:&lt;/strong&gt; "Claim your prize now! Limited time offer!" – &lt;strong&gt;Label: Spam&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Email 4:&lt;/strong&gt; "Your order has been shipped. Tracking number: XYZ123." – &lt;strong&gt;Label: Not Spam&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How the Computer Learns (The Magic Behind the Scenes)
&lt;/h3&gt;

&lt;p&gt;The computer then uses special algorithms (think of them as learning strategies) to look at all these examples. It starts to identify patterns and relationships between the content of the email and its label.&lt;/p&gt;

&lt;p&gt;For instance, it might notice that emails with words like "free," "win," "prize," "urgent," or a lot of exclamation marks are more likely to be spam. Conversely, emails with professional language, specific sender addresses, or order tracking information are more likely to be legitimate.&lt;/p&gt;

&lt;p&gt;The algorithm tries to build a model – which is essentially a set of rules or a mathematical function – that can accurately predict the label (Spam or Not Spam) for new, unseen emails.&lt;/p&gt;

&lt;p&gt;The goal is for the model to learn the relationship between input features and the target output so it can make predictions on new, unseen data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Importance of Supervised Machine Learning
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Learns from labeled data to make accurate predictions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Widely used in real-world tasks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spam detection&lt;/li&gt;
&lt;li&gt;Image and voice recognition&lt;/li&gt;
&lt;li&gt;Medical diagnosis&lt;/li&gt;
&lt;li&gt;Financial forecasting&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Easy to understand and implement — models learn like humans do, through examples.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;High accuracy and performance when trained with quality data.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Gives control over the learning process since outcomes (labels) are known.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Scalable and adaptable across many industries and use cases.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Examples of Supervised Learning
&lt;/h2&gt;

&lt;p&gt;Supervised learning is all around us, even if we don’t notice it. Here are some relatable examples:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Email Spam Detection&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Input: Words in your email&lt;/li&gt;
&lt;li&gt;    Output: Spam or not spam&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Loan Approval&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Input: Your income, credit score, etc.&lt;/li&gt;
&lt;li&gt;    Output: Approve or reject your loan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Medical Diagnosis&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Input: Symptoms and test results&lt;/li&gt;
&lt;li&gt;    Output: Disease present or not&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Voice Assistants (like Siri or Alexa)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Input: Your voice command&lt;/li&gt;
&lt;li&gt;    Output: Translated into text or action&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Image Recognition&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Input: Photo of a cat&lt;/li&gt;
&lt;li&gt;    Output: Label “cat”&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Two Main Types of Supervised Learning
&lt;/h2&gt;

&lt;p&gt;Supervised learning problems generally fall into two main categories:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Classification:
&lt;/h3&gt;

&lt;p&gt;Predicting a category or a discrete class.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The model learns to answer "What kind of thing is this?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this email Spam or Not Spam? (Two classes)&lt;/li&gt;
&lt;li&gt;Is this picture a Cat, a Dog, or a Bird? (Multiple classes)&lt;/li&gt;
&lt;li&gt;Will this customer churn (leave) or not? (Two classes)
Think of it as: Sorting things into buckets.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Classification Algorithms:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logistic Regression&lt;/li&gt;
&lt;li&gt;Decision Tree Classifier&lt;/li&gt;
&lt;li&gt;Random Forest Classifier&lt;/li&gt;
&lt;li&gt;Support Vector Machine (SVM)&lt;/li&gt;
&lt;li&gt;K-Nearest Neighbors (KNN)&lt;/li&gt;
&lt;li&gt;Naive Bayes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Output Type:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Discrete&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;Example: ["Yes", "No"], [0, 1], ["Dog", "Cat", "Bird"]&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Algorithm&lt;/th&gt;
&lt;th&gt;Definition&lt;/th&gt;
&lt;th&gt;When to Use&lt;/th&gt;
&lt;th&gt;Python Import Example&lt;/th&gt;
&lt;th&gt;Notable Features&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Logistic Regression&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Predicts probability of class membership using a sigmoid function.&lt;/td&gt;
&lt;td&gt;For binary classification (e.g., spam vs not spam).&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.linear_model import LogisticRegression&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fast, interpretable, works well with linear data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Decision Tree Classifier&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Creates decision rules in a tree structure to classify data.&lt;/td&gt;
&lt;td&gt;When interpretability and simple logic are needed.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.tree import DecisionTreeClassifier&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Easy to visualize, can overfit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Random Forest Classifier&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Uses many decision trees and averages results for better accuracy.&lt;/td&gt;
&lt;td&gt;When accuracy is more important than interpretability.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.ensemble import RandomForestClassifier&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Powerful, reduces overfitting, handles non-linearity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Support Vector Machine (SVM)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Finds a hyperplane that best separates classes.&lt;/td&gt;
&lt;td&gt;When classes are well separated or data is high-dimensional.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.svm import SVC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Works well in small datasets, robust to outliers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;K-Nearest Neighbors (KNN)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Classifies based on the majority of k nearest neighbors.&lt;/td&gt;
&lt;td&gt;When the data is low-dimensional and relationships are local.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.neighbors import KNeighborsClassifier&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Simple, no training phase, memory intensive&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Naive Bayes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Uses Bayes' Theorem assuming feature independence.&lt;/td&gt;
&lt;td&gt;When working with text (e.g., sentiment or spam detection).&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.naive_bayes import MultinomialNB&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Very fast, good baseline for text classification&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  2. Regression:
&lt;/h3&gt;

&lt;p&gt;Predicting a continuous numerical value.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The model learns to answer "How much?" or "What’s the value?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What will the price of a house be based on its size, location, and number of rooms?&lt;/li&gt;
&lt;li&gt;How many sales will a store make next month based on advertising spend and seasonality?&lt;/li&gt;
&lt;li&gt;What will the temperature be tomorrow?
Think of it as: Predicting a number on a scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Regression Algorithms:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linear Regression&lt;/li&gt;
&lt;li&gt;Ridge Regression&lt;/li&gt;
&lt;li&gt;Lasso Regression&lt;/li&gt;
&lt;li&gt;Decision Tree Regressor&lt;/li&gt;
&lt;li&gt;Random Forest Regressor&lt;/li&gt;
&lt;li&gt;Support Vector Regressor (SVR)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Output Type:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Continuous&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;Example: 23.7, 1500, -4.8&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Algorithm&lt;/th&gt;
&lt;th&gt;Definition&lt;/th&gt;
&lt;th&gt;When to Use&lt;/th&gt;
&lt;th&gt;Python Import Example&lt;/th&gt;
&lt;th&gt;Notable Features&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Linear Regression&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Predicts a target value by fitting a straight line through the data.&lt;/td&gt;
&lt;td&gt;When the relationship between variables is linear.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.linear_model import LinearRegression&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Simple, fast, interpretable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ridge Regression&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Linear regression with L2 regularization to reduce overfitting.&lt;/td&gt;
&lt;td&gt;When you want to penalize large coefficients but keep all variables.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.linear_model import Ridge&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Adds stability by shrinking coefficients&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Lasso Regression&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Linear regression with L1 regularization for feature selection.&lt;/td&gt;
&lt;td&gt;When you want to shrink some features to zero (ignore them).&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.linear_model import Lasso&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Useful for sparse data or reducing model complexity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Decision Tree Regressor&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Splits data into branches and predicts a value at the leaves.&lt;/td&gt;
&lt;td&gt;When the data has non-linear relationships or clear decision boundaries.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.tree import DecisionTreeRegressor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Easy to understand, can overfit without pruning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Random Forest Regressor&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;An ensemble of decision trees for regression.&lt;/td&gt;
&lt;td&gt;When you want accurate predictions and want to avoid overfitting.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.ensemble import RandomForestRegressor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Handles non-linearities well, robust and powerful&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Support Vector Regressor (SVR)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Uses support vectors to fit a curve within a margin of tolerance.&lt;/td&gt;
&lt;td&gt;When the data is high-dimensional or not linearly separable.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from sklearn.svm import SVR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Works well with complex, small datasets&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  The Machine Learning Recipe: Step-by-Step Guide to Supervised Learning
&lt;/h3&gt;

&lt;p&gt;Supervised learning follows a structured process — just like following a recipe. Here's how you build a machine learning model from scratch:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Collect Data&lt;/strong&gt;&lt;br&gt;
Gather examples that include both input features and the correct answers (labels).&lt;/p&gt;

&lt;p&gt;Example: A list of emails labeled as “Spam” or “Not Spam.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Clean the Data&lt;/strong&gt;&lt;br&gt;
Fix missing values, remove duplicates, and correct errors to ensure data quality.&lt;/p&gt;

&lt;p&gt;Clean data = better learning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Split the Data&lt;/strong&gt;&lt;br&gt;
Divide your dataset into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Training Set (usually 70–80%) – used to teach the model&lt;/li&gt;
&lt;li&gt;Test Set (20–30%) – used to see how well the model learned&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This prevents the model from just memorizing everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Choose the Right Model&lt;/strong&gt;&lt;br&gt;
Pick an algorithm that suits your problem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classification (e.g., Logistic Regression)&lt;/li&gt;
&lt;li&gt;Regression (e.g., Linear Regression)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Preprocess the Data&lt;/strong&gt;&lt;br&gt;
Prepare the features so the model can understand them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Normalize/standardize numeric values&lt;/li&gt;
&lt;li&gt;Encode categories (like Yes/No → 1/0)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Train the Model&lt;/strong&gt;&lt;br&gt;
Feed the training data into the model so it can learn patterns between inputs and outputs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Test the Model&lt;/strong&gt;&lt;br&gt;
Use the test data to check how well the model performs on unseen examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Evaluate Performance&lt;/strong&gt;&lt;br&gt;
Use metrics to measure accuracy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For classification: Accuracy, Precision, F1-Score&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;What it Means&lt;/th&gt;
&lt;th&gt;Use When&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Accuracy&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;% of correct predictions&lt;/td&gt;
&lt;td&gt;Classes are balanced&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Precision&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Of those predicted &lt;strong&gt;positive&lt;/strong&gt;, how many were correct?&lt;/td&gt;
&lt;td&gt;Cost of false positives is high (e.g., email spam)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Recall&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Of all actual &lt;strong&gt;positives&lt;/strong&gt;, how many did we find?&lt;/td&gt;
&lt;td&gt;Cost of false negatives is high (e.g., disease)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;F1-Score&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Harmonic mean of precision &amp;amp; recall&lt;/td&gt;
&lt;td&gt;When you want balance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Confusion Matrix&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Shows TP, FP, FN, TN&lt;/td&gt;
&lt;td&gt;To visualize classification mistakes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;True Positive(TP) - Model correctly predicted Positive (and it actually is Positive).
False Positive(FP) - Model predicted Positive, but it's actually Negative (aka "False Alarm").
False Negative(FN) - Model predicted Negative, but it's actually Positive (aka "Missed it").
True Negative(TN) - Model correctly predicted Negative (and it actually is Negative)             |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For regression: Mean Squared Error (MSE), R² Score&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;What it Means&lt;/th&gt;
&lt;th&gt;Use When&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mean Absolute Error (MAE)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Average of absolute errors&lt;/td&gt;
&lt;td&gt;Easy to understand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mean Squared Error (MSE)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Penalizes big errors more&lt;/td&gt;
&lt;td&gt;Common and popular&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Root Mean Squared Error (RMSE)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Square root of MSE&lt;/td&gt;
&lt;td&gt;Same units as target&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;R² Score (R-squared)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;How much variance is explained&lt;/td&gt;
&lt;td&gt;1 is perfect, 0 is bad&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;9. Tune the Model (Optimize)&lt;/strong&gt;&lt;br&gt;
Adjust the model’s settings (called hyperparameters) or try different algorithms to improve results and fix:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Underfitting – Model is too simple&lt;/li&gt;
&lt;li&gt;Overfitting – Model memorized training data too well&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;10. Deploy the Model&lt;/strong&gt;&lt;br&gt;
Once it performs well, integrate the model into a real system — like predicting spam emails or product prices in an app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. Monitor and Update&lt;/strong&gt;&lt;br&gt;
Track how the model performs over time. As new data comes in, you may need to retrain or update the model to keep it accurate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Errors in Supervised ML
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Error Type&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;How to Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Underfitting&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Model is too simple&lt;/td&gt;
&lt;td&gt;Use a more complex model or add features&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Overfitting&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Model memorized instead of learning&lt;/td&gt;
&lt;td&gt;Simplify model or use more data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bias&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Model is unfair or always wrong in one way&lt;/td&gt;
&lt;td&gt;Use fairer data, tune model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Variance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Model changes too much on small changes&lt;/td&gt;
&lt;td&gt;Use regularization or simpler model&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The main parts of machine learning include data, features, a model, and an algorithm. The process starts by feeding data into the model, which is trained using the algorithm. After training, the model is tested and evaluated. Once it's accurate enough, it can make predictions on new, unseen data.&lt;/p&gt;

&lt;p&gt;Think of it like teaching someone to bake:&lt;br&gt;
You gather ingredients (data), follow a recipe (algorithm), practice baking (training), test how good the cookies are (evaluation), and eventually, bake confidently (prediction).&lt;/p&gt;

&lt;p&gt;Supervised learning is just one branch of machine learning. There’s also unsupervised learning, which finds patterns in data without labels (like grouping similar customers), and reinforcement learning, where an agent learns by trial and error (like teaching a robot to walk).&lt;/p&gt;

&lt;p&gt;Check out my github: &lt;a href="https://github.com/Lucy23-2024" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>openai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Introduction to SQL Using PostreSQL</title>
      <dc:creator>Lucy Joan</dc:creator>
      <pubDate>Sat, 26 Apr 2025 13:44:52 +0000</pubDate>
      <link>https://dev.to/lucy_joan_b56ae069a2a9f17/introduction-to-sql-using-postresql-3l7p</link>
      <guid>https://dev.to/lucy_joan_b56ae069a2a9f17/introduction-to-sql-using-postresql-3l7p</guid>
      <description>&lt;h2&gt;
  
  
  PostgreSQL for Absolute Beginners: Your First Step into Data Management
&lt;/h2&gt;

&lt;p&gt;Imagine managing millions of Instagram posts or handling customer orders worldwide without confusion.&lt;br&gt;
Behind the scenes, a powerful tool called SQL (Structured Query Language) makes it all possible. In this beginner’s guide, we’ll walk you through PostgreSQL, one of the world’s most popular database systems, and help you write your first SQL commands.&lt;/p&gt;
&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;p&gt;. What is SQL?&lt;br&gt;
. How to set up PostreSQL&lt;br&gt;
. Basic database concepts (schemas, tables, rows)&lt;br&gt;
. Writing your first SQL queries&lt;br&gt;
. A mini hands-on project&lt;br&gt;
. Pro tips and next steps&lt;/p&gt;

&lt;p&gt;&lt;a id="#intro"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction to SQL?
&lt;/h2&gt;

&lt;p&gt;SQL (structured query language) is a programming language for storing and processing information in relational database management systems (stores information in tabular form, with rows and columns).&lt;/p&gt;

&lt;p&gt;It is used extensively for storing, manipulating and retrieving data in systems such as MySQL, PostgreSQL etc.&lt;/p&gt;

&lt;p&gt;You can use SQL statements to store, update, remove, search, and retrieve information from the database - making it essential for tasks like data analysis, software development, and database administration. &lt;/p&gt;

&lt;p&gt;You can also use SQL to maintain and optimize database performance.&lt;br&gt;
Whether you're building applications, generating reports, or analysing big data, SQL provides the tools needed to interact with complex datasets quickly and efficiently. Thanks to its versatility and widespread adoption, SQL remains one of the most important skills in today’s data-driven world.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In this article, we will focus on PostgreSQL, a powerful and widely-used open-source relational database management system (RDBMS). You will learn what makes PostgreSQL a preferred choice for developers, data analysts, and businesses managing complex data. In our next article, we will provide a step-by-step guide on how to download, install, and set up PostgreSQL on your computer, so you can start building and managing your own databases.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a id="#point-one"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How to Set Up PostgreSQL: Step-by-Step Guide for Beginners
&lt;/h2&gt;

&lt;p&gt;Setting up PostgreSQL correctly is essential for creating secure and high-performing databases. In this guide, we’ll cover everything you need to know to download, install, and configure PostgreSQL on your machine, whether you are using Windows, macOS, or Linux.&lt;/p&gt;

&lt;p&gt;Step 1: Download PostgreSQL&lt;br&gt;
. Go to the official PostgreSQL website: &lt;a href="https://www.postgresql.org/download/" rel="noopener noreferrer"&gt;https://www.postgresql.org/download/&lt;/a&gt;&lt;br&gt;
. Choose your operating system (Windows, macOS, Linux).&lt;br&gt;
. Download the latest stable version of PostgreSQL.&lt;/p&gt;

&lt;p&gt;Step 2: Install PostgreSQL&lt;/p&gt;

&lt;p&gt;For Windows:&lt;br&gt;
. Open the downloaded installer.&lt;br&gt;
. Follow the setup wizard.&lt;br&gt;
. Choose an installation directory.&lt;br&gt;
. Set a password for the PostgreSQL superuser (postgres).&lt;br&gt;
. Select the default port (5432) unless you need to change it.&lt;br&gt;
. Complete the installation.&lt;/p&gt;

&lt;p&gt;For macOS:&lt;br&gt;
Install using the PostgreSQL installer package or use Homebrew&lt;/p&gt;

&lt;p&gt;For Linux:&lt;br&gt;
Install using your package manager&lt;/p&gt;

&lt;p&gt;Step 3: Set Up PostgreSQL&lt;br&gt;
. Verify the installation.&lt;br&gt;
. Open pgAdmin (the PostgreSQL management tool) or connect via command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;psql &lt;span class="nt"&gt;-U&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a id="#point-two"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic database concepts
&lt;/h2&gt;

&lt;p&gt;Before you dive into writing SQL queries, it’s important to understand the core building blocks of databases. These basic concepts will help you feel more confident as you start creating and managing your own data structures.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;A collection of organized data stored electronically&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schema&lt;/td&gt;
&lt;td&gt;A logical container that holds tables, views, and other database objects. Think of it like a folder that keeps everything organized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Table&lt;/td&gt;
&lt;td&gt;A structured set of data organized into rows and columns, similar to a spreadsheet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Row&lt;/td&gt;
&lt;td&gt;A single record inside a table, containing related data for one item&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Column&lt;/td&gt;
&lt;td&gt;A specific attribute or field that holds one type of data, such as a name, email, or date of enrollment&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Visual Example of a Database Structure&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;school&lt;/span&gt;
&lt;span class="err"&gt;│&lt;/span&gt;
&lt;span class="err"&gt;└──&lt;/span&gt; &lt;span class="k"&gt;Schema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt;
    &lt;span class="err"&gt;│&lt;/span&gt;
    &lt;span class="err"&gt;├──&lt;/span&gt; &lt;span class="k"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;
    &lt;span class="err"&gt;│&lt;/span&gt;    &lt;span class="err"&gt;├──&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;column&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="err"&gt;│&lt;/span&gt;    &lt;span class="err"&gt;├──&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;column&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="err"&gt;│&lt;/span&gt;    &lt;span class="err"&gt;├──&lt;/span&gt; &lt;span class="n"&gt;enrollment_date&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;column&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example:&lt;/p&gt;

&lt;p&gt;Database: &lt;code&gt;school&lt;/code&gt; is the main database.&lt;/p&gt;

&lt;p&gt;Schema: &lt;code&gt;public&lt;/code&gt; groups related tables.&lt;/p&gt;

&lt;p&gt;Table: &lt;code&gt;students&lt;/code&gt; stores information about students.&lt;/p&gt;

&lt;p&gt;Columns: &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;, and &lt;code&gt;enrollment_date&lt;/code&gt; are the fields capturing each student's data.&lt;/p&gt;

&lt;p&gt;&lt;a id="#point-three"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Your first SQL queries
&lt;/h2&gt;

&lt;p&gt;Now that you understand the basic building blocks of databases, it’s time to write your first SQL queries! SQL (Structured Query Language) is the tool you’ll use to interact with your database — to create tables, insert data, and retrieve information.&lt;/p&gt;

&lt;p&gt;Here are a few simple SQL commands to get you started:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create a Database
&lt;/h2&gt;

&lt;p&gt;First, you need a database to store your tables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;hr_system&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE DATABASE&lt;/code&gt; creates a new database named &lt;code&gt;hr_system&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is where all your data and tables will live.&lt;/p&gt;

&lt;p&gt;✅ Tip: After creating it, make sure to connect to the hr_system database before proceeding.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="k"&gt;c&lt;/span&gt; &lt;span class="n"&gt;hr_system&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Create a Schema
&lt;/h2&gt;

&lt;p&gt;A schema helps organize your tables inside the database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;hr_schema&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE SCHEMA&lt;/code&gt; creates a container (folder-like structure) for your tables.&lt;/p&gt;

&lt;p&gt;It’s especially useful when you have many tables or want to separate different areas of your system.&lt;/p&gt;

&lt;p&gt;✅ Tip: You can also skip this if you want to use the default &lt;code&gt;public&lt;/code&gt; schema.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Create a Table
&lt;/h2&gt;

&lt;p&gt;To create a new table for storing student information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;hr_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HR_DATASET&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;employee_id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;first_name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;last_name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;department&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="nb"&gt;CHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;gender&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;enrollment_date&lt;/span&gt; &lt;span class="nb"&gt;DATE&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE hr_schema.HR_DATASET&lt;/code&gt; means you’re creating the table &lt;code&gt;HR_DATASET&lt;/code&gt; inside &lt;code&gt;hr_schema&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;employee_id&lt;/code&gt; is a unique, auto-incremented number for each employee.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;first_name&lt;/code&gt; and &lt;code&gt;last_name&lt;/code&gt; store the employee’s name.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;department&lt;/code&gt; indicates which department the employee belongs to.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;age&lt;/code&gt; is stored as a fixed-length character field.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gender&lt;/code&gt; and &lt;code&gt;enrollment_date&lt;/code&gt; capture additional details about the employee.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Insert Data into the Table
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;HR_DATASET&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;last_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;department&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;gender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;enrollment_date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'John'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Doe'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Finance'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'29'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Male'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'2024-09-01'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;INSERT INTO&lt;/code&gt; tells SQL where to add the new record.&lt;/p&gt;

&lt;p&gt;We provide values for &lt;code&gt;first_name&lt;/code&gt;, &lt;code&gt;last_name&lt;/code&gt;, &lt;code&gt;department&lt;/code&gt;, &lt;code&gt;age&lt;/code&gt;, &lt;code&gt;gender&lt;/code&gt;, and &lt;code&gt;enrollment_date&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Retrieve Data with SELECT
&lt;/h2&gt;

&lt;p&gt;To view all the records in the table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;HR_DATASET&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT *&lt;/code&gt; fetches all columns and all rows from the &lt;code&gt;HR_DATASET&lt;/code&gt; table.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Update Data
&lt;/h2&gt;

&lt;p&gt;If you need to update an employee's department:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;HR_DATASET&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;department&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Human Resources'&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;employee_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;UPDATE&lt;/code&gt; modifies existing records.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SET&lt;/code&gt; changes the value of a specific column.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;WHERE&lt;/code&gt; ensures only the correct record is updated.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Delete Data
&lt;/h2&gt;

&lt;p&gt;To remove an employee from the table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;HR_DATASET&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;employee_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DELETE FROM&lt;/code&gt; removes specific data.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;WHERE&lt;/code&gt; is important to avoid deleting all records accidentally.&lt;/p&gt;

&lt;p&gt;&lt;a id="#point-four"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-on Project: Customer Order Management System
&lt;/h2&gt;

&lt;p&gt;In this project, you will create a simple Customer Order Management System. This system will help manage customer details, the products they purchase, and the orders they place. The goal is to create a database that can handle customer and order data effectively.&lt;/p&gt;

&lt;p&gt;Project Objective:&lt;br&gt;
You will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a database and schema.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create tables for customers, orders, and products.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Insert records.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Query the data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update and delete records.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Step 1: Create the Database
&lt;/h2&gt;

&lt;p&gt;Create a database called &lt;code&gt;customer_orders_system&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;customer_orders_system&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: This database will hold all the data for customer orders, including customer details, products, and orders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Create the Schema
&lt;/h2&gt;

&lt;p&gt;Create a schema called sales_schema:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: Organize your data into a dedicated schema for the sales system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Create the Customers Table
&lt;/h2&gt;

&lt;p&gt;Now, create a table to store customer information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;first_name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;last_name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;phone&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;address&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: This table will store customer details, such as name, email, phone number, and address.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Create the Products Table
&lt;/h2&gt;

&lt;p&gt;Next, create a table to store product information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;product_id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;product_name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;stock_quantity&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: This table holds the product details — name, price, and available stock.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the Orders Table
&lt;/h2&gt;

&lt;p&gt;Create a table to store order details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;order_date&lt;/span&gt; &lt;span class="nb"&gt;DATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;total_amount&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: This table holds the orders placed by customers. It includes references to the customer table and stores the total amount of the order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Create the Order Items Table
&lt;/h2&gt;

&lt;p&gt;Since an order can contain multiple products, we need a table to link products to orders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_items&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;order_item_id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;product_id&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product_id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;quantity&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;subtotal&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: This table stores the relationship between orders and the products within each order, including the quantity and subtotal for each product in the order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Insert Customer Records
&lt;/h2&gt;

&lt;p&gt;Now, insert some customer records into the customers table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;last_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Alice'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Johnson'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'alice.johnson@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'123-456-7890'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'123 Elm Street'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Bob'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Smith'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bob.smith@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'234-567-8901'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'456 Oak Avenue'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: Add some customers to the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 8: Insert Product Records
&lt;/h2&gt;

&lt;p&gt;Now, insert some products into the products table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stock_quantity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Smartphone'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tablet'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: Add products that customers can purchase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 9: Insert Orders
&lt;/h2&gt;

&lt;p&gt;Let’s now create some orders for the customers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;order_date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total_amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'2025-04-01'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1500&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'2025-04-02'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: Create orders for Alice and Bob.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 10: Insert Order Items
&lt;/h2&gt;

&lt;p&gt;Add products to each order by inserting records into the order_items table. Let’s assume Alice bought a Laptop and a Tablet, while Bob bought a Smartphone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_items&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subtotal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  &lt;span class="c1"&gt;-- Alice bought 1 Laptop&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  &lt;span class="c1"&gt;-- Alice bought 1 Tablet&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;-- Bob bought 1 Smartphone&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: Link the products to the orders, including the quantity and subtotal for each item.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 11: Retrieve Data
&lt;/h2&gt;

&lt;p&gt;Let’s query the system to retrieve records for all tables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_items&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 12: Update Product Stock
&lt;/h2&gt;

&lt;p&gt;Let’s say Bob purchased the last smartphone. Update the stock quantity for the smartphone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;stock_quantity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stock_quantity&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Smartphone'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: Learn how to update product inventory after an order is placed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 14: Delete an Order
&lt;/h2&gt;

&lt;p&gt;If you need to remove an order, say Alice’s order with ID 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sales_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objective: Practice deleting records from the database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 15: Review and Reflection
&lt;/h2&gt;

&lt;p&gt;Once you’ve completed this mini project:&lt;/p&gt;

&lt;p&gt;Review the relationships between customers, orders, products, and order items.&lt;/p&gt;

&lt;p&gt;Experiment by adding more customers, products, and orders.&lt;/p&gt;

&lt;p&gt;Reflect on how your system is tracking orders and inventory.&lt;/p&gt;

&lt;p&gt;&lt;a id="#point-five"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Pro tips: Understanding SQL Data Types and Constraints
&lt;/h2&gt;

&lt;p&gt;When working with SQL, it’s essential to understand the various data types and constraints to properly define your tables and columns. Here’s a quick summary of some commonly used SQL data types and constraints:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;Range/Details&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Integer&lt;/td&gt;
&lt;td&gt;&lt;code&gt;INT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores whole numbers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;age INT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Typically -2,147,483,648 to 2,147,483,647&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large Integer&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BIGINT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores large whole numbers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;employee_id BIGINT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Up to 9,223,372,036,854,775,807&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Character&lt;/td&gt;
&lt;td&gt;&lt;code&gt;VARCHAR(n)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores variable-length strings&lt;/td&gt;
&lt;td&gt;&lt;code&gt;first_name VARCHAR(100)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Max length varies (commonly up to 255 characters)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fixed Character&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CHAR(n)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores fixed-length strings (padded with spaces if shorter)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gender CHAR(10)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Max length typically 255 characters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large Text&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TEXT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores large strings of text (no predefined length)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;address TEXT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Varies by database (e.g., 65,535 characters in MySQL)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Decimal&lt;/td&gt;
&lt;td&gt;&lt;code&gt;DECIMAL(p, s)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores fixed-point numbers, precision (&lt;code&gt;p&lt;/code&gt;) and scale (&lt;code&gt;s&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;price DECIMAL(10, 2)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Max precision typically 65 digits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Floating Point&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FLOAT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores floating-point numbers with approximate precision&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rating FLOAT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Range typically -1.0E+308 to 1.0E+308&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Date&lt;/td&gt;
&lt;td&gt;&lt;code&gt;DATE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores date values (year, month, day)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;enrollment_date DATE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Format: &lt;code&gt;YYYY-MM-DD&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TIME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores time values (hours, minutes, seconds)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;order_time TIME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Format: &lt;code&gt;HH:MM:SS&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Datetime&lt;/td&gt;
&lt;td&gt;&lt;code&gt;DATETIME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores both date and time values&lt;/td&gt;
&lt;td&gt;&lt;code&gt;order_timestamp DATETIME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Format: &lt;code&gt;YYYY-MM-DD HH:MM:SS&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timestamp&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TIMESTAMP&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores date and time with automatic updates when records are modified&lt;/td&gt;
&lt;td&gt;&lt;code&gt;created_at TIMESTAMP&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Auto-updates on insert/update&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Boolean&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BOOLEAN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores true/false values&lt;/td&gt;
&lt;td&gt;&lt;code&gt;is_active BOOLEAN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Typically &lt;code&gt;TRUE&lt;/code&gt; or &lt;code&gt;FALSE&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Primary Key&lt;/td&gt;
&lt;td&gt;&lt;code&gt;PRIMARY KEY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Uniquely identifies records in a table&lt;/td&gt;
&lt;td&gt;&lt;code&gt;employee_id SERIAL PRIMARY KEY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Must be unique, cannot be NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Foreign Key&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FOREIGN KEY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates a relationship between tables by referencing another table's primary key&lt;/td&gt;
&lt;td&gt;&lt;code&gt;customer_id INT REFERENCES customers(customer_id)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ensures referential integrity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Not Null&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NOT NULL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ensures that a column cannot contain a &lt;code&gt;NULL&lt;/code&gt; value&lt;/td&gt;
&lt;td&gt;&lt;code&gt;first_name VARCHAR(100) NOT NULL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Column must always have a value&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Auto-Increment&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SERIAL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Automatically generates unique numbers for new records (commonly used for primary keys)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;employee_id SERIAL PRIMARY KEY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Similar to &lt;code&gt;AUTO_INCREMENT&lt;/code&gt; in MySQL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unique&lt;/td&gt;
&lt;td&gt;&lt;code&gt;UNIQUE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ensures all values in a column are distinct&lt;/td&gt;
&lt;td&gt;&lt;code&gt;email VARCHAR(100) UNIQUE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No duplicate values allowed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Where To Go From Here
&lt;/h2&gt;

&lt;p&gt;Now that you've learned the basics of SQL, it’s time to take your skills to the next level. Here’s what you should focus on next:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Learn SQL JOINs — Master how to combine data from multiple tables using SQL JOINs like INNER JOIN, LEFT JOIN, and RIGHT JOIN. This is essential for working with relational databases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Understand SQL Indexes — Learning how SQL indexes work will help you optimize your database performance and make your queries run faster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Work on SQL Project Ideas — The best way to improve your SQL skills is through practice. Start by building small projects like:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- A blog database to manage posts, authors, and comments

- An inventory management system to track products, stock levels, and 
  suppliers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Lastly, Consistent SQL practice and real-world projects will help you master database management and prepare you for advanced topics like stored procedures and database optimization.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>database</category>
      <category>datascience</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
