That is not a good idea. Questions might have children posts (such as comments or answers). If you remove the questions the children will be orphaned. There will also be users who just posted a link to a site as a reference, and you will be removing them too. That is not good at all.
I will not add that delete statement as it is dangerous for you and someone who happens to find my post. However, I can ease your work by giving you a SQL statement with the posts and users who made them. Then you can evauluate if it is spam or not and navigate to the user (using the username in the results) and remove them manually.
I'm assuming a link is a piece of text that has HTTP inside it. You can easily change the statement to whatever you consider is a link... maybe a piece of text with WWW? Here is the SQL statement to fetch that information:
SELECT postid, `type`, u.handle username, title, content FROM qa_posts p
JOIN qa_users u ON p.userid = u.userid
WHERE LOWER(content) LIKE '%http%' OR LOWER(title) LIKE '%http%'