sqlite3 data.db -header -column 'SELECT dept, COUNT(*), AVG(salary) FROM employees GROUP BY dept;'
Query per-dept counts and average salary from SQLite
sqlite3 runs SQL directly against a database file, here data.db. The -header and -column flags format the output as a readable aligned table with column names. The query groups employees by department and reports each group's row count and average salary, a group-by summary. This is the fastest way to interrogate a SQLite database without a GUI.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.