Paul Lautman wrote:
> I have a database that consists of 4 tables
>
> nw_course_types has columns name and id
> nw_course_levels has coumns name and id
> nw_course_location has columns name and id
> nw_courses has columns id, type, level, location, date, places
>
> Of the 2 queries below, is either of them a "more correct" way to perform the joins?
>
> SELECT type.name, level.name, location.name, courses.date, courses.places
> FROM `nw_courses` courses
> JOIN (
> nw_course_types
> TYPE , nw_course_levels
> LEVEL , nw_course_locations location
> ) ON courses.type = type.id
> AND courses.level = level.id
> AND courses.location = location.id
>
> SELECT type.name, level.name, location.name, courses.date, courses.places
> FROM `nw_courses` courses
> JOIN nw_course_types
> TYPE ON courses.type = type.id
> JOIN nw_course_levels
> LEVEL ON courses.level = level.id
> JOIN nw_course_locations location ON courses.location = location.id
Personally, I prefer to explicitly state the criteria that is being used to perform joins between tables. As a result, I don't tend to use the JOIN functionality much.

--