Is the UNION ALL following best practice?

https://www.codecademy.com/courses/sql-table-transformation/lessons/set-operations/exercises/union-all?action=resume_content_item

Curious to see what other’s thoughts are on this. It seems like it wouldn’t be best practice to create another sub-query to get the proper answer. Would the better query look more like this?

Create the union as a temporary table, with just the sales_price column, don’t use ID. Then AVG up sales_price to get the answer.

SELECT 
        AVG(sale_price) AS avg_price
FROM (SELECT sale_price FROM order_items
	     UNION ALL
	     SELECT sale_price FROM order_items_historic);

SELECT
avg(sale_price) AS avg_price
FROM
order_items
UNION ALL
SELECT
avg(sale_price) AS avg_price
FROM
order_items_historic

or something like this might work.
Subqueries are made if you want to i.e. select all records above the average sale_price
or to retrieve i.e. the sum from order_details and make a 1 to 1 relation with orders, assumed that you actually have a 1 to many relation between orders and order_details.