Database Reference
In-Depth Information
CustomerNum
CustomerName
Balance
77
148
282
356
408
462
524
608
687
725
842
Al's Appliance and Sport
Brookings Direct
Ferguson's
The Everything Shop
Bargains Galore
Kline's
Johnson's Department Store
Lee's Sport and Appliance
Deerfield's Four Seasons
All Season
6550.00
431.50
5785.00
5285.25
3412.00
12762.00
2106.00
2851.00
248.00
8221.00
10 rows in set (0.02 sec)
FIGURE 3-3b
Query results (MySQL)
EXAMPLE 3
List the complete Part table.
You could use the same approach shown in Example 2 by listing each field in the Part table in the
SELECT clause. However, there is a shortcut. Instead of listing all the field names in the SELECT clause, you
can use the * symbol. When used after the word SELECT, the * symbol indicates that you want to include all
fields in the query results in the order in which you described them to the DBMS when you created the table.
To include all the fields in the query results, but in a different order, you would type the names of the fields
in the order in which you want them to appear. In this case, assuming the default order is appropriate, the
query design appears in Figure 3-4.
Asterisk indicates all ields
will be included in the query
results
FIGURE 3-4
SQL query to list the complete Part table
Search WWH ::




Custom Search