A database management system has two main functions: storing data and providing easy access to that data. Storing data is nothing special; a file cabinet can perform that chore. The hard part of data management is providing easy access. For data to be useful, you must be able to separate the (usually) small amount you want from the huge amount you don't want.
SQL enables you to use some characteristics of the data to determine whether a particular table row is of interest to you. The
UPDATE statements convey to the database engine (the part of the DBMS that interacts directly with the data) which rows to select, delete, or update. You add modifying clauses to the
UPDATE statements to refine the search to your specifications.
The modifying clauses available in SQL are
GROUP BY, and
ORDER BY. The
FROM clause tells the database engine which table or tables to operate on. The
HAVING clauses specify a data characteristic that determines whether or not to include a particular row in the current operation. The
GROUP BY and
ORDER BY clauses specify how to display the retrieved rows. Table 9-1 provides a summary.
Table 9.1. Modifying Clauses and Functions
Specifies from which tables data should be taken
Filters out rows that don't satisfy the search condition
Separates rows into groups based on the values in the grouping columns ...