This lecture will talk about semidefinite programming (SDP) and its applications in global polynomial optimization. Firstly, after introducing SDP, we will how to represent k-elliptic curves by SDP. Secondly, after an overview of the sum of squares (SOS) relaxation, which can be reduced to SDP, we will present gradient SOS relaxation. While the general SOS relaxation has a gap in finding the global minimum, the gradient SOS relaxation can find the global minimum whenever a global minimizer exists. Lastly, we will show how to exploit sparsity in SOS and its applications in sensor network localization.