Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Oliver Williams
Oliver Williams
6,278 Points

Why do you need SQL for WordPress?

I have seen some WordPress jobs advertised that wanted SQL knowledge. I know that WordPress uses the SQL database but can anyone give specific examples of when using a SQL query would actually be necessary/useful when working with WordPress? Its not something I've ever run into a need to do. I have already done some of the SQL courses on Treehouse so don't think I'll find it hard to make a query, but I can't think of any situations where it would really be a cool/useful thing to do.

3 Answers

Oliver Williams
Oliver Williams
6,278 Points

Hi Cindy, I am primarily interested in custom SQL queries.

Joel Bardsley
Joel Bardsley
31,246 Points

It would be particularly useful for plugin development where you need to add your own tables to the WP database.

As an example, I've previously worked on a WordPress site that had custom functionality to provide a voting system on community-driven projects that were eligible for funding. In order to make the voting fair we had to create new tables in the WP database in order to manage each project and corresponding vote for validity, and then provide separate views for customers (logged in), public (not logged in) and staff members who had extra permissions to remove/report suspicious votes.