An inner join lets you combine columns from two or more tables into a single result set.
To join data from two tables, you code the name of the first table in the FROM clause and the name of the second table within the JOIN keyword.
You can code an ON phrase to specify a join condition and filter the results.
Note that if the joined tables contain columns that share the same name, you must qualify them with their table name so MySQL can distinguish between them.
To code a qualified column name, you enter the table name and a period in front of the column name.
If you forget to qualify those columns, MySQL returns an error indicating that the column name is ambiguous.
Sometimes you'll see the JOIN keyword preceded by the INNER keyword.
This keyword is optional and can be omitted.
Although you code most inner joins using the equal operator, you can compare two tables based on other conditions too.
For example, you can use the greater than or less than operators for an inner join condition.
You may occasionally need to join to a table that's in another database. In this case you need to qualify that table with the name of the database.
Remember to qualify an ambiguous column name anywhere it appears in the statement.
EXERCISES for your SELF-TRAINING:
SCRIPT FOR THE EXAMPLES:
Led Digital Marketing Efforts of Top 500 e-Retailers.
Worked with Top Brands at Leading Agencies.
Successfully Managed Over $50 million in Digital Ad Spend.
Developed Strategies and Processes that Enabled Brands to Grow During an Economic Downturn.
Taught Advanced Internet Marketing Strategies at the graduate level.
Your Cart 0
Manage research, learning and skills at defaultlogic.com. Create an account using LinkedIn to manage and organize your omni-channel knowledge. defaultlogic.com is like a shopping cart for information -- helping you to save, discuss and share.