9.4. Filtering

We’ve seen how to look only at certain columns of the table but it is often useful to only look at certain rows in a table. For example, we could want to look only at the bike trips which are at least a certain number of minutes. Let’s say you’re only interested in bike trips of 60 minutes or more:

It’s also possible to filter by multiple criteria. For example to look at only bike trips which are 60 minutes or more and only the subscriber type of Member:

9.4.1. Practice Exercises

Figure out how to get all the trips on the bike with id of W01274 and only include rides which are shorter than 15 minutes.

Get the ending station and the duration of all of the bike trips originating at station 31111 that lasted 8 hours or more.

How many trips longer than 8 hours started and ended and station 31111 by casual riders?

Lesson Feedback

    During this lesson I was primarily in my...
  • Comfort Zone
  • Learning Zone
  • Panic Zone
    Completing this lesson took...
  • Very little time
  • A reasonable amount of time
  • More time than is reasonable
    Based on my own interests and needs, the things taught in this lesson...
  • Don't seem worth learning
  • May be worth learning
  • Are definitely worth learning
    For me to master the things taught in this lesson feels...
  • Definitely within reach
  • Within reach if I try my hardest
  • Out of reach no matter how hard I try
You have attempted of activities on this page
Next Section - 9.5. Sorting