fixed sql bugs
add query examples