QIAN-ME/bird_schema_data huggingface dataset:
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    Among the employees working at the office in New York, how many of them have a good job performance? Sandy Adams is the fullname of an employee; full name = firstname, lastname; New York refers to state = 'NY'; good job performance refers to performance = 'Good';

    【Evidence】
    Sandy Adams is the fullname of an employee; full name = firstname, lastname; New York refers to state = 'NY'; good job performance refers to performance = 'Good';

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T2.state = 'NY' AND T1.performance = 'Good'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    What is the office phone number of the location at which Sandy Adams works? Sandy Adams is the fullname of an employee; full name = firstname, lastname;

    【Evidence】
    Sandy Adams is the fullname of an employee; full name = firstname, lastname;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T2.officephone FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T1.lastname = 'Adams' AND T1.firstname = 'Sandy'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    How many male employees work at the address 450 Peachtree Rd? male employees refers to gender = 'M'

    【Evidence】
    male employees refers to gender = 'M'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(*) FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T2.address = '450 Peachtree Rd' AND T1.gender = 'M'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    How many employees work as an Account Representative? work as an Account Representative refers to positiontitle = 'Account Representative'

    【Evidence】
    work as an Account Representative refers to positiontitle = 'Account Representative'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(*) FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Account Representative'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    How much higher is James Johnson's salary from the minimum salary of his title? James Johnson is the fullname of an employee; full name = firstname, lastname; minimum salary refers to minsalary; calculation = SUBTRACT(salary, minsalary)

    【Evidence】
    James Johnson is the fullname of an employee; full name = firstname, lastname; minimum salary refers to minsalary; calculation = SUBTRACT(salary, minsalary)

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) - CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL) AS diff FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE T1.lastname = 'Johnson' AND T1.firstname = 'James'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    Among the employees who are Trainees, how many of them work in New York? Trainees is a position title; California refers to state = 'NY'

    【Evidence】
    Trainees is a position title; California refers to state = 'NY'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(*) FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID INNER JOIN position AS T3  ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Trainee' AND T2.state = 'NY'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    Please list the full names of the employees who are working as a Trainee. full name = firstname, lastname; trainees is a position title

    【Evidence】
    full name = firstname, lastname; trainees is a position title

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T1.firstname, T1.lastname FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    Which employee's job position requires a higher education level, Jose Rodriguez or Sandy Adams? Jose Rodriguez AND Sandy Adams are the fullname of employee; full name = firstname, lastname; higher education level refers to MAX(educationrequired)

    【Evidence】
    Jose Rodriguez AND Sandy Adams are the fullname of employee; full name = firstname, lastname; higher education level refers to MAX(educationrequired)

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T1.firstname, T1.lastname FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE (T1.lastname = 'Adams' AND T1.firstname = 'Sandy') OR (T1.lastname = 'Rodriguez' AND T1.firstname = 'Jose') ORDER BY T2.educationrequired DESC LIMIT 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    Please list the zip codes of the offices where all the male employees with a good job performance work at. male employees refers to gender = 'M'; good job performance refers to performance = 'Good'

    【Evidence】
    male employees refers to gender = 'M'; good job performance refers to performance = 'Good'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T2.zipcode FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T1.gender = 'M' AND T1.performance = 'Good'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    Please list the social security numbers of all the employees who work in California. social security numbers refers to ssn; California refers to state = 'CA'

    【Evidence】
    social security numbers refers to ssn; California refers to state = 'CA'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T1.ssn FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T2.state = 'CA'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 human_resources
【Schema】
# Table: position
[
(positionID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(positiontitle:TEXT, Examples: [Account Representative]),
(educationrequired:TEXT, Examples: [4 year degree, 2 year degree, 6 year degree]),
(minsalary:TEXT, Examples: [US$25,000.00, US$50,000.00, US$18,000.00]),
(maxsalary:TEXT, Examples: [US$75,000.00, US$150,000.00, US$25,000.00])
]
# Table: location
[
(locationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(locationcity:TEXT, Examples: [Atlanta, Boston, Chicago]),
(address:TEXT, Examples: [450 Peachtree Rd, 3 Commons Blvd, 500 Loop Highway]),
(state:TEXT, Examples: [GA, MA, IL]),
(zipcode:INTEGER, Examples: [30316, 2190, 60620]),
(officephone:TEXT, Examples: [(404)333-5555, (617)123-4444, (312)444-6666])
]
# Table: employee
[
(ssn:TEXT, Primary Key, Examples: [000-01-0000, 000-02-2222, 109-87-6543]),
(lastname:TEXT, Examples: [Milgrom, Adams, Wood]),
(firstname:TEXT, Examples: [Patricia, Sandy, Emily]),
(hiredate:TEXT, Examples: [10/1/04, 1/15/01, 3/12/97]),
(salary:TEXT, Examples: [US$57,500.00, US$19,500.00, US$69,000.00]),
(gender:TEXT, Examples: [F, M]),
(performance:TEXT, Examples: [Average, Good, Poor]),
(positionID:INTEGER, Examples: [2, 3, 1]),
(locationID:INTEGER, Examples: [2, 1, 5])
]
【Foreign keys】
employee.locationID=location.locationID
employee.positionID=position.positionID

    【Question】
    Among the employees who work as a Trainee, how many of them have a salary of over &20,000 a year? Trainee is a position title; salary of over 20,000 refers to salary > '20000'

    【Evidence】
    Trainee is a position title; salary of over 20,000 refers to salary > '20000'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(*) FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) > 20000 AND T2.positiontitle = 'Trainee'