Is this sentence grammatically correct?:
There is a table that has a book on it.
Can I say (or why can't I say if not?):
There is a table that has a book on.
- There is a table [that has a book on it].
This is a grammatical sentence. The restrictive relative clause
modifies its antecedent noun phrase a table, and contains two noun phrases (that, the subject relative pronoun, and it, the object of the preposition on) which both refer to a table.
This is grammatical because the clause is grammatical as a simple sentence
The second sentence
- *There is a table [that has a book on].
is ungrammatical (that's what the asterisk means) because the supposed relative clause
is not grammatical as a simple sentence
and therefore can't be grammatical as a relative clause.
It's tempting to strand prepositions in relative clauses, like
but you can only do that when the relative pronoun that (or which, or who, depending) is the object of the preposition. In
the relative pronoun that is already the subject and can't be moved or deleted, so the it that's the object of on is not a relative pronoun and can't be deleted or moved either.