Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Filtering

Select all rows from the penguins table where the species is "Chinstrap":

SELECT *
FROM penguins
WHERE species = 'Chinstrap';

Select all rows from the penguins table where the year is 2007 or 2008:

SELECT *
FROM penguins
WHERE
  year = 2007
  OR year = 2008;

Select all rows from the penguins table where the sex includes "male" (case-sensitive):

SELECT *
FROM penguins
WHERE sex LIKE '%male%';

Select all rows from the penguins table where the sex includes "male" (case-insensitive):

SELECT *
FROM penguins
WHERE sex ILIKE '%male%';