Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Daily Ship Venue Booking Totals

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Daily Ship Venue Booking Totals. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

BlueWave Cruises wants a daily summary of activity by ship and venue. Write a SQL query to aggregate booking data by day, ship, and venue.

Requirements

  1. Return one row per booking_date, ship_name, and venue_name.
  2. Calculate the total number of bookings and total guest count for each group.
  3. Exclude rows where booking_date is NULL.
  4. Sort the output by booking_date, then ship_name, then venue_name.

Schema

venue_bookings
ColumnTypeDescription
booking_idPKINTUnique booking record ID
booking_dateDATEDate the booking was made
ship_nameVARCHAR(100)Name of the ship
venue_nameVARCHAR(100)Name of the onboard venue
guest_countINTNumber of guests in the booking
booking_statusVARCHAR(20)Booking status such as confirmed, cancelled, or waitlist
Tablesvenue_bookings
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results