Effective therapies for COVID-19 are still lacking, and drug repositioning is a promising approach to address this problem. Here, we adopted a medical informatics approach to repositioning. We leveraged a large prospective cohort, the UK-Biobank (UKBB, N ~ 397,000), and studied associations of prior use of all level-4 ATC drug categories (N = 819, including vaccines) with COVID-19 diagnosis and severity. Effects of drugs on the risk of infection, disease severity, and mortality were investigated separately. Logistic regression was conducted, controlling for main confounders. We observed strong and highly consistent protective associations with statins. Many top-listed protective drugs were also cardiovascular medications, such as angiotensin-converting enzyme inhibitors (ACEI), angiotensin receptor blockers (ARB), calcium channel blocker (CCB), and beta-blockers. Some other drugs showing protective associations included biguanides (metformin), estrogens, thyroid hormones, proton pump inhibitors, and testosterone-5-alpha reductase inhibitors, among others. We also observed protective associations by influenza, pneumococcal, and several other vaccines. Subgroup and interaction analyses were also conducted, which revealed differences in protective effects in various subgroups. For example, protective effects of flu/pneumococcal vaccines were weaker in obese individuals, while protection by statins was stronger in cardiovascular patients. To conclude, our analysis revealed many drug repositioning candidates, for example several cardiovascular medications. Further studies are required for validation.