Completed SQL query variations.