In this paper we give upper bounds on the sizes of $(d, L)$ list-decodable codes in the Hamming metric space from various covering codes with the covering radius $d$. When the list size $L$ is $1$, this gives many new Singleton type upper bounds on the sizes of codes with a given minimum Hamming distance. These upper bounds for codes are tighter than the Griesmer bound when the lengths of codes are large. Some upper bounds on the lengths of general small Singleton defect codes are given. As an application of our generalized Singleton type upper bounds on Hamming metric error-correcting codes, the generalized Singleton type upper bounds on insertion-deletion codes is given. Our this upper bound is much stronger than the direct Singleton bound for insertion-deletion codes when the lengths are large. We also give upper bounds on the lengths of small dimension optimal locally recoverable codes and small dimension optimal $(r, \delta)$ locally recoverable codes with any fixed given minimum distance.