updated SQL problems and added missing Stock table