implementing list export sql queries