CREATE TABLE "ships" (
  "navy" text,
  "name" text,
  "pennant" text,
  "commissioned" real,
  "home_port" text
);

Question: What is the home port of m40?
SQL: SELECT "home_port" FROM "ships" WHERE "pennant"='m40';

Question: What is the navy for middleton with a home port of portsmouth after 1983?
SQL: SELECT "navy" FROM "ships" WHERE "home_port"='portsmouth' AND "commissioned">1983 AND "name"='middleton';