Subject-auxiliary verb inversion is used only in direct questions, not in indirect (embedded) questions.
The store opens ...
I don't know when the store opens. (No inversion, because it's indirect.)
The store does open ... (Expand
opens into
does open in preparation for the inversion process.*)
When does the store open? (Invert the order of subject and auxiliary verb.)
They live ...
I have no idea where they live. (No inversion, because it's indirect.)
They do live ... (Expand
live into
do live in preparation for the inversion process.*)
Where do they live? (Invert the order of subject and auxiliary verb.)
They have put the book ...
I'm not sure where they have put the book.
They have put the book ... (No expansion needed for inversion because
have is already an auxiliary verb.)
Where have they put the book?
*This step is needed because the original form has no auxiliary verb to invert with the subject.
CJ