Hands-on task
This task is step 7 of the course “SQL with SQLite”
SQLite: combine two sets of rows (UNION)
The database /root/users.db has two tables: active_users(name TEXT) and archived_users(name TEXT). Write a query with UNION that returns a combined list of names without duplicates (the same name may appear in both tables), and write the result to /root/all_users.txt — one name per line.
Reference:sqlite3
What you'll practise:
- union
- combining result sets
- deduplication
- select
- sqlite3