基础的题目还是多看看书吧,
表和表关联
select * from A left/right/inner join B ON A.ID=B.ID
where A.NAME='张三'
敲斜杠的地方看需求使用,基本句式结构是这样的。
select s_id,s_name,score from Student s, Class c, Student_Class sc
where s.s_id = sc.s_id and sc.c_id = c.c_id and c.c_name = 'Class One' and s.score > 80;