For good performance Join values or direct values?

hello,

assume i have two tables

Table 1 courses

course_id,title

Table 2 scores

user_id,course_id,grade

i have a variable course_id is 2

i have two queries which one of them have good performance?

Query 1
select courses.title,scores.grade from courses,scores where courses.course_id=‘2’ and scores.course_id=‘2’

Query 2
select courses.title,scores.grade from courses,scores where courses.course_id=‘2’ and scores.course_id=courses.course_id

You should always use Query 2.

There is no performance difference between them because the value is known in advance. But in query 2 you explicitly show whoever is reading the code that there is a relation between the two tables.

But please see my post on your other question regarding the use of INNER JOIN syntax to further improve on writing your queries easily understandable and reduce risk for bugs.