About 6 months ago I did a lot of research looking for off-the-shelf shopping cart solutions. In the end we did a custom one in PERL. During the research though I became impressed with MIVA merchant (MM)- which is well tested, stable and configurable.

In general, I would be careful in writing your own cart, since code errors might result in fraud for your visitors. At the very least, if you are doing credit card processing, I would get some professional feedback about security before I went live. Dan Meriwether at delux.com is really good at this sort of disaster proofing. Still, it may be better (and cheaper) go with a proven system like MM.

If you are going to learn a db system, I would put my money on PHP/MySQL as a horse that's likely to finish the race.

cheers
diane
http://www.thenwhen.com/thenblog/