Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Daily Ship Venue Booking Totals
00:00
5 left

Daily Ship Venue Booking Totals

EasySQL · PostgreSQL

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
Interviewer

Your question is Daily Ship Venue Booking Totals. Start with the requirements and the one table in the Question tab.

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.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.