When did the tom smith built train enter service with a number under 7007?
CREATE TABLE "locomotives" (
  "number" real,
  "locomotive_type" text,
  "wheel_arrangement" text,
  "builder" text,
  "entered_service" real,
  "withdrawn" real
);
SELECT AVG("entered_service") FROM "locomotives" WHERE "builder"='tom smith' AND "number"<7007;