第12课 联结表
- 12.1 联结
- 12.1.1 关系表
- 12.1.2 为什么使用联结
- 12.2 创建联结
- SELECT vend_name, prod_name, prod_price
- FROM Vendors, Products
- WHERE Vendors.vend_id = Products.vend_id;
- 12.2.1 WHERE 子句的重要性
- 12.2.2 内连接
- SELECT vend_name, prod_name, prod_price
- FROM Vendors INNER JOIN Products
- ON Vendors.vend_id = Products.vend_id;
- 12.2.3 联结多个表
- SELECT prod_name, vend_name, prod_price, quantity
- FROM OrderItems, Products, Vendors
- WHERE Products.vend_id = Vendors.vend_id
- AND OrderItems.prod_id = Products.prod_id
- AND order_num = 20007;
- 12.3 小结