I had a lot more trouble doing the chapter 4 exercises than doing the chapter 3 exercises as I found all the different ways to write everything confusing. One concept that I don't understand is when you need to use the DISTINCT operator and when it is not necessary. For example, in chapter 4 question 9 you use a subquery and distinct is not necessary - you get only the two names no matter if you use it or not. However, in the next question, number 10, you don't use a subquery and you need distinct. If you don't use distinct, the outcome will be Juan Perez listed twice. Is there a general rule that whenever you use subqueries you don't need to use the distinct and everything will be automatically listed only once? I have a feeling it is more on a problem-by-problem basis...
Comments