#730: Restructure SQL query substitution in 'data_creator.py'

Resolves #730.