The chemical reactions and pathways involving cyanamide, NCNH2, a cyanide compound which has been used as a fertilizer, defoliant and in many manufacturing processes. It often occurs as the calcium salt, sometimes also referred to as cyanamide. The citrated calcium salt is used in the treatment of alcoholism.