What is a chess database used for? I frequently see advice about how to learn chess that include links to databases, or how to set them up, or a question here about Analysis where the accepted answer says to just add some stuff to your database.

But what is that database, really? I never saw an explanation for that.

And how would a beginner use a database? Why does everyone talk about databases but never explain what they are in first place?

I assume they are important, since seemingly there are lots of companies that get lots of money solely by selling chess databases...
what is that database, really?

A chess database is basically a collection of chess games, i.e. a collection of moves with metadata such as player names, date, Elo rating of players, place, opening name ... It can also include comments/annotations for some or all games.

There are various websites such as lichess, chesstempo, 365chess where you can access chess databases for free. Alternatively you can download database files from the internet or buy them from somewhere like ChessBase and access them on your computer. For this you need a program/application such as Scid (free) or ChessBase (not free) which can read the database files and allows you to play through the games and do all kinds of searches/manipulations to the database files.

Also you can of course manually add your (or anybody else's) games to the database.

how a beginner use a database?

You don't, really. As a beginner you should focus on learning general principles of playing chess and studying tactics. You don't really need a database for either.

How can a database be used?


Databases are immensely useful for studying openings. They allow you to keep all the variations/sidelines nicely ordered, you can add comments to moves, you can see which line is the most popular, which line has the highest winning percentage (or which line is more drawish, which more risky...), you can filter games (e.g. show only recent, or only games of high rated players or only white wins, or only a certain variation...). Based on this you can build an opening repertoire (which you could save in a separate database) and/or expand your opening knowledge. Also chess database software works well together with chess engines which gives you further possibilities for study. Unlike books, a database can always updated (e.g. from twic), so you always have the latest developments in opening theory at hand.
You can also use the database to study middle- or endgame plans. For instance you can search the database for specific positions and/or material distributions and then see how a grandmaster plays these positions.
You can prepare for a game against an opponent by studying his/her games beforehand (assuming there are games of your opponent in the database) looking for weaknesses in the opening repertoire or weaknesses in playing certain types of positions.
You could use it to follow your favorite chess player's games just for fun.