Solve the following sql problem:
What was the total unit sold for item 10 when the average temperature was below the median temperature?

Schema:
SCHEMA:
- Table: sales_in_weather
  - Column: date
    - Samples: [2012-01-01, 2012-01-01, 2012-01-01, 2012-01-01, 2012-01-01]
  - Column: store_nbr
    - Samples: [1, 1, 1, 1, 1]
  - Column: item_nbr
    - Samples: [1, 2, 3, 4, 5]
  - Column: units
    - Samples: [0, 0, 0, 0, 0]
- Table: weather
  - Column: station_nbr
    - Samples: [1, 1, 1, 1, 1]
  - Column: date
    - Samples: [2012-01-01, 2012-01-02, 2012-01-03, 2012-01-04, 2012-01-05]
  - Column: tmax
    - Samples: [52, 50, 32, 28, 38]
  - Column: tmin
    - Samples: [31, 31, 11, 9, 25]
  - Column: tavg
    - Samples: [42, 41, 22, 19, 32]
  - Column: depart
    - Samples: [None, None, None, None, None]
  - Column: dewpoint
    - Samples: [36, 26, 4, -1, 13]
  - Column: wetbulb
    - Samples: [40, 35, 18, 14, 25]
  - Column: heat
    - Samples: [23, 24, 43, 46, 33]
  - Column: cool
    - Samples: [0, 0, 0, 0, 0]
  - Column: sunrise
    - Samples: [None, None, None, None, None]
  - Column: sunset
    - Samples: [None, None, None, None, None]
  - Column: codesum
    - Samples: [RA FZFG BR,  ,  ,  ,  ]
  - Column: snowfall
    - Samples: [None, None, None, None, None]
  - Column: preciptotal
    - Samples: [0.05, 0.01, 0.0, 0.0, 0.0]
  - Column: stnpressure
    - Samples: [29.78, 29.44, 29.67, 29.86, 29.67]
  - Column: sealevel
    - Samples: [29.92, 29.62, 29.87, 30.03, 29.84]
  - Column: resultspeed
    - Samples: [3.6, 9.8, 10.8, 6.3, 6.9]
  - Column: resultdir
    - Samples: [20, 24, 31, 27, 25]
  - Column: avgspeed
    - Samples: [4.6, 10.3, 11.6, 8.3, 7.8]
- Table: relation
  - Column: store_nbr
    - Samples: [1, 2, 3, 4, 5]
  - Column: station_nbr
    - Samples: [1, 14, 7, 9, 12]

SELECT SUM(T5.units) FROM weather AS T4 INNER JOIN sales_in_weather AS T5 ON T4.`date` = T5.`date` INNER JOIN relation AS T6 ON T5.store_nbr = T6.store_nbr WHERE T5.item_nbr = 10 AND T4.tavg < ( SELECT AVG(T1.tavg) FROM weather AS T1 INNER JOIN sales_in_weather AS T2 ON T1.`date` = T2.`date` INNER JOIN relation AS T3 ON T2.store_nbr = T3.store_nbr WHERE T2.item_nbr = 10 )