CREATE TABLE "ratings" (
  "episode_number_production_number" text,
  "title" text,
  "sydney" real,
  "melbourne" real,
  "brisbane" real,
  "adelaide" real,
  "perth" real,
  "total" real,
  "weekly_rank" real,
  "nightly_rank" real
);

Question: What is the lowest value for Sydney, when Perth is less than 169,000, and when NIGHTLY RANK is less than 5?
SQL: SELECT MIN("sydney") FROM "ratings" WHERE "perth"<'169,000' AND "nightly_rank"<5;

Question: What is the lowest value for Sydney, when WEEKLY RANK is less than 8, and when Brisbane is greater than 252,000?
SQL: SELECT MIN("sydney") FROM "ratings" WHERE "weekly_rank"<8 AND "brisbane">'252,000';

Question: What is the sum of the values for Melbourne, when Episode Number Production Number is 19 2-06, and when Sydney is less than 389,000?
SQL: SELECT SUM("melbourne") FROM "ratings" WHERE "episode_number_production_number"='19 2-06' AND "sydney"<'389,000';

Question: What is the lowest value for Perth, when Melbourne is greater than 461,000, and when Sydney is less than 430,000?
SQL: SELECT MIN("perth") FROM "ratings" WHERE "melbourne">'461,000' AND "sydney"<'430,000';