Hands-on task
SQLite: INNER JOIN of two tables
The database /root/shop.db has tables customers(id, name) and orders(id, customer_id, amount). Write a query with an INNER JOIN that, for each order, outputs the customer's name and the order amount, and save the result to /root/out.txt.
The result set must include only customers that have orders (a customer with no orders must produce no rows). The default row format is name|amount.
- sqlite3
- inner join
- on clause
- table joins
- foreign key