Database Reference
In-Depth Information
Summary
Many developers prefer subqueries — I do. They're easier to construct and decipher when
you have problems later. If you work on a database that is very large and has a huge
amount of activity, subqueries may not be a good choice because they can sometimes affect
performance. For small databases, though, they're fine. You should learn to use subqueries
and learn how to work without them (i.e, use JOIN ) so you can handle any situation
presented to you. You cannot be sure which method your next employer and team of deve-
lopers may being using. It's best to be versatile.
As for learning to use JOIN , that's hardly optional. Very few developers don't use JOIN .
Even if you prefer subqueries, they still call for JOIN . You can see this in almost all of the
examples of subqueries in this chapter. You may rarely use UNION . But there's not much to
learn there. However, you should be proficient in using JOIN . So don't avoid them; prac-
tice manually entering SQL statements that use them. The act of typing them helps.
Search WWH ::




Custom Search