A CTE names a step of a query so the next step can use it:
WITH monthly AS (
SELECT DATE_TRUNC('month', order_ts) AS month, SUM(order_total) AS revenue
FROM orders GROUP BY month
)
SELECT month, revenue FROM monthly
WHERE revenue > (SELECT AVG(revenue) FROM monthly);
Each step reads like a sentence, and you can test them one at a time.
A view saves a query under a name: CREATE VIEW sandbox.big_orders AS SELECT .... Querying the view runs its query, so the results are always current. CREATE OR REPLACE VIEW changes one. A SECURE view also hides its definition from people who can only query it.
Your role can create objects in RIDGELINE.SANDBOX but not in SALES, so build there.