[sql] attach sql queries to data series