Infolinks In Text Ads

What is Equijoin

To determine the name of an employee’s department, you compare the value in the
DEPTNO column in the EMP table with the DEPTNO values in the DEPT table. The
relationship between the EMP and DEPT tables is an equijoin that is, values in the
DEPTNO column on both tables must be equal.
Frequently this type of join involves primary and foreign key complements.
E.g
SELECT emp.empno, emp.ename, emp.deptno,
dept.deptno, dept.loc
FROM emp, dept
WHERE emp.deptno=dept.deptno;
* The SELECT clause specifies the column names to retrieve:
- employee name, employee number, and department number, which are column
in the EMP table
- department number, department name, and location, which are column in the
dept table
* The FORM clause specifies the two tables that the database must access
- EMP table
- DEPT table
* The WHERE clause specifies how the tables are to be joined
EMP.DEPTNO=DEPT.DEPTNO
Because the DEPTNO column is common to both tables.
In addition to the join, you may have criteria for you WHERE clause.

Newer Post Older Post

Leave a Reply

Powered by Blogger.