pythagorean theorem extensions

are there for a given integer N solutions to the equations

$\sum _{n=1}^{N}{x}_{i}^{2}={z}^{2}$

for integers ${x}_{i}$ and zan easier equation given an integer number 'a' can be there solutions to the equation

$\sum _{n=1}^{N}{x}_{i}^{2}={a}^{2}$

for N=2 this is pythagorean theorem

are there for a given integer N solutions to the equations

$\sum _{n=1}^{N}{x}_{i}^{2}={z}^{2}$

for integers ${x}_{i}$ and zan easier equation given an integer number 'a' can be there solutions to the equation

$\sum _{n=1}^{N}{x}_{i}^{2}={a}^{2}$

for N=2 this is pythagorean theorem