[]
In the Resource Portal, open or create a Dataset or Data Source. In this case, an existing Direct Dataset is used, CustomerOrders.
You will now notice a SQL View toggle on the right side of the Designer.
Enable the toggle.

When you switch to SQL View, a confirmation notice will appear outlining the changes that will take place. Click Yes to apply the changes.

Switch to SQL View to:
View the auto-generated SQL query.
Edit or replace the SQL with your own optimized query.

Click Save to apply your changes.