Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Error’d: You Talkin’ to Me?

      September 20, 2025

      The Psychology Of Trust In AI: A Guide To Measuring And Designing For User Confidence

      September 20, 2025

      This week in AI updates: OpenAI Codex updates, Claude integration in Xcode 26, and more (September 19, 2025)

      September 20, 2025

      Report: The major factors driving employee disengagement in 2025

      September 20, 2025

      DistroWatch Weekly, Issue 1140

      September 21, 2025

      Distribution Release: DietPi 9.17

      September 21, 2025

      Development Release: Zorin OS 18 Beta

      September 19, 2025

      Distribution Release: IPFire 2.29 Core 197

      September 19, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      @ts-ignore is almost always the worst option

      September 22, 2025
      Recent

      @ts-ignore is almost always the worst option

      September 22, 2025

      MutativeJS v1.3.0 is out with massive performance gains

      September 22, 2025

      Student Performance Prediction System using Python Machine Learning (ML)

      September 21, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      DistroWatch Weekly, Issue 1140

      September 21, 2025
      Recent

      DistroWatch Weekly, Issue 1140

      September 21, 2025

      Distribution Release: DietPi 9.17

      September 21, 2025

      Hyprland Made Easy: Preconfigured Beautiful Distros

      September 20, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»SQL Joins

    SQL Joins

    June 23, 2025

    A Join clause is used to combine two or more tables in a database by merging the records from the tables based on a related column between them.

    Example JOIN using two tables: employees and departments

    employees table:

    id emp_name department_id joining_date
    1 Anuj kumar 101 2025-01-01
    2 Rahul Singh 102 2025-02-16
    3 John Doe 102 2025-02-25
    4 Alex 104 2025-04-20
    5 Alice null 2025-05-24
    6 Garima 110 2025-05-28

    departments tables:

    id department_name
    101 IT
    102 HR
    103 Accounts
    104 Operations
    105 Marketing
    106 Legal

    Example

    SELECT employees.id,employees.emp_name, departments.department_name
    FROM employees
    JOIN departments
    ON employees.department_id = departments.id;

     Output will be:

    id emp_name department_name
    1 Anuj kumar IT
    2 Rahul Singh HR
    3 John Doe HR
    4 Alex Operations

    Only rows where department_id matches departments.id are shown.

    Alice is excluded because department_id is NULL.

    Garima is also excluded because 110 does not exist in the departments table.

    There are five common types of SQL JOINs:

    Inner Join: Returns only the rows with matching values in both tables.

    Right Outer Join: Returns all rows from the right table and matched rows from the left table; unmatched left-side values are NULL.

    Left Outer Join: Returns all rows from the left table and matched rows from the right table; unmatched right-side values are NULL.

    Full outer Join: Returns all rows when there is a match in one of the tables; unmatched rows from both sides are filled with NULL.

    Cross Join: Returns the Cartesian product of both tables (every row from the first table joined with every row from the second).

    The post SQL Joins appeared first on PHPGurukul.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDividing Collections with Laravel’s splitIn Helper
    Next Article LLMs factor in unrelated information when recommending medical treatments

    Related Posts

    Development

    @ts-ignore is almost always the worst option

    September 22, 2025
    Development

    MutativeJS v1.3.0 is out with massive performance gains

    September 22, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    This big cult hit classic arcade-style fighter has finally arrived for Xbox — here’s what you need to know

    News & Updates

    CVE-2022-42449 – HCL Domino Volt HTML Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-49876 – Metagauss ProfileGrid SQL Injection

    Common Vulnerabilities and Exposures (CVEs)

    EchoLeak Vulnerability in Microsoft 365 Copilot

    Security

    Highlights

    Distribution Release: HeliumOS 10

    July 28, 2025

    The DistroWatch news feed is brought to you by TUXEDO COMPUTERS. HeliumOS is an atomic and immutable distribution which is built upon AlmaLinux OS. The project has published HeliumOS 10 which uses Btrfs as the default filesystem, zsh for the shell, and offers version 6.12 of the Linux kernel. “HeliumOS 10 has released with some notable changes from earlier….

    CVE-2012-10035 – Turbo FTP Server Buffer Overflow Vulnerability

    August 5, 2025

    CVE-2025-48275 – Dastan800 Visual Header Missing Authorization Vulnerability

    May 23, 2025

    CVE-2024-46993 – Electron Heap Buffer Overflow

    July 1, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.