Sequence NODE_288
Medium

Inner Join Users with Orders

SQL
Technical Specification

Write a query to list each order with the user's name and email who placed the order.

Input/Output Samples
Input:orders + users
Output:order_id, user_name, user_email
Optimal Logic Path
SELECT 
  o.id AS order_id,
  u.name AS user_name,
  u.email AS user_email,
  o.total_amount
FROM orders o
INNER JOIN users u
  ON u.id = o.user_id;
Architectural Deep-Dive
INNER JOIN returns only rows that match in both tables, connecting orders to their owners.