Acetaldehyde undergoes aldol condensation in presence of dil NaOH or K2CO3 to form beta hydroxy butyraldehyde or aldol.
CH3CHO + HCH2CHO—–> CH3CH(OH)CH2CHO [Aldol]
On heating aldol loses a water molecule to give unsaturated aldehyde .
CH3CH(OH)CH2CHO ——-> CH3CH=CHCHO [crotonaldehyde] +H2O