Got a YouTube account?

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

English subtitles

← Introduction to Database Schemas - Intro to Data Science

Get Embed Code
4 Languages

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

  1. Relational databases always have a schema. What is
  2. a schema? In layman's terms a schema is
  3. a blueprint that tells the database how we
  4. plan to store our data. More specifically, a schema
  5. basically says that for a given table, every
  6. single row or entry will have the exact same
  7. number of columns that correspond to the same
  8. values and that each column's value will be formatted
  9. in the same way. So, for example, in this table, I can say that there are
  10. four columns: district name, capital city, size, and
  11. population. District name and capital city might always be
  12. strings, where size might be a float, and
  13. population might be an int. This list of columns
  14. and their requirements on how their values are
  15. formatted define the schema for this table. Now let's
  16. add some entries to the table. Let's say
  17. the first [UNKNOWN] I wish to enter is corresponds
  18. to the district Gujarat which has 60,439,692 people,
  19. has an area of 196,024 square kilometers and has
  20. a capital city of Gandhinagar. All of these
  21. entries fit the schema, so inserting this row into
  22. the table is fine. Now, let's say I
  23. had another I wish to add, the Maharashtra district,
  24. which has a capital city of Mumbai, and I provide no
  25. other values. This would also be allowed, but for all columns for
  26. which I don't specify values, the value would either be set
  27. to null or default values that are stored in the table definition.