Source: https://til.simonwillison.net/sqlite/one-line-csv-operations
sqlite3 \
:memory: \
-cmd '.mode csv' \
-cmd '.import taxi.csv taxi' \
'SELECT passenger_count, COUNT(*), AVG(total_amount) FROM taxi GROUP BY passenger_count'
- Add
-cmd '.mode column'
to output in columns instead - Add
-cmd '.mode markdown'
to get a Markdown table - Show all modes
sqlite3 -cmd '.help mode'