SQL · ByteDance · Medium
You are given the order log of a food-delivery marketplace. The orders table holds one row per placed order, with columns order_id (BIGINT, primary key), customer_id (BIGINT), restaurant_id (BIGINT), order_ts (TIMESTAMP, the moment the order was submitted) and order_amount (NUMERIC, the order's gross merchandise value). The customers table contains only customer_id (BIGINT, primary key), and restaurants contains only restaurant_id (BIGINT, primary key). The following terms…
Checking your access…