1) I'm not an expert in MySQL, but in Oracle SQL, single (not double) quotes are used around string literals.
2) You have repeated the word FROM.
So the last statement should be:
INSERT INTO referralhistory(MEMBERID)
select MEMBERID FROM Referral_Authorization WHERE FORMTYPE = 'D';
It is best to try SQL statements from the command line before putting them into a batch file. That way you can debug them.