What distinguishes "coding" from "noncoding" DNA?
You are correct in thinking that any sequence of bases corresponds, via the genetic code, to a sequence of amino acids. However not all stretches of DNA are actually transcribed into mRNA for translation into proteins. For this to happen the stretch of DNA requires (DNA-encoded) elements to promote and regulate the transcription and translation processes, and this, very broadly, is what defines a gene: a segment of DNA which has the required components to direct the synthesis of a protein (or in some cases an RNA that will not be translated into a protein). The segments of DNA that correspond to mRNA for proteins and to other RNA molecules are referred to as coding sequences.

Now, I've omitted lots of details here: some genes encode RNA molecules, such as ribosomal RNAs, which are not translated into proteins; eukaryotic genes include stretches of sequence (called introns) that are spliced out of the transcript before the mRNA>protein step. The original definition (if there ever was a definition) of "junk" DNA included these introns, as well as regions of DNA lying outside the coding sequences. We now know that there is useful information stored in much of this DNA, even though it doesn't code for anything directly via the genetic code.