We investigate a nonrelativistic model of tetraquarks, which are assumed to be compact and to consist of diquark-antidiquark pairs. We fit, for the first time, basically all currently known values for the measured masses of 45 mesons, including both charmed and bottom mesons, to the model and predict masses of tetraquarks as well as diquarks. In particular, we find masses of four axial-vector diquarks, i.e., qc, cc, qb, and bb, where q ¼ u, d, and 24 ground-state tetraquarks, including both heavy-light tetraquarks (qcqc and qbqb) and heavy tetraquarks (cccc and bbbb). In general, our results for the masses of qbqb, cccc, and bbbb are largely comparable with other reported results, whereas our results for the masses of qcqc are slightly larger than what has been found earlier. Finally, we identify some of the obtained predictions for masses of tetraquarks with masses of experimental tetraquark candidates, and especially, we find that ψð4660Þ, Z b ð10610Þ, and Z b ð10650Þ could be described by the model.