What I do to get this query right?
I tried to create a subquery using the SELECT clause and I get an error:
Syntax error: Expected end of input but got keyword SELECT at [5:3]
In your query you are missing the group by clause before the FROM.
select ...,
COUNT(Orders.order_id) as number_of_orders,
(select ... group by orders.order_id)
FROM `..`