Task: Text to Code
Input (English): How many dorms have amenities?
Output (English): SELECT count(DISTINCT dormid) FROM has_amenity