CREATE TABLE "historical_premiers" (
  "rank" real,
  "state" text,
  "premier" text,
  "party" text,
  "assumed_office" text,
  "left_office" text,
  "total_time_in_office" text
);

Question: What is the least rank for the premier that assumed office on 17 may 1919 and was in office for 7 years, 335 days?
SQL: SELECT MIN("rank") FROM "historical_premiers" WHERE "total_time_in_office"='7 years, 335 days' AND "assumed_office"='17 may 1919';

Question: Premier Sir Charles Cowper (1807-1875) KCMG left office 2 October 1856, when did he assume office?
SQL: SELECT "assumed_office" FROM "historical_premiers" WHERE "premier"='sir charles cowper (1807-1875) kcmg' AND "left_office"='2 october 1856';

Question: What average rank of the premier has NSW as the state, Liberalism as the party, and 22 March 1877 was the assumed office?
SQL: SELECT AVG("rank") FROM "historical_premiers" WHERE "state"='nsw' AND "party"='liberalism' AND "assumed_office"='22 march 1877';