1. Wo? Woher? Wohin?
In German, there are three distinct ways we can inquire about place or location: Wo? (Where?), "Wohin?" (Where to?, and "Woher?" (Where from?). The question word "Wo?" (where) typically inquires about a fixed location, and prepositions that answer the question "Wo?" are almost always proceeded by the dative case, with a handful of genitive exceptions.
"Woher?" inquires about the origin, and there are only two prepositions ("aus" and "von") that are used to answer to "woher", and both always trigger the dative case.
"Wohin?" questions usually inquire about direction, and prepositions that answer these two question words can be followed by either the accusative or the dative case. The preposition "in", for example, changes case depending on what question word we use (are we inquiring about a fixed location, or a direction?).
Wo ist der Hund? -Der Hund ist im (in dem) Garten. (dative)
Where is the dog? - The dog is in the yard
Wohin geht der Hund? - Der Hund geht in den Garten. (accusative)
Where is the dog going? - The dog is going in(to) the yard.
If a preposition can trigger different cases, they are called "two-way prepositions" (such as "in"). Some prepositions, however, can only ever trigger one case.
2. Accusative prepositions
The following prepositions will always trigger the accusative case, regardless of what the context is. Some of them can be used as both, a temporal or a local preposition, some only make sense as either.
As we know that "Wo?" is always answered with prepositions followed by the dative (or genitive) case, we can deduce that none of these accusative prepositions can ever be used to answer a "wo"-question. They can, however, answer a "wohin" question, and when they do, they will always be followed by the accusative case. Examples:
Wohin gehst du? - Ich gehe durch den Tunnel.
(accusative of "der Tunnel")Where are you going (to)? - I am going through the tunnel. Wohin gehen wir? - Wir gehen um die Stadt herum.
(accusative of "die Stadt")Where are we going (?) - We are going around the city.
Wohin geht er? - Er geht den Weg entlang.
(accusative of "der Weg")
In the above examples, each question used an accusative preposition. When using "um", we do not have to use "herum" as well, but it adds more detail. If we do use "herum", it is placed on the other side of the noun. "Entlang" is always behind the noun.
3. Two-Way Prepositions
There are several prepositions that can go either with the dative or the accusative case, and it depends solely on what the question is. As mentioned above, the preposition "in" can be used with the dative case, if we are asking about a fixed location. But it can also go with the accusative case, if we are asking about a direction. Examples:Wo ist die Maus? - Die Maus ist unter dem Sofa.
(dative)Where is the mouse? - The mouse is under the sofa. (fixed location)Wohin läuft die Maus? - Die Maus läuft unter das Sofa.
Where is the mouse running? - The mouse is running under the sofa. (direction)
4. Genitive Prepositions
There are a handful of prepositions that always trigger the genitive case, two of which can answer the question "wo"? "innerhalb" (within, inside of) and "ausserhalb" (without, outside of).
Wo sind wir? - Wir sind innerhalb des Landkreises.
Where are we? - We are within/inside the county (boundaries).
Depending on the preposition and the gender and case of the noun, we can form contractions.an dem -> am
( masculine or neutral noun in the dative)an das -> ans
(neutral noun in the accusative)bei dem -> beim
(masculine or neutral noun in the dative)in dem -> im
(masculine or neutral noun in the dative)in das -> ins
(neutral noun in the accusative)von dem -> vom
(masculine or neutral noun in the dative)zu der -> zur
(feminine noun in the dative)zu dem -> zum
(masculine or neutral noun in the dative)