I found this useful explanation https://angelikasgerman.co.uk/what-is-the-difference-between-a-wand-and-a-mauer/
"bei" is a preposition that always goes with the dative case.
You can find the full list of prepositions here: http://german.about.com/library/blcase_dat2.htm
And also, "Wand" is a feminine noun, that is why it is "bei der Wand". (die -> der) If you had an accusative case e.g "Die Blumen sind für die Mutter" (The flowers are for the mother), article "die" stays the same.
"beim" is actually bei+dem, dem for masculine or neuter nouns (der -> dem; das -> dem)
They are not interchangeable.
Any wall connecting the floor with the ceiling is called "Wand". Freestanding walls are called "Mauer".
- The walls between two rooms (indoors) are called "Wand".
- The wall separating the inside from the outside of a house is often called "Wand" but sometimes also "Mauer".
- A wall surrounding a garden is called "Mauer".
- "The Great Wall of China" is "die chinesische Mauer" in German.
- The walls sourrounding fortresses ect. are called "Mauer".
Thanks MenaceDenis Perhaps it's to do with growing up in Scotland (as did Dennis!) where we say "out the window" instead of "out of the window". I accept that "next the wall" isn't regarded as standard English. When spoken, it's hard to tell whether the "to" is there or not. (I've also lived in south west England, where they say "off of" as in "The pencil rolled off of the table.".)