HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

13 MySQL Tutorial for Beginners: Table Aliases, Self Joins

12,663 views October 27, 2016 7:13

Watch on YouTube
Channelgolearnfast

Description from the creator

When you name a table to be joined in the FROM clause, you can refer to that table by an alias.
A table alias is just an alternative table name and you code it just near the table’s name.
After you assign a table alias, you must use the alias in place of the original table name everywhere in the query.
It’s recommended to use abbreviations of the table names which consist of just one letter or two.
After you assign a table alias, you must use the alias in place of the original table name everywhere in the query.
In other words you can't use the original table name anymore. Otherwise, MySQL returns an error message.

Although a join condition typically consists of a single comparison, you can include two or more comparisons in a join condition using the AND and OR operators.
You can also join more than two tables. You can think of a multi-table join as a series of two-table joins proceeding from left to right.

If you need a WHERE clause and an ORDER BY clause, you code them to the end of the statement.
Note that the conditions specified in the WHERE clause is applied after the condition specified in the ON phrase.

A self-join is a common join that joins a table to itself.
Since in a self-join you use the same table twice, you must use aliases to distinguish one occurrence of the table from the other .
In addition, the query must qualify each column name with a table alias since every column occurs in both tables.

EXERCISES for your SELF-TRAINING:
golearnfast.com/Quizzes.php?_SelectSmallerGroup…

SCRIPT FOR THE EXAMPLES:
golearnfast.com/files/lessons_material/lesson_2…

SUBSCRIBE!
youtube.com/channel/UCMEaGDoHU7c9tWyafZ9vC6Q?su…

FACEBOOK
facebook.com/golearnfast

GOOGLE+
plus.google.com/u/0/b/101326338689489366802/

About this tutorial

golearnfast published this 7:13 video tutorial on October 27, 2016. It has been watched 12,663 times on YouTube.

Category
Education
Duration
7:13
Published
October 27, 2016
Views
12,663
Likes
88

Tags

Share

This tutorial in other languages