Lecture

Filter Bookings by Region

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

You need to create a list of all bookings made in New York state, so the marketing team can focus on guests from that region.

To do this, you’ll use the WHERE clause — one of SQL’s most common tools for filtering rows based on specific conditions.


Task

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

  • hotel_name
  • city
  • state

Only include rows where the state is 'NY'.


How to solve it

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

Use a WHERE clause to filter the state column so only rows with 'NY' appear in your results.

sqlQuiz
?

Lecture

AI Tutor

Design

Upload

Notes

Favorites

Help

Code Editor

Run
Generate

Tables

Execution Result