July 2017
Intermediate to advanced
896 pages
23h 12m
English
Richard Earp
Sikha Bagui
There is often a need to select data from columns from more than one table. A join combines columns and data from two or more tables (and in some cases, of one table with itself). The tables are listed in a FROM clause of a SELECT statement, and a join condition between the two tables is specified in a WHERE clause.
For example, suppose we create a table called Emp with an employee number (Empno) and a job code (JobCode) as follows:
Emp
Empno JobCode
101 cp
102 ac
103 de
And then we create a second table called Job, which contains the job code (JobC) and a job title (JobTitle):
Job
JobC JobTitle
de dentist
ac accountant
do doctor
We can use the following join command:
SELECT * ...
Read now
Unlock full access