CREATE TABLE transactions_lots (transaction_id DECIMAL, lot_id DECIMAL)
CREATE TABLE lots (lot_id DECIMAL, investor_id DECIMAL, lot_details TEXT)
CREATE TABLE purchases (purchase_transaction_id DECIMAL, purchase_details TEXT)
CREATE TABLE transactions (transaction_id DECIMAL, investor_id DECIMAL, transaction_type_code TEXT, date_of_transaction TIME, amount_of_transaction DECIMAL, share_count TEXT, other_details TEXT)
CREATE TABLE ref_transaction_types (transaction_type_code TEXT, transaction_type_description TEXT)
CREATE TABLE investors (investor_id DECIMAL, investor_details TEXT)
CREATE TABLE sales (sales_transaction_id DECIMAL, sales_details TEXT)

Show the average amount of transactions for different lots, ordered by 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)
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") NULLS FIRST