Exercise

Limiting results

Let's take a look at a few of the genres represented in our library's books.

Recall that limiting results is useful when testing code since result sets can have thousands of results! Queries are often written with a LIMIT of just a few records to test out code before selecting thousands of results from the database.

Let's practice with LIMIT!

Instructions

100 XP
  • Using PostgreSQL, select the genre field from the books table; limit the number of results to 10.