MulaiMulai sekarang secara gratis

RIGHT, LEFT, and OUTER joins

While the INNER JOIN is one of the most used joins, other times, you will also need to join data that includes results not matching the join condition from one or both of the tables in the join. This exercise will walk through the various join types in BigQuery and how you use them.

Latihan ini adalah bagian dari kursus

Introduction to BigQuery

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

WITH orders AS (
  SELECT order_id, item.product_id
  FROM ecommerce.ecomm_orders, UNNEST(order_items) item
  LIMIT 10
),
products AS (
  SELECT product_id
  FROM ecommerce.ecomm_products
  LIMIT 10000
)
SELECT
	COUNT(*) AS orders
FROM orders o
-- Add the correct join to include all the values from the "orders" table
___ products p ON p.product_id = o.product_id;
Edit dan Jalankan Kode