12 MySQL Tutorial for Beginners: Inner Joins

preview_player
Показать описание
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:

SUBSCRIBE!

FACEBOOK

GOOGLE+
Рекомендации по теме
Комментарии
Автор

Took me 3 days of experimenting and finally a search for a video to understand how these joins are done correctly. Thank you!

StarGazerTom
Автор

Why don't you have more subs than this? This is an excellent video, very informative and very well edited. I'm shocked, seriously!

steliosm.
Автор

VERY clear explanation.. thank you.. recommended for beginners

eklavyyapopat