Chapter 11Advanced SQL Queries

As you’ve worked through the construction of the Internet Joke Database website, you’ve had opportunities to explore most aspects of Structured Query Language (SQL). From the basic form of a CREATE TABLE query to the two syntaxes of INSERT queries, you probably know many of these commands by heart now.

In an effort to tie up some loose ends in this chapter, we’ll look at a few more SQL tricks that we’ve yet to come across—some having been a bit too advanced to delve into before now. As is typical, most of these will expand on your knowledge of what’s already the most complex and potentially confusing SQL command available to you: the SELECT query.

Sorting SELECT Query Results

Long lists of information are always ...

Get PHP & MySQL: Novice to Ninja, 5th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.