Despite substantial progress in the study of diabetes, important questions remain about its comorbidities and clinical heterogeneity. To explore these issues, we develop a framework allowing for the first time to quantify nation-wide risks and their age- and sex-dependence for each diabetic comorbidity, and whether the association may be consequential or causal, in a sample of almost two million patients. This study is equivalent to nearly 40,000 single clinical measurements. We confirm the highly controversial relation of increased risk for Parkinsons disease in diabetics, using a 10 times larger cohort than previous studies on this relation. Detection of type 1 diabetes leads detection of depressions, whereas there is a strong comorbidity relation between type 2 diabetes and schizophrenia, suggesting similar pathogenic or medication-related mechanisms. We find significant sex differences in the progression of, for instance, sleep disorders and congestive heart failure in diabetic patients. Hypertension is a highly sex-sensitive comorbidity with females being at lower risk during fertile age, but at higher risk otherwise. These results may be useful to improve screening practices in the general population. Clinical management of diabetes must address age- and sex-dependence of multiple comorbid conditions. 