English subtitles

← Count all the Species - Intro to Relational Databases

Get Embed Code
4 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. In the last quiz, you figured out
    which select clauses you'd need to
  2. do some particular queries.
  3. Now let's do one of
    those queries in SQL.
  4. It's time to take attendance at the zoo.
  5. We need to know how many of
    each species we have, and
  6. it would be a big help if we had
    the most popular species listed first.
  7. Because, they'll take the most time for
    the zookeepers to count.
  8. We've put a cheat sheet of all
    the select clauses we've seen so
  9. far, in the instructor notes below
    the editor on the next page.
  10. But, you have to put
    them together correctly,
  11. into a query that makes sense.
  12. Feel free to take a few tries,
    using the test round button.
  13. You'll see the result table down below.
  14. When you've got it, press Submit,
  15. and your query will be tested
    against a larger database.
  16. So here's the problem.
  17. Write a query that returns all the
    species in the zoo, and how many animals
  18. of each species there are, sorted with
    the most populous species at the top.
  19. And here's an example,
    if the zoo had 4 gorillas, 2 alpaca,
  20. 1 brown bear and no other animals,
    then we'd get a result like this.