Skip to content
Advertisement

SQL SELECT Query Performance between AND and Interlaced SELECT´s

Good evening. I am new to SQL and I am currently learning how to write SQL SELECT statements. I read a lot about the difference of performance between different ways of writing SELECT statement.

I am asking myself about the difference between one SELECT query with a lot AND statements and “Interlaced” SELECT statements.

e.g

Which is better. Or is there maybe a third even better way?

Advertisement

Answer

Note that with USING, you don’t really need the table aliases for hoeren or vorlesungen. You only need aliases to distinguish between studenten.name and professoren.name. Hence, the query could be shortened to

Whether you want to keep the table aliases or not is a matter of taste.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement