You can restrict users from executing your queries, by assigning Authorization Group to Query Infoset. Now, users having the authorization to the Authorization Group can execute the Query.
The field ‘authorization group’ allows you to enter an authorization group up to eight characters long. If you specify an authorization group, it is inherited as an attribute by every report generated for a query via this InfoSet. This means that only users authorized in their user master records to execute programs from this authorization group can execute these queries. Authorization groups thus provide a way of protecting reports generated by the query from unauthorized execution.
In SQ02: Change InfoSet > Goto Global Properties > Enter in Authorization group
In SQ01: Query > More functions > Generate program