add sql query.