What are the complexities MySQL joins involve?

MySQLMySQLi Database

Actually, in simple words, we can say that a join between tables is an extension of a single-table SELECT statement but it involves the additional complexities:

Need to specify all the tables

We need to specify all the tables in FROM clause which are involved in the join. It is in contrast with the SELECT statement in which only one table name is necessary.

Need to specify the matching conditions

We just need to specify the matching conditions based on which a join matches the records in one table with a record in another table. The conditions often are given in the WHERE clause, but the particular syntax depends on the type of join.

Need to specify list of columns

We just need to specify the list of columns to display. They can include columns from any or all of the tables involved in the join.

Need to indicate specific table for specific column

If a join refers to a column name that appears in more than one table, the name is ambiguous and we must indicate which table we mean each time we refer to the column.

Published on 20-Feb-2018 16:01:42