Mg(NO3)2→MgO+2NO2+O2 It is called Thermal Decomposition:
Almost. Count the numbers of oxygens on both sides.
Whilst you have the right idea for what the equation should be and the equation is an important step in reaching a full answer in stoichiometry problems, we haven’t seen the OP’s question in full and it would be better to see what they’ve tried so far before jumping straight to giving answers.