Database schema:

CREATE TABLE employee (
	ssn TEXT -- example: ['000-01-0000', '000-02-2222'],
	lastname TEXT -- example: ['Adams', 'Milgrom'],
	firstname TEXT -- example: ['Sandy', 'Patricia'],
	hiredate TEXT -- example: ['10/1/04', '1/15/01'],
	salary TEXT -- example: ['US$19,500.00', 'US$57,500.00'],
	gender TEXT -- example: ['M', 'F'],
	performance TEXT -- example: ['Good', 'Average'],
	"positionID" INTEGER -- example: ['2', '3'],
	"locationID" INTEGER -- example: ['2', '1'],
	PRIMARY KEY (ssn), 
	CONSTRAINT fk_employee_location FOREIGN KEY("locationID") REFERENCES location ("locationID"),
	CONSTRAINT fk_employee_position FOREIGN KEY("positionID") REFERENCES position ("positionID")
)


CREATE TABLE location (
	"locationID" INTEGER -- example: ['2', '1'],
	locationcity TEXT -- example: ['Boston', 'Atlanta'],
	address TEXT -- example: ['3 Commons Blvd', '450 Peachtree Rd'],
	state TEXT -- example: ['MA', 'GA'],
	zipcode INTEGER -- example: ['30316', '2190'],
	officephone TEXT -- example: ['(404)333-5555', '(617)123-4444'],
	PRIMARY KEY ("locationID")
)


CREATE TABLE position (
	"positionID" INTEGER -- example: ['2', '1'],
	positiontitle TEXT -- example: ['Account Representative', 'Manager'],
	educationrequired TEXT -- example: ['2 year degree', '4 year degree'],
	minsalary TEXT -- example: ['US$25,000.00', 'US$50,000.00'],
	maxsalary TEXT -- example: ['US$75,000.00', 'US$150,000.00'],
	PRIMARY KEY ("positionID")
)

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

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'