Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Answering Questions from a Table - Intro to Relational Databases

Get Embed Code
4 Languages

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

  1. So to answer the first question, we
    need to look for the birth date column,
  2. in the row that talks about Max
    the Moose, not Max the Gorilla though.
  3. And there it is.
  4. Max the Moose was born on February 20th,
  5. Next we want to know if there were any
    llamas born between 1995 and 1998.
  6. Well here are all the animals
    whose species is llama.
  7. And we can scan through these,
  8. to see if any of the birth
    dates are between those years.
  9. And sure enough, here's Alison.
  10. So the answer is yes.
  11. Number three,
    which gorilla was George's mother?
  12. Nothing in this table tells us anything
    about the family relationships between
  13. gorillas or any of the other animals.
  14. So we can't tell which
    gorilla was George's mother.
  15. You might guess that it was Sue,
  16. but we don't know, so
    this should be left blank.
  17. And finally,
    how many gorillas are there?
  18. This question's a little bit trickier.
  19. Obviously as humans we can answer
    this question just by counting rows.
  20. But in turns out that
    a database can do that too.
  21. Whenever we look for an answer that
    combines the values from several rows.
  22. Whether by counting them, or
    adding up numerical values, or
  23. finding the average, we're doing
    what's called an aggregation.
  24. Counting is about the simplest
    aggregation there is, and
  25. in this case the answer is
    there are three gorillas.