Because angle ECD+ angle ACD= 180, and because angle ACD+ angle ABD= 180.
So angle ABD= angle ECD.
In triangle DQC and triangle DNB
Angle ABD= Angle ECD, Angle DQC= Angle DNB = 90, DQ=DN.
So the triangle DQC congruent triangles DNB(AAS)
So CD = db