Create query extract