CREATE TABLE "ry_ky_an_missions_to_edo" (
  "year" real,
  "mission_type" text,
  "shogun" text,
  "ry_ky_an_king" text,
  "lead_envoy" text,
  "number_in_entourage" text
);

Question: What is the latest year of a gratitude type mission with 99 in the entourage?
SQL: SELECT MAX("year") FROM "ry_ky_an_missions_to_edo" WHERE "number_in_entourage"='99' AND "mission_type"='gratitude';

Question: Who was the lead envoy of the mission with the Ryūkyūan King shō eki?
SQL: SELECT "lead_envoy" FROM "ry_ky_an_missions_to_edo" WHERE "ry_ky_an_king"='shō eki';

Question: Who was the lead envoy of the congratulation mission in 1718 with the Ryūkyūan King shō kei?
SQL: SELECT "lead_envoy" FROM "ry_ky_an_missions_to_edo" WHERE "ry_ky_an_king"='shō kei' AND "mission_type"='congratulation' AND "year"=1718;

Question: Who was the lead envoy with the Ryūkyūan King shō kō?
SQL: SELECT "lead_envoy" FROM "ry_ky_an_missions_to_edo" WHERE "ry_ky_an_king"='shō kō';