笛卡儿积
1. select * from t1,t2;
2. select * from t1 join t2;
=
select * from t1 inner join t2;
theta连接
1. select * from t1,t2 where t1.属性 θ t2.属性;
2. select * from t1 inner join t2 on t1.属性 θ t2.属性;
自然连接
普通自然连接
1. select * from t1 natural join t2;
2. select * from t1 inner join t2 using(public_field);
=
select * from t1 join t2 using(public_field);
自然左连接
1. select * from t1 natural left join t2;
2. select * from t1 left join t2 using(public_field);
自然右连接
1. select * from t1 natural right join t2;
2. select * from t1 r join t2 using(public_field);
mysql连接表