Вы находитесь на странице: 1из 1

Employee

Name
Harry
Sally
George
Harriet

EmpId
3415
2214
3401
2202

DeptName
Finance
Sales
Finance
Production

Dept
DeptName Manager
Sales
Harriet
Production Charles

Cross product between Employee and Dept gives:


Name
Harry
Harry
Sally
Sally
George
George
Harriet
Harriet

EmpId
3415
3415
2214
2214
3401
3401
2202
2202

DeptName
Finance
Finance
Sales
Sales
Finance
Finance
Production
Production

DeptName
Sales
Production
Sales
Production
Sales
Production
Sales
Production

Manager
Harriet
Charles
Harriet
Charles
Harriet
Charles
Harriet
Charles

So, natural join between Employee and Dept gives:


Name
Sally
Harriet

EmpId
2214
2202

DeptName DeptName Manager


Sales
Sales
Harriet
Production Production Charles

Вам также может понравиться