Use join instead of subqueries

As a programmer, subqueries are something that you can be tempted to use and abuse. Subqueries, as show below, can be very useful:

(SELECT MAX(created)
FROM posts
WHERE author_id =
AS latest_post FROM authors a

Although subqueries are useful, they often can be replaced by a join, which is definitely faster to execute.

SELECT, MAX(p.created) AS latest_post
FROM authors a
INNER JOIN posts p
ON ( = p.author_id)

Read previous post:
Single Quotes vs Double Quote

When outputting strings: Single quotes (') with concatenation is faster than putting your variables inside a double quote (") string....