Team Fly 

Page 87

      Nielley      Farmington        $64,509.91
                              CONFIDENTIAL REPORT
      Mon Jan 12                                                   page 2
                             Customer Sales Report
                                   Utah Region
      Last                               Total
       Name        City                   Sales
      ------------ --------------- ------------
      Vankirk      Farmington        $19,279.94
      Campbell     Farmington            $11.99
      Robbinette   Farmington        $11,167.65
                             CONFIDENTIAL REPORT
      9 rows selected.
Project Summary

With some simple formatting commands available within SQL*Plus, we were able to transform the unformatted, difficult-to-read output into a simple and effective report. SQL*Plus has many formatting options available above and beyond the few we have demonstrated here. As you become more familiar with SQL and SQL*Plus, take the time to research and try more of the available formatting options. We think you'll agree that SQL*Plus is an effective query tool and report formatter.

Writing SQL*Plus Output to a File

The spool command will save the output to a datafile. If your database is on a Windows operating system, the command spool c:\reports\output.dat would capture the output of the query execution in the ''output.dat" file.

Image Chapter 2 Mastery Check

1. DDL and DML translate to ________ and ________, respectively.

2. Which of the following descriptions is true about insert statements?

A. Insert statements must always have a where clause.

B. Insert statements can never have a where clause.

C. Insert statements can optionally include a where clause.

3. In addition to the two mandatory keywords required to retrieve data from the database, there are three optional keywords. Name them.

Team Fly 
0106