Book recommendations for commutative algebra and algebraic number theory Are there any books which teach commutative algebra and algebraic number theory at the same time. Many commutative algebra books contain few chapters on algebraic number theory at end. But I don't need that. I'm seaching for book which motivates commutative algebra using algebraic number theory.My main is to learn algebraic number theory but while doing so I also want to pick up  enough commutative algebra to deal with algebraic geometry as well.
 A: I agree with David Loeffler's answer: there is a large initial segment of algebraic number theory which essentially coincides with the study of Dedekind domains.  A careful study of Dedekind domains gives an introduction to several important commutative algebra topics: e.g. localization, integral closure, discrete valuations, fractional ideals, and the ideal class group.
So one can motivate much of basic commutative algebra using concepts from algebraic number theory, but there is also a lot missing, for instance:
$\bullet$ Module theory.  Modules over a Dedekind domain are "too nice" compared to modules over an arbitrary commutative ring.  For instance injective = divisible and  flat = torsionfree.
$\bullet$ The spectrum.  The family of prime ideals in a Dedekind domain is unrepresentatively simple: all the nonzero ones are maximal.  This is not a good motivation for spending time understanding the order-theoretic structure or the Zariski topology on $\operatorname{Spec} R$.
$\bullet$ Dimension theory.
$\bullet$ Primary decomposition.  One can view primary decomposition in a Noetherian ring as a generalization of factorization of ideals into products of primes in a Dedekind domain, but once again the former is significantly more complicated than the latter.
$\bullet$ The Nullstellensatz.
Rather, if you study algebraic number theory and algebraic geometry at more or less the same time, you'll see that much of what you're doing is commutative algebra and that algebra will be well motivated.  Among reasonably introductory texts I know of exactly one that pulls this off well: this text by my colleague Dino Lorenzini.
(Since my own commutative algebra notes have been mentioned, let me say that I view these notes as being at approximately the level of a student who has had a first, relatively nontechnical, course in either algebraic number theory -- e.g. from Marcus's text -- or algebraic geometry -- e.g. from Shafarevich's text -- and has been told that she needs to learn some commutative algebra before proceeding onward.  On the other hand, my notes draw more explicitly on examples from topology and geometry than from either of the aforementioned areas.)
A: There's no law against reading more than one book at a time!
Although algebraic number theory and algebraic geometry both use commutative algebra heavily, the algebra needed for geometry is rather broader in scope (for alg number theory you need to know lots about Dedekind domains, but commutative algebra uses a much wider class of rings). So I don't think you can expect that there will be a textbook on number theory which will also teach you all the algebra you need for algebraic geometry.
