In code, you use conditional expressions to make decisions and determine which tasks to run. SQL gives you this same ability. You use the keyword WHERE like you would when using an if in PHP. Let’s talk about how you filter to grab the content you want.
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
WordPress to Database Relationship
This episode is very important. Make sure you get it! Let’s explore the relationship between WordPress and its database. You’ll look at where the content comes from in the database that populates the back-end interface for a post. You’ll explore each of the columns in wp_posts, fields in the wp_postmeta, featured thumbnail image and where it resides, and the author (which relates to the wp_users and wp_usermeta tables. You’ll learn about the glue that binds pieces of information together, such as post metadata and how these are glued to the associated record in the posts database table. The primary database […]
Your First SQL Query
Let’s query the posts database table by writing some SQL within your favorite GUI, i.e. phpMyAdmin or Sequel Pro. We’ll walk through the SQL commands and how to grab information that is conditional upon some value. Your query will be: Then you’ll adapt the query to grab more information.
The Big Picture
In this episode, you will be introduced to databases and SQL. You’ll use either phpMyAdmin or Sequel Pro to explore the actual WordPress database tables. You’ll learn about: What a relational database is Columns Rows and records Schema Primary keys and more
Lab Introduction
Let’s talk about what a database is, what one WordPress uses, and what this lab will do for you.
Advanced SQL – Get Posts Grouped by Terms
This hands-on lab teaches you more advanced SQL including table relationship types, how to join multiple tables together, and how to write SQL queries that are faster and more scalable for your WordPress projects. You will use a practical example plugin to test two different approaches to solving the problem of fetching posts that are grouped by each term. You’ll test these approaches, explore the actual SQL queries, and learn about the impact of processing speed, performance, and scalability.
Introduction to Databases
Dynamic content requires a storage system to retain the content, settings, and information. WordPress uses MySQL as its relational database. In this hands-on lab, you will dig into the WordPress database structure, do basic raw SQL queries, and learn about the relationship between WordPress and its database.
Get Familiar with WordPress Posts Database Table
Have you ever opened up your database? Have you poked around in there to understand the layout and different buckets of content and information? In today’s quick tip, you’ll look at the wp_posts database table. You’ll learn about basic database terminology, such as record, row, primary key, and columns. You’ll see how the columns within a record relate to the content you see in the WordPress back-end.
What is a Post Type?
In this episode, you will learn about what a “post type” is within WordPress. You’ll look in the wp_posts database table to see the column named post_type. You’ll see how this column relates to the buckets of content.