sqlite3 data.db '.mode csv' 'SELECT * FROM employees;' > employees.csv
Export a SQLite table to a CSV file
Dot commands like .mode csv change the output format for the queries that follow, here switching to comma-separated values. The shell redirect (>) saves the query result into employees.csv. This is the standard recipe for moving SQLite data into spreadsheets and analysis tools. Other modes include .mode json and .mode markdown.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.