Geek Slack

My SQL Tutorial
    About Lesson


    MySQL INNER JOIN Keyword


    MySQL INNER JOIN Keyword

    The INNER JOIN keyword in MySQL is used to combine rows from two or more tables based on a related column between them.

    Example:

    SELECT orders.order_id, customers.customer_name
    FROM orders
    INNER JOIN customers ON orders.customer_id = customers.customer_id;

    This query retrieves the order ID and customer name for orders placed by customers.

    The INNER JOIN keyword returns records that have matching values in both tables, making it useful for retrieving related data from multiple tables.