How do I use "which"? What are the ways to use "which"?
"I don't know which book do you want."
"I don't know the book which you want."
Which of these sentences is correct?
How do I use "which"? What are the ways to use "which"?
"I don't know which book do you want."
"I don't know the book which you want."
Which of these sentences is correct?
I don't know. Which book do you want?
There are two sentences here, one statement and one question. We can be certain that there are two clauses because there are two finite verbs.
I don't know which book you want.
You want one book. There are several possible books. I don't know which one of the several is the one that you want.
I don't know the book which you want.
You want a book. I know which book you want. I do not know that book.
"I don't know which book do you want."
"I don't know the book which you want."
As written, the first sentence is certainly incorrect, and the accuracy of the second is contentious. In this answer, I explain how it breaks a rule that, although it certainly has its proponents, has never been consistently followed by writers. It is more popular in American English than in British English.
Let us examine the difference between "that" and "which" when used as relative pronouns:
My house, which is made of brick, was repainted recently.
My house, that is made of brick, was repainted recently. [However, my other house, that is made of wood, was not repainted.]
Both of these sentences are correct.
In the first sentence, "which" is being used in a so-called non-restrictive clause. That is to say that the clause could safely be removed without affecting the meaning of the sentence. Non-restrictive relative clauses add extra information to the sentence, but are not necessary to its meaning. In this case, the relative clause merely adds the extra information that the person's house is brick (we may assume that they only have one house, or that it is obvious which house they are talking about).
In the second sentence, "that" is being used in a so-called restrictive clause. That is to say that the clause is crucial to the understanding of the sentence, and could not be removed without changing the meaning. In this case, it implies that (as I attempt to illustrate with the sentence in square brackets) the person making the statement has multiple houses, and wants to specify that it was the brick one that was repainted recently, not the other one(s).
Let us return to your sentence:
"I don't know the book that you want."
Here, it is very important to the meaning of the sentence that the relative clause is present. If we remove it ("I don't know the book."), the sentence becomes ambiguous, and loses the meaning it is intended to have (that the book in question is the one that you want).
If the relative clause can be removed without changing the intended meaning of the sentence, use "which".
If the relative clause cannot be removed without changing the intended meaning of the sentence, use "that".
As I note above, this "rule" is contentious, and is certainly not followed by all writers, not is it observed by very many English speakers. If you break it, no-one will notice. It is therefore not a rule that you should worry too much about observing carefully.