Q: Find the order details of each customer who made an order. Output the customer's first name, last name, and the city along with the order details.
如果我们想知道每个用户买了什么东西,就需要将customers和orders这两个table关联起来,否则如果只看orders这个table,那我们就只有一些customer_id和对应的order_id的信息,但我们不知道用户的具体信息,所以我们需要讲customers table和orders table关联起来,引入用户信息。
. check 1point3acres for more.
通过例子可以看到,我们就需要一个语法来帮我们把两个table关联起来,最终得到我们想要的信息,而这个语法就是Join。
Q: Find the details of each customer regardless of whether the customer made an order. Output the customer's first name, last name, and the city along with the order details.