Teaching it CTEs, subqueries, generic column identifiers (1,2,3), unions, left outer join, like, regexp, JSON, array, array_agg, concat, coelesce, trunc, etc. would be fun.<p>But something else humans can do is look at the data to construct patterns as another way to extract data. To some degree it requires some (bad) inductive reasoning approaches like “I’ll assume maybe most or all data in this column has this format.” “Oops, it didn’t, so let’s tweak it to look like this, to cover it sometimes also being empty string or null.”