Relational Shell Programming

Submitted by Michael Reichner on Sat, 01/14/2012 - 09:32

"Shell scripts commonly, if unknowingly, compose five (of six) primitive relational-algebraic operations on these tables: union, difference, projection, selection and renaming:

cat acts like union;
sed and grep act like selection;
cut acts like projection;
awk can perform renaming; and
diff acts (almost) like difference.

Relational algebra (whose sixth primitive operation is Cartesian product) is equivalent to both relational calculus and SQL.

Cartesian product (and equijoin) are not difficult to create in bash."

http://matt.might.net/articles/sql-in-the-shell/

if unknowingly, indeed...