http://xuesql.cn/lesson/select_queries_with_joins
内连接 inner join
外连接
左连接 left join
右连接 right join
select * from 表1 inner join 表2 where 关联字段1=关联字段2;(这个居然能使用离谱)
记住需要加上英文分号
select * from 表1 left join 表2 on 表1.id=表2.id;
然后就是排序
order by
desc
asc
1
select *
from Movies inner join Boxoffice
where Movie_id=Id
2
select *
from Movies inner join Boxoffice
where Movie_id=Id and International_sales>Domestic_sales
3
select *
from Movies inner join Boxoffice
where Movie_id=Id order by rating desc
4
- 【联表】每部电影按国际销售额比较,排名最靠前的导演是谁,国际销量多少