Q:

SQL query, Select available pitches by given date range

I have been tasked to create a web enabled database where customers can book campsite pitches.  
I am currently working on a SQL query to check what pitches are available during a certain date.  
I have a 'Pitch' table which contains pitch and type_id columns, and a 'booking' table which contain pitch StartDate and EndDate columns. 
I currently have this:
SELECT Pitch 
FROM Pitch AS p
WHERE
    Pitch NOT IN (
        SELECT Pitch 
        From Booking As b
        WHERE b.Pitch IS NOT NULL 
          AND b.Pitch = p.pitch 
          AND (StartDate >= 15/06/2015 AND EndDate  <= 20/06/2015)  
        );

A:

First you should take out the "AS" keyword when referring to a table.  That is usually only used for columns. Then, don't try to join in your sub-query. It might look something like this:
SELECT PITCH 
FROM PITCH 
WHERE PITCH NOT IN (
    SELECT PITCH FROM BOOKING
    WHERE WHERE STARTDATE >= 15/06/2015 --verify syntax of date
      AND ENDDATE <= 20/06/2015 );

Although I wouldn't recommend naming a column the same as a table.

