What is the difference between kattan and kaimashita?


In Japanese the mashita ending is the past form of polite verbs.

[For
example](http://www.japaneseverbconjugator.com/VerbDetails.asp?txtVerb=%E8%B2%B7%E3%81%86):

[code]

    To buy (root form) - Kau
    To buy (polite form) - kaimasu 
    To buy (polite form, past) - kaimashita
    
[/code]

In my Japanese text book it has the following example

[code]

    Where did you buy it?
    Doko de kattan desu ka?
    
[/code]

Why is the speaker using `kattan` instead of `kaimashita` (especially as
`kattan` is defined as [coal](http://jisho.org/word/%E8%A4%90%E7%82%AD))?
Could `kattan` be substituted with `kaimashita`? How does the meaning change
when using `kattan` or `kaimashita`?




> To buy (root form) - Kau  
>  To buy (polite form) - kaimasu, (casual form) - kau  
>  To buy (polite form, past) - kaimashita, (casual form, past) - katta
>
> Where did you buy it?  
>  Doko de kattan desu ka? = Doko de katta no desu ka?

"Katta" is a casual and past form, but "katta no desu ka?" is a polit form
because it has "desu."

"Kattan desu (ka?)" is a short form of "Katta no desu (ka?)"

> Doko de kattan desu ka? = Doko de kai mashita ka?

Both are polite. The latter is more polite. The former is a spoken vocabulary.

