Question: What city in Latvia was ceded by the treaty that ended the Second Northern War?
Sentence (from "Swedish Livonia"): Parts of Livonia and the city of Riga were under Swedish control as early as 1621 and the situation was formalized in Truce of Altmark 1629, but the whole territory was not ceded formally until the Treaty of Oliva in 1660.
Relevant evidence: Yes