How many gold medals for Bulgaria (BUL) with 2 silvers and a less than 18 rank?
CREATE TABLE "men" (
  "rank" real,
  "nation" text,
  "gold" real,
  "silver" real,
  "bronze" real,
  "total" real
);
SELECT SUM("gold") FROM "men" WHERE "silver"=2 AND "nation"='bulgaria (bul)' AND "rank"<18;