Heusler alloys comprise an extensive family with diverse physical properties. Since the prediction of the half-heusler half-metal NiMnSb with 100% spin polarization,many studies have been devoted to searching for and verifying Heuslers with half-metallicity. We present a comprehensive computational study on the electronic structure, magnetism and structural stability of 180 full-Heusler alloys, 378 half-Heusler alloys and 405 inverse-Heusler alloys. We found that a “Slater-Pauling density of states” with a gap or pseudogap containing three states per atom below the gap in at least one of the spin channels is a common feature of half-metals and near-half-metals in the Heusler family. Among the alloys in our database, 28 semiconductors, 80 half-metals and 47 near-half-metals are identified with negative formation energies. Moreover, 1 stable tetragonal half-metal with large anisotropy and 2 stable zero-moment half-metals were discovered. The competition between the cubic phase and other phases is discussed by comparing the calculated formation energies with those of the large number of phases archived by the oqmd project . We also found that a series of 18-electron alloys that are paramagnetic metals in bulk may be realized as zero-moment half-metals by using epitaxial forces to expand the lattice. A series of 18-electron alloys were combined with MgO as superlattices. The strong interactions between metal and oxygen atoms causes the systems with pure YY interfaces to be energetically preferred over other cases, usually preserving the half-metallicity at the interface. We also concluded that uniaxial anisotropy could be induced in Heusler layers next to MgO. The choice of interface layers determines the half-metallicity and helps to determine the anisotropy (in-plane or perpendicular) in the Heusler-MgO junctions. The predicted ability to retain half-metallicity and achieve perpendicular magnetic anisotropy (PMA) in NiMnSb/MgO, CoTiSn/MgO, CrMnSb/MgO and FeMnIn/MgO junctions with YY interface layers makes these systems interesting because they combine fully spin-polarized transport currents with zero magnetic moment which leads to a nominally infinite Hk and FMR frequency.