user: ### NOW ANSWER:
Question: when was the first elected when the  candidates is Thomas Lawyer (DR) 54.9% William Beekman (F) 45.1%?
Columns: ['District', 'Incumbent', 'Party', 'First elected', 'Result', 'Candidates']
Types: ['text', 'text', 'text', 'text', 'text', 'text']
Sample row: ['New York 3', 'Jonathan Ward', 'Democratic-Republican', '1814', 'Retired Democratic-Republican hold', 'Caleb Tompkins (DR) 56.8% Abraham Odell (F) 42.8%']
SQL:

assistant: SELECT "First elected" FROM "Table" WHERE "Candidates" = 'Thomas Lawyer (DR) 54.9% William Beekman (F) 45.1%';