qis a command line tool that allows direct execution of SQL-like queries on CSVs/TSVs (and any other tabular text files).
qtreats ordinary files as database tables, and supports all SQL constructs, such as WHERE, GROUP BY, JOINs etc. It supports automatic column name and column type detection, and provides full support for multiple encodings.
An example of using
q to count distinct values of a specific field (uuid of clicks data)
q -H -t "SELECT COUNT(DISTINCT(uuid)) FROM ./clicks.csv"