Makes a query on a slq database from a codebar