Csv table queries

fix and test