There are two types of nitrogen-containing bases in DNA and RNA - purines and pyrimidines. Purines have two rings fused together, while pyrimidines have a single ring. Adenine and guanine are found in both DNA and RNA, while thymine is only found in DNA and uracil only in RNA. A nucleotide consists of a nitrogenous base, a pentose sugar (ribose or deoxyribose), and phosphate groups. Nucleotides bond together to form nucleic acids like DNA and RNA, which store and transmit genetic information in cells.