Lecture

Filter Bookings by Region

Imagine you're a regional manager at a hotel chain, and your job is to analyze bookings by location.

Right now, you need to generate a list of all bookings in New York state, so the marketing team can focus on targeting guests in that area.

To do this, you'll filter the dataset using the WHERE clause, one of the most common tools in SQL for narrowing down rows based on conditions.


What to Show

From the bookings table in the hotel_booking.sqlite database, display:

  • hotel_name
  • city
  • state

Only include rows where the state is 'NY'.


Instructions

Write a SQL query in the editor that returns only bookings made in New York state.

Use a WHERE clause to filter the state column so that only rows with 'NY' are included.

This is a warm-up task to refresh your filtering skills before moving on to more advanced queries.

sqlQuiz
?

Lecture

AI Tutor

Design

Upload

Notes

Favorites

Help

Code Editor

Run
Generate

Tables

Execution Result