Save query from an existing table

Closes #44