system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE current (
  ballotpedia_id text,
  bioguide_id text PRIMARY KEY,
  birthday_bio date,
  cspan_id real PRIMARY KEY,
  fec_id text,
  first_name text,
  gender_bio text,
  google_entity_id_id text,
  govtrack_id integer,
  house_history_id real,
  icpsr_id real,
  last_name text,
  lis_id text,
  maplight_id real,
  middle_name text,
  nickname_name text,
  official_full_name text,
  opensecrets_id text,
  religion_bio text,
  suffix_name text,
  thomas_id integer,
  votesmart_id real,
  wikidata_id text,
  wikipedia_id text
);
CREATE TABLE current-terms (
  address text,
  bioguide text PRIMARY KEY,
  caucus text,
  chamber text,
  class real,
  contact_form text,
  district real,
  end text PRIMARY KEY,
  fax text,
  last text,
  name text,
  office text,
  party text,
  party_affiliations text,
  phone text,
  relation text,
  rss_url text,
  start text,
  state text,
  state_rank text,
  title text,
  type text,
  url text
);
CREATE TABLE historical (
  ballotpedia_id text,
  bioguide_id text PRIMARY KEY,
  bioguide_previous_id text,
  birthday_bio text,
  cspan_id text,
  fec_id text,
  first_name text,
  gender_bio text,
  google_entity_id_id text,
  govtrack_id integer,
  house_history_alternate_id text,
  house_history_id real,
  icpsr_id real,
  last_name text,
  lis_id text,
  maplight_id text,
  middle_name text,
  nickname_name text,
  official_full_name text,
  opensecrets_id text,
  religion_bio text,
  suffix_name text,
  thomas_id text,
  votesmart_id text,
  wikidata_id text,
  wikipedia_id text
);
CREATE TABLE historical-terms (
  address text,
  bioguide text PRIMARY KEY,
  chamber text,
  class real,
  contact_form text,
  district real,
  end text,
  fax text,
  last text,
  middle text,
  name text,
  office text,
  party text,
  party_affiliations text,
  phone text,
  relation text,
  rss_url text,
  start text,
  state text,
  state_rank text,
  title text,
  type text,
  url text
);
CREATE TABLE social-media (
  bioguide text PRIMARY KEY,
  facebook text,
  facebook_id real,
  govtrack real,
  instagram text,
  instagram_id real,
  thomas integer,
  twitter text,
  twitter_id real,
  youtube text,
  youtube_id text
);
-- foreign keys: current-terms.bioguide -> current.bioguide_id; historical-terms.bioguide -> historical.bioguide_id; social-media.bioguide -> current.bioguide_id

Hint: female refers to gender_bio = 'F'; representatives refers to type = 'rep'; served for at least 10 years refers to SUBTRACT(SUM(CAST(strftime('%Y', end)), CAST(strftime('%Y', start)))) > 10;

Question: How many female representatives served in the state of California for at least 10 years?

assistant: SELECT SUM(T3.result) FROM ( SELECT CASE WHEN SUM(CAST(strftime('%Y', T2.`end`) AS int) - CAST(strftime('%Y', T2.start) AS int)) > 10 THEN 1 ELSE 0 END AS result FROM current AS T1 INNER JOIN "current-terms" AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' AND T2.state = 'CA' AND T2.type = 'rep' ) AS T3