 Hey there and welcome to Learn WordPress. In this tutorial, you will be learning about the WordPress database. You will learn about the different tables in the WordPress database, what they are used for and learn about core WordPress functions to use or anyone to interact with this database database. WordPress uses a database to store, treat and display all the contents that you can create on your website. This includes posts, pages, comments and more. The database is also used to store information about your website's users and various site options that power your site. WordPress uses a database management system called MySQL. MySQL is a free open source database management system that is used by many popular web applications. There are a few ways to interact directly with your WordPress database. The majority of local development environments or hosting companies use a free tool called PHP MyAdmin. PHP MyAdmin is a web-based tool that allows you to interact with your WordPress database using a web browser. An alternative to PHP MyAdmin is a tool called Adminer. Adminer is a single PHP file that you can upload to your website and it provides a similar interface to PHP MyAdmin. Some hosting companies and local development environments prefer to use Adminer instead of PHP MyAdmin. Finally, if you don't have access to either, you can also install a plugin called SQLBuddy. This is a free WordPress plugin that provides a similar interface to PHP MyAdmin and Adminer, but it runs inside your WordPress dashboard. If you do decide to use SQLBuddy, please remember to deactivate and delete the plugin when you are done using it. Leaving it installed on your website is a possible security risk. For the purposes of this tutorial, we will be using PHP MyAdmin to interact with the WordPress database. The WordPress database is made of many tables. Each table stores different types of data for your website. Each table has the same prefix, which is defined in the wp-config file. By default, the prefix is wp-underscore. But you can change this to anything you like during the WordPress installation process. Let's start by looking at the most important tables for managing content. The WP Posts table is probably the most important table in your WordPress site and stores information about your website's posts, pages, or any other custom posts type. Each row in the WP Posts table represents a single post. The WP Posts meta table allows you to store additional information about each post. The post meta are also often referred to as custom field. The WP comments table stores information about the comments on your posts and pages. Whenever someone comments on a post or page, this table is hired that comment is stored. Each row in the WP comments table represents a single comment. The WP comment meta table can store additional information about each comment. The WP user's table stores all the information about your website's users. Each row in the WP user's table represents a single user. Like other meta tables, the WP user meta table can store additional information about each user. For all WordPress database tables, there are functions that you can use to interact with the table. These functions from part of the WordPress database API. All of these functions can be found by using the search feature in the WordPress developer documentation under code reference. Generally, the functions that you can use to interact with the WordPress database all follow a similar pattern. There are an insert function, an update function, and a delete function. These usually have the same name with the prefix WP followed by the action followed by the name of the table. Let's look at these functions for posts for example. WP insert post is the function to create a new post. WP update post is the function to update an existing post. WP delete post is the function to delete a post. Then there are usually functions to fetch either all the records from a table or a single record. These usually have the same name with the prefix get followed by either the singular or plural name of the table. So for example, getPost is the function to fetch a collection of posts. And getPost is the function to fetch a single post. Each of these functions typically has a number of parameters that you can use to filter the results that are returned. Then there are also functions to interact with any meta tables usually to insert, update or delete meta fields. These usually have the same name with the action followed by the singular name of the table followed by meta. So for example, for post, addPostMeta is the function to insert a meta field. Similarly, updatePostMeta is the function to update a meta field, deletePostMeta is the function to delete a meta field. The WPTerms, WPTermMeta, WPTermRelationships and WPTermTexDynamicTables are the tables that manage the categories and tags in your WordPress site. The WPTerms table stores information about your website's terms. Each row in the WPTerms table represents a single term. Under the hood, categories and tags are both terms. What determines whether they are a category or a tag is the taxonomy that they are associated with, which is stored in the WPTermTexDynamic table. The WPTermRelationships table stores the relationship between terms and their parent's objects, be that a post, base or custom post type. Finally, the WPTermMeta table can store additional information about each term. Similar to the functions to interact with posts, comments and users, there are also functions to interact with terms and texonomies, which can be found by searching the WordPress code reference for terms or texonomy. The WPoptions table stores information about your website's settings. Each row in WPoptions table represents a specific setting. For example, the site URL option stores the URL of your website and the block description option stores the tagline of your website. The WPoptions table also stores information about your website's active theme and active plugins. Data is stored in WPoptions table using a key value format. The key is the name of the option and the value is the value of the option. It is also possible to store serialized data in the WPoptions table. Serialized data is a string that contains multiple values. Serialized data is often used to store errors and objects of data. The options API is typically used along with the settings API to create setting pages for the WordPress dashboard, either via code, plugin and themes. The options API provides functions to interact with the WPoptions table like add-option, update-option and delay-option. The WPLink stable stores information about your website's links. Each row in the WPLink stable represents a single link. Links was a feature that was removed from WordPress in version 3.5. However, the WPLink stable is still included in WordPress database for backwards compatibility and it is still possible to add links to your website using the links manager plugin. And that wraps up the overview of the WordPress database. Happy coding!