English subtitles

← Database Concepts - Intro to Relational Databases

Get Embed Code
5 Languages

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

  1. Okay, let's do a quiz.
  2. Our zoo, it turns out,
    needs a database to keep track of
  3. all the people who have
    donated money to the zoo.
  4. One of our programmers has come up
    with an object oriented description of
  5. a donor class.
  6. It has attributes for
  7. a person's name, and their favorite
    animal, and their phone numbers.
  8. That way for instance, when there's
    a new born baby gorilla in the zoo,
  9. the zoo keepers can call Mary up,
    and tell her about it.
  10. For phone numbers,
    a person might have more than one.
  11. So we'll support home and
    mobile, and work phone numbers.
  12. So if we want to store this
    information in a relational database,
  13. instead of just in objects in memory,
    how many tables do you think we'll need?
  14. Oh, wait, not that kind of tables.
  15. This kind of table.
  16. Because a person can have more than one
    phone number, we're going to want to
  17. have one table for donors, and
    one for donor's phone numbers.
  18. This is the same sort of situation,
  19. as when we had animals that eat
    multiple different kinds of food.
  20. Now, what's going to go in these tables?
  21. First, what columns do you
    think might go in these tables?
  22. And second,
    how would you represent Mary and
  23. her two phone numbers in these columns?
  24. Fill in the column names in
    the top of each table, and
  25. then the values that you'd put
    in them in the table body.