The SQL query box
phpMyAdmin allows us to accomplish many database operations via its graphical interface. However, there will be times when we have to rely on SQL query input to achieve operations that are not directly supported by the interface. Following are two examples of such queries:
SELECT department, AVG(salary) FROM employees GROUP BY department HAVING years_experience > 10; SELECT FROM_DAYS(TO_DAYS(CURDATE()) +30);
To enter such queries, the SQL query box is available from a number of places within phpMyAdmin.
The Database view
We encounter our first SQL query box when going to the SQL menu available in the Database
view.
This box is simple—we type in some valid (hopefully) MySQL statement and click on Go. Under the query text area, there are bookmark-related choices (explained later in Chapter 14). Usually, we don't have to change the standard SQL delimiter, which is a semicolon. However, there is a Delimiter dialog in case we need it (refer to Chapter 17).
For a default query...