What is the average amount of transactions for the lot with id 3?
select t2.lot_id, avg(amount_of_transaction) from transactions as t1 join transactions_lots as t2 on t1.transaction_id = t2.transaction_id where t2.lot_id = 3 group by t2.lot_id
Show the average amount of transactions for all different lots.
select t2.lot_id, avg(amount_of_transaction) from transactions as t1 join transactions_lots as t2 on t1.transaction_id = t2.transaction_id group by t2.lot_id
Could you please order the results by the average amount of transactions?
select t2.lot_id, avg(amount_of_transaction) from transactions as t1 join transactions_lots as t2 on t1.transaction_id = t2.transaction_id group by t2.lot_id order by avg(amount_of_transaction)