ModDB Wiki
Advertisement

A database is a place where large amounts of information can be stored and categorized through tables. This article focuses on databases software and the usage of it.

Example[]

Let's assume that there's an online game, which needs to support a variable amount of players. Each player needs to have (as an example) a name, an age and a rank associated with him/her. While this is might be easy to store in a simple text file, it is not feasible in the long run, as the file easily becomes unstructured and thereby unoptimized. It is also certainly not a secure way to handle it. That's where a database might come in handy.

A database contains tables, which have predefined headers which define what kind of information goes into the table. In our previous example, whenever a new player would create a new account, a new row would be appended onto the end of the table through code. If we had an existing table of players, and a new player called Eric created an account, this is what the player table could look like:

id name age rank
0 Jake 27 Virtuoso
1 Anna 17 Beginner
2 Eric 35 None

(The green marking only shows that where the new row would appear.)

In code, the data from this table can later on be retrieved through various functions. Individual table cells can be modified, rows can be deleted, and so on. This information is stored internally by the database system, and the programmer only needs to take care of editing/reading the tables as opposed to also parsing text files.

The id value can prove to be very handy, and is commonly placed as the first column in tables. It can be used to find identify specific rows as all the id:s are supposed to be unique.

Common Database Systems[]

Advertisement