Translating canonical SQL to imperative code in Coq