SELECT col1, col2 (i.e. projections) can be implemented with several variants of Unix utilities:
awk are the two most obvious.
2. JOIN can be implemented with the… wait for it
join utility. You’ll need to sort its input first, though.
GROUP BY operations can be performed with combinations of
sort with or without the -urnk options (look at the man page — you can apply options to individual sort keys), and
uniq with or without the -c option. Many more can be done with 20 or 30 characters of awk.
- Output formatting is easy with
column, especially with the -t option.
Reminded me of the now vanished from the Internet Ted Dziuba’s Taco Bell Programming.
Original title and link: Implementing SQL With Unix Utilities ( ©myNoSQL)