CREATE TABLE "list_of_deputy_prime_ministers_of_spain" (
  "deputy_prime_minister" text,
  "took_office" real,
  "left_office" text,
  "prime_minister" text,
  "term" text,
  "party" text
);

Question: What year did deputy prime minister Mariano Rajoy Brey take office?
SQL: SELECT SUM("took_office") FROM "list_of_deputy_prime_ministers_of_spain" WHERE "deputy_prime_minister"='mariano rajoy brey';

Question: Which deputy prime minister left office in 2004 and was in the 7th legislature?
SQL: SELECT "deputy_prime_minister" FROM "list_of_deputy_prime_ministers_of_spain" WHERE "term"='7th legislature' AND "left_office"='2004';

Question: Which deputy prime minister left office in 1981?
SQL: SELECT "deputy_prime_minister" FROM "list_of_deputy_prime_ministers_of_spain" WHERE "left_office"='1981';