An emulation of a target trial was conducted using a retrospective-cohort data of type 2 diabetes mellitus (T2DM) prescribed with second-line drugs on top of metformin, including sodium-glucose cotransporter 2 inhibitors (SGLT2i), dipeptidyl peptidase-4 inhibitors (DPP4i), thiazolidinediones (TZD) and sulfonylureas (SUs). Here, DPP4 is linked to diabetes mellitus.