Stack Exchange
What is the difference between these 2 JOINs?
I have the following 2 SQL SELECT statements and am not able to wrap my head around how they're different: 
SELECT DISTINCT product.maker 
FROM product, pc 
WHERE pc.model = product.model AND 
product.maker NOT IN 
(SELECT DISTINCT product.maker 
   FROM product, laptop 
   WHERE product.model = laptop.model)

and 
SELECT DISTINCT p.maker 
FROM Product p INNER JOIN 
 PC ON p.model = PC.model
WHERE p.maker NOT IN (SELECT ip.maker 
 FROM Laptop il INNER JOIN 
 Product ip ON il.model = ip.model
 );

EDIT: The database schema is here - http://www.sql-ex.ru/help/select13.php#db_1

the implicit join #Q1 is more complexe to maintain (readability), it is preferable to use inner join or left join instead even if they will return the same results (implicit join was deprecated by some vendors like Sql Server)

@CodeIsLife but how are they different. Why are they giving different results?

replace inner join by left join this should return the same results (please post your tables structure)

The first query can still have alias naming convention by changing "FROM product, pc" to "FROM product p, pc"

can you show how the results are different? If this is just about ordering, then it's normal because you haven't specified in which order they should appear so it may vary. Also you forgot about DISTINCT in second subquery

Well, and what is difference in results?

@SatishGarg  x IN (1,2) and x IN (1,1,2,2) makes no difference.

@CodeIsLife the database schema is http://www.sql-ex.ru/help/select13.php#db_1

@Serg Second one fetches a single result while the other doesn't. This is actually a question I was trying to solve here: http://www.sql-tutorial.ru/en/book_exercise_8.html

Got (maker=E) with both queries on that site.

@Serg when you submit it, it'll say that your answer is incorrect on subsequent dataset.

I'd better contact  administration of the site for clarification or just use other site, rextester for example to compare queries in question. They are essentially equivalent.

So first obvious difference is absence of DISTINCT in second query's subquery.
The other difference that the second one uses the keyword inner join.
Now, the first way of writing the query is the classical way when join keyword was non-existent.
Using join keyword helps when you have multiple types of join to do such as left join, etc.
Usually the query processor will generate the same database operations, so the performance would be same.

I believe I remember reading before about the difference, which also has a lot to do with performance on the database engine.
