1. Internal connection
i. No connection
select * from t_book, t_bookType;
ii. Where =
select bookName, author, bookTypeName from t_book, t_bookType where t_book.bookTypeId = t_bookType.id;
iii. Abbreviation
select tb.bookName, tb.author, tbt.bookTypeName from t_book tb, t_bookType tbt where tb.bookTypeId = tbt.id;
2. External connection
Be careful: left join --> all information of first table
right join --> all information of second table
select * from t_book tb left join t_bookType tbt on tb.bookTypeId = tbt.id;
select * from t_book tb right join t_bookType tbt on tb.bookTypeId = tbt.id;
3. Multi condition --> and
select tb.bookName, tb.author, tb.price, tbt.bookTypeName from t_book tb, t_bookType tbt where tb.bookTypeId = tbt.id and tb.price>70;