Oh dear… this might be abit lengthy to answer so try to bare with me!
First of all… in terms of storing data outside and in some kind of database, that really depends on what sort of database you plan on making. I’d suggest, if you’re new to databases, to start with File Outputs/Writes http://www.cplusplus.com/doc/tutorial/files/
I recommend trying out these examples and bringing in data this way. This will essentially boil down to the bare basics of proper data-base handling… well I wouldn’t exactly say proper but enough to get the job done. Afterwards once you have this system working you’re going to want something much faster, much more efficient and something that is easy to edit. MYSQL. Though I haven’t personally done much with MYSQL so I can’t really say how difficult that will be.
Phew. Anyways, you should probably get started with the link I provided. Good luck!