The Internet of Things (IoT) is a promising paradigm to accommodate massive device connections in 5G and beyond. To pave the way for future IoT, the spectrum should be planed in advance. Spectrum sharing is a preferable solution for IoT due to the scarcity of available spectrum resource. In particular, mobile operators are inclined to exploit the existing standards and infrastructures of current cellular networks and deploy IoT within licensed cellular spectrum. Yet, proprietary companies prefer to deploy IoT within unlicensed spectrum to avoid any licence fee. In this paper, we provide a survey on prevalent IoT technologies deployed within licensed cellular spectrum and unlicensed spectrum. Notably, emphasis will be on the spectrum sharing solutions including the shared spectrum, interference model, and interference management. To this end, we discuss both advantages and disadvantages of different IoT technologies. Finally, we identify challenges for future IoT and suggest potential research directions. Spectrum Sharing for Internet of Things: A Survey