Hers is my full bin bash script. I only want to run the this script if their is data in my table? if not do nothing?

thanks

#!/bin/bash
date=`date +%Y%m%d%H%M%S`
file="ReferralAuth$date.txt"
cat /usr/etc/extractreferral.sql | sed -e "s/file/$file/g" |/usr/bin/mysql -u root XXXXX


extractreferral.sql
SELECT * INTO OUTFILE '/tmp/file'
FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n' FROM Referral_Authorization