Background and aim: The aim of this study was to reveal statistical patterns in patients with acute myocardial infarction (AMI) that cause the development of carbohydrate metabolism disorders (CMD) (type 2 diabetes mellitus and prediabetes) and death within 5 years after AMI. Methods: 1079 patients who were treated with AMI in the Almazov National Medical Research Center were retrospectively selected for the study. For each patient, all data from electronic medical records were downloaded. Statistical patterns that determine the development of CMDs and death within 5 years after AMI were identified. To create and train the models used in this study, the classic methods of Data Mining, Data Exploratory Analysis, and Machine Learning were used. Results: The main predictors of mortality within 5 years after AMI were advanced age, low relative level of lymphocytes, circumflex artery lesion, and glucose level. Main predictors of CMDs were low basophils, high neutrophils, high platelet distribution width, and high blood glucose level. High values of age and glucose together were relatively independent predictors. With glucose level >11 mmol/L and age >70 years, the 5-year risk of death is about 40% and it rises with increasing glucose levels. Conclusion: The obtained results make it possible to predict the development of CMDs and death based on simple parameters that are easily available in clinical practice. Glucose level measured on the 1st day of AMI was among the most important predictors of CMDs and death.