Author: ShairyPortfolio

  • MySQL RIGHT JOIN

    MySQL RIGHT JOIN

    RIGHT JOIN returns all the rows from the right table even if no matching rows have been found in the left table. Its returned null if no row matches the condition on left table. Syntax SELECT column_list FROM table_1 RIGHT JOIN table_2 ON join_condition; Code language: SQL (Structured Query Language) (sql) If both tables use…

  • MySQL LEFT OUTER JOIN

    MySQL LEFT OUTER JOIN

    LEFT JOIN returns all the rows from the left table even if no matching rows have been found in the right table. Its returned null if no row matches the condition on right table. Syntax SELECT column_list FROM table_1 LEFT JOIN table_2 ON join_condition; If both tables use the same column to match, you can…

  • MySQL INNER/ SIMPLE JOIN

    MySQL INNER/ SIMPLE JOIN

    INNER JOIN returns rows from both tables that satisfy with given conditions. Syntax SELECT column_list FROM table_1 INNER JOIN table_2 ON join_condition; Example SELECT r.rollno, r.name, f.fees, f.status FROM register r INNER JOIN fees f ON r.rollno = f.id; If both tables use the same column to match, you can use the USING clause also…

  • Joins in MySQL

    Joins in MySQL

    JOINS are used to retrieve data from multiple tables. It is performed whenever you need to fetch records from one (Self Join), two or more tables based on the common column between the tables and tables are mutually related using primary and foreign keys. Types of Join MySQL INNER JOIN (or sometimes called simple join)…