The relative and interrogative pronouns (quī, quae, quod) and (quis? quod?) are originally of the same root, so their older forms overlap in many places. The majority of this post will cover features of Latin you might only live to see once, or never.
The archaic genitive singular of this root is quōius, and the archaic dative singular, quoi.
The form quī is alternative of the ablative in all genders, though most often appears as an adverb (quī, how, in what way, inanway–using the same semantic field as the Greek ὅπῃ), or as quīcum, with whom? However, there are more general instances, even in classical Latin, for instance:
Which chest did the spears pierce: quī pectōre tela / transmittant (Lucan, Bellum Civile 7)
The archaic nominative plural, quēs, is only found in early Latin, though the archaic dative/ablative plural quīs is found in classical poetry.
The relative pronoun is used within a complex sentence to refer to some antecedent in an earlier clause. In Latin, the relative pronoun is decline, and should fit syntactically with its own clause, rather than the case of its antecedent. For instance:
These are not the Droids you’re looking for: haec Droidēs nōn sunt quae quaesis.
The antecedent (nominative) does not align with the relative pronoun (accusative). Also, note how easily Latin shifts and embeds a relative clause:
These are not the Droids you’re looking for: quae quaesis haec Droidēs nōn sunt.
These are not the Droids you’re looking for: haec Droidēs quae quaesis nōn sunt.
These are both acceptable (albeit irregular/poetic) alternatives to the sentence above.