MySQL JOINSMySQL JOINS are used with SELECT statement. It is used to retrieve data from multiple tables. It is performed whenever you need to fetch records from two or more tables. There are three types of MySQL joins:
MySQL Inner JOIN (Simple Join)The MySQL INNER JOIN is used to return all rows from multiple tables where the join condition is satisfied. It is the most common type of join. Syntax: Image representation: Let's take an example: Consider two tables "officers" and "students", having the following data. Execute the following query: Output: MySQL Left Outer JoinThe LEFT OUTER JOIN returns all rows from the left hand table specified in the ON condition and only those rows from the other table where the join condition is fulfilled. Syntax: Image representation: Let's take an example: Consider two tables "officers" and "students", having the following data. Execute the following query: Output: MySQL Right Outer JoinThe MySQL Right Outer Join returns all rows from the RIGHT-hand table specified in the ON condition and only those rows from the other table where he join condition is fulfilled. Syntax: Image representation: Let's take an example: Consider two tables "officers" and "students", having the following data. Execute the following query: Output: Next TopicMySQL Inner Join |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India