Section 21.6 More SELECT Keywords
So far we have covered selecting the data from all fields from a table, from just one specified field, and from a list of fields.
Checkpoint 21.6.1.
There are other keywords that you can use with SELECT. Run the following to see what they do.
Checkpoint 21.6.2.
Run the following to see what COUNT and LIMIT do.
Checkpoint 21.6.3.
Run the following to see what MAX does
Checkpoint 21.6.4.
Run the following to see what ORDER BY does
Checkpoint 21.6.5.
Run the following to see what ORDER BY does
Checkpoint 21.6.6.
Checkpoint 21.6.7.
Given a database of bike share information write a SELECT statement to retrieve the bike_number
and duration
from table trip_data
but order the data by bike_number
in descending order and limit the number of items returned to 5.
What happens if you try to limit the number of items returned before you specify how to sort the data in the SQL above?