O'Reilly logo

Web Database Applications with PHP and MySQL, 2nd Edition by David Lane, Hugh E. Williams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. Advanced SQL

The SQL shown in Chapter 5 was sufficient for the scripts in earlier chapters and for the winestore application that's described in the next five chapters. However, SQL is extremely powerful and provides many other capabilities, some of which we'll cover in this chapter. Examples of these useful features include advanced join types, nested queries, and aliases.

Many of the features shown in this chapter are specific to MySQL's version of SQL. For example, MySQL's functions are useful tools for working with strings, dates and times, and math. Also, we'll show some ways to tune MySQL in order to improve application performance. It's important to know how to choose and design indexes for fast querying, and how to use MySQL's query cache for fast results.

We cover the following topics in this chapter:

  • Exploring your database, tables, indexes, and performance with SHOW

  • More on SELECT queries, including advanced join types, aliases, nested queries, user variables, and the limitations of MySQL

  • More on manipulating data and databases, including finding out about tables and databases, creating tables with queries, altering tables, more on the UPDATE and DELETE statements, and bulk loading and exporting data

  • Functions and operators in SQL and MySQL

  • Automatically running queries

  • MyISAM, InnoDB, and Heap table types

  • Backup and recovery, and transferring data between database servers

  • Managing database server users and privileges, and creating users for web database applications ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required