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.

There are other keywords that you can use with SELECT. Run the following to see what they do.

Run the following to see what COUNT and LIMIT do.

Run the following to see what MAX does

Run the following to see what ORDER BY does

Run the following to see what ORDER BY does

Before you keep reading...

Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.

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?

You have attempted 1 of 8 activities on this page