postgres=# SELECT * FROM sales;
id | store | amount
----+---------+--------
1 | Store_A | 30000
2 | Store_A | 40000
3 | Store_A | 35000
4 | Store_B | 25000
5 | Store_B | 20000
6 | Store_B | 15000
7 | Store_C | 120000
8 | Store_D | 50000
9 | Store_D | 60000
(9 rows)
postgres=# select * from orders;
order_id | customer_id | order_date | amount
----------+-------------+------------+--------
1 | 1 | 2024-08-01 | 100.00
2 | 2 | 2024-08-02 | 150.00
3 | 3 | 2024-08-03 | 200.00
4 | 5 | 2024-08-04 | 250.00
(4 rows)
postgres=# select * from customers;
customer_id | customer_name
-------------+---------------
1 | Alice
2 | Bob
3 | Charlie
4 | Diana
(4 rows)
上記のようなテーブル orders, customers が存在する場合に、下記の実行結果が得られる SQL を答えなさい
order_id | customer_id | order_date | amount | customer_id | customer_name
----------+-------------+------------+--------+-------------+---------------
1 | 1 | 2024-08-01 | 100.00 | 1 | Alice
2 | 2 | 2024-08-02 | 150.00 | 2 | Bob
3 | 3 | 2024-08-03 | 200.00 | 3 | Charlie
(3 rows)
エラーが解消されるように修正された SQL をすべて答えなさい。
© EDUCO All Rights Reserved.