BackgroundIn our clinical work, we found that cancer patients were susceptible to coronary atherosclerotic heart disease (CAD). However, less is known about the relationship between CAD and cancer. The present study aimed to identify the risk factors for CAD and cancer, as well as the relationship between CAD and cancer.MethodsIn this retrospective study, 1600 patients between January 2012 and June 2019 were enrolled and divided into groups according to whether they had CAD or cancer. Single-factor and multivariate analysis methods were applied to examine the risk factors for CAD and cancer.Results(1) Cancer prevalence was significantly higher in patients with CAD than in patients without CAD (47.2 vs. 20.9%). The prevalence of CAD in cancer and non-cancer patients was 78.9 and 52.4%, respectively. (2) Multivariable logistic regression showed that patients with cancer had a higher risk of developing CAD than non-cancer patients (OR: 2.024, 95% CI: 1.475 to 2.778, p < 0.001). Respiratory (OR: 1.981, 95% CI: 1.236–3.175, p = 0.005), digestive (OR: 1.899, 95% CI: 1.177–3.064, p = 0.009) and urogenital (OR: 3.595, 95% CI: 1.696–7.620, p = 0.001) cancers were significantly associated with a higher risk of CAD compared with no cancer. (3) Patients with CAD also had a higher risk of developing cancer than non-CAD patients (OR = 2.157, 95% CI: 1.603 to 2.902, p < 0.001). Patients in the Alanine aminotransferase (ALT) level ≥ 40 U/L group had a lower risk of cancer than patients in the ALT level < 20 U/L group (OR: 0.490, 95% CI: 0.333–0.722, p < 0.001). (4) An integrated variable (Y = 0.205 × 10–1 age − 0.595 × 10–2 HGB − 0.116 × 10–1 ALT + 0.135 FIB) was identified for monitoring the occurrence of cancer among CAD patients, with an AUC of 0.720 and clinical sensitivity/specificity of 0.617/0.711.Conclusion(1) We discovered that CAD was an independent risk factor for cancer and vice versa. (2) Digestive, respiratory and urogenital cancers were independent risk factors for CAD. (3) We created a formula for the prediction of cancer among CAD patients. (4) ALT, usually considered a risk factor, was proven to be a protective factor for cancer in this study.