CREATE TABLE "medals_table" (
  "rank" real,
  "nation" text,
  "gold" real,
  "silver" real,
  "bronze" real,
  "total" real
);

Question: Portugal has how many total number of medals when there is 1 gold medal, and bronze medals are greater than 0?
SQL: SELECT COUNT("total") FROM "medals_table" WHERE "gold"=1 AND "nation"='portugal' AND "bronze">0;

Question: Spain with a total of more than 4 medals is in what rank?
SQL: SELECT "rank" FROM "medals_table" WHERE "total">4 AND "nation"='spain';