English subtitles

← Self Joins - Intro to Relational Databases

Get Embed Code
4 Languages

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

  1. When you ran this query,
    what was it that wasn't right about it?
  2. Well, it seems to think
    that each student is his or
  3. her own roommate, and it lists each pair
    of roommates twice in alternating order.
  4. There are a lot of ways to fix this,
    but here's just one of them.
  5. By asking only for the rows where
    this id, is less than that id.
  6. We eliminate the rows where they're
    equal, in other words the same student.
  7. And, we eliminate one out
    of each pair of duplicates.