-- Database schema
| cars : id [ INTEGER ] primary_key , train_id [ INTEGER ] cars.train_id = trains.id , position [ INTEGER ] , shape [ TEXT ] , len [ TEXT ] , sides [ TEXT ] , roof [ TEXT ] , wheels [ INTEGER ] , load_shape [ TEXT ] , load_num [ INTEGER ] | trains : id [ INTEGER ] primary_key , direction [ TEXT ] |
-- -- What is the total number of short cars on all the trains that run in the east direction?

SELECT SUM(CASE WHEN T1.len = 'short' then 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east';