Solution (source code)

= Solution

<Krasner's lemma> says that if $K$ is complete, $\alpha$ is separable over $K$, and
$$
|\beta-\alpha|<
\min_{\substack{\sigma(\alpha)\ne\alpha\\\sigma\in\operatorname{Gal}(\overline K/K)}}
|\alpha-\sigma(\alpha)|,
$$
then $K(\alpha)\subseteq K(\beta)$.

To prove it, let $\tau$ be an automorphism of $\overline K$ fixing $K(\beta)$. The absolute value has a unique extension to every finite extension of the complete field $K$, so it is invariant under $\tau$. If $\tau(\alpha)\ne\alpha$, the <ultrametric inequality> and the displayed strict inequality give
$$
|\tau(\alpha)-\beta|
=|\tau(\alpha)-\alpha|
>|\alpha-\beta|.
$$
But $\tau(\beta)=\beta$ and invariance gives $|\tau(\alpha)-\beta|=|\alpha-\beta|$, a contradiction. Every automorphism fixing $K(\beta)$ therefore fixes $\alpha$, which proves the field inclusion by <Galois correspondence>.

Now let $L/\mathbb Q_p$ be finite. By the <primitive element theorem>, write $L=\mathbb Q_p(\alpha)$ with separable minimal polynomial $f\in\mathbb Q_p[X]$. Approximate the coefficients of $f$ closely by those of a polynomial $g\in\mathbb Q[X]$ of the same degree. <Continuity of roots over a non-Archimedean field> gives a root $\beta$ of $g$ arbitrarily close to $\alpha$. Choose it close enough for <Krasner's lemma>; then
$$
\mathbb Q_p(\alpha)\subseteq\mathbb Q_p(\beta).
$$
The degree bound from $\deg g=\deg f$ forces equality. If $F=\mathbb Q(\beta)$ and $\mathfrak p$ is the prime selected by the embedding $F\hookrightarrow\overline{\mathbb Q}_p$, its completion is
$$
F_{\mathfrak p}\cong\mathbb Q_p(\beta)=L.
$$
Thus every finite extension of $\mathbb Q_p$ is the <completion of a number field at a prime ideal>.