A database is, in simple terms, a place to store and retrieve data. Like a filing cabinet. This could be numbers, text, essays about Leeroy Jenkins, or 0's and 1's. In practical usage, web hosting databases store your blog entries, the date they were posted, the comments people posted with them, and your login information. It's all stored in a database.
If you want to store any kind of data, like blog posts or comments, on your website then you need a database. If you want to use almost any type of web scripts like a blog (WordPress, b2evolution), a forum, (phpBB, bbPress), a shopping cart (ZenCart, OSCommerce), a Content Management System (Joomla, Drupal), a Photo Gallery (Coppermine), or a Wiki…(deep breath)…you need a database. Almost all web applications need web hosting databases.
Can't you just use a text file to store your data? Yes, but…only one person can write to a text file at a time. What if you have 2000 visitors on your web site who all want to post a comment? It won't work. That is partly why "relational databases" were invented. A relational database is a collection of data tables. You can think of a database table as a spreadsheet. It has different types of fields across the top and each row has data for a different object. Each table can be linked, or related, to another table. These features make it easy to organize data and allow multiple people to read or write data to the database at the same time. Bring on the visitors! Popular relational web hosting databases include:
Other web hosting databases that are used include:
Most modern web hosting databases use what is called SQL or Structured Query Language. This is a standard way of retrieving and modifying data in a database. A "SQL query" is a specific command to retrieve, modify or add data to a database and any database that supports SQL will be able to understand it. This is a SQL query that will retrieve all of the data in a database table:
SELECT * FROM my_customers;
This might return something like this:
You use similar SQL statements to put information into a database table (INSERT INTO my_customers (name,telephone,email) VALUES ("Sam",444,"firstname.lastname@example.org");).
If you want to learn more about web hosting databases, check out the documentation for the most popular web database: MySQL. W3Schools also has an excellent introduction to SQL, and you can read Philip Greenspun's "Database-backed Web Sites".
If you are looking for a web host that supports a particular type of database make sure to read reviews of web hosts and check out the following pages: