@Alireza355
Absolutely. You can also do more flexible things, putting known values into the string to make a SQL query bespoke for your current requirements. Every QueryDef also contains the SQL associated with it too. This can be used sometimes as a start point if you simply want to change a (some) known item(s).
There are times though (see below) when it is not too good an idea to use SQL string in place of a saved QueryDef.
NB. For maintenance purposes, it is clearer what a QueryDef is doing than some string hidden in code somewhere in one of your modules.
@Alireza355
Slower actually.
A QueryDef is saved with some optimisation info (at least after it's been run the first time). A SQL string is not optimised, and needs this step to be performed before getting down to the work it does.
I would say that it's rare for this to make such a difference that it would put someone off though.