The problem Which hours of the day get the most orders (all statuses)? Show the 5 busiest hours.
Return hour_of_day (0–23) and orders, busiest first. Break ties by the earlier hour.
Learn this in the course: SELECT, WHERE and ORDER BY (video and notes)
Tables · ClearBite food delivery ClearBite is a fictional food-delivery app in 8 Indian cities. The data covers calendar year 2025 and is invented.
Click a table or column name to insert it into your query. Open a table to see its columns.
orders 9,975 rows · 11 columns order_id INTEGER · primary key customer_id INTEGER · → customers restaurant_id INTEGER · → restaurants ordered_at TIMESTAMP · local time status TEXT · delivered | cancelled | refunded payment_method TEXT · upi | card | cod | wallet coupon_code TEXT · → coupons, NULL if none subtotal INTEGER · rupees, food only discount INTEGER · rupees delivery_fee INTEGER · rupees total INTEGER · subtotal − discount + delivery_fee Sample rows (9,975 total) order_items 16,314 rows · 4 columns order_id INTEGER · → orders item_id INTEGER · → menu_items quantity INTEGER unit_price INTEGER · rupees Sample rows (16,314 total) customers 3,000 rows · 6 columns customer_id INTEGER · primary key name TEXT · not unique city_id INTEGER · → cities signup_date DATE acquisition_channel TEXT · organic | referral | paid_social | search_ads | offline, can be NULL is_premium BOOLEAN · free delivery membership Sample rows (3,000 total) restaurants 300 rows · 7 columns restaurant_id INTEGER · primary key name TEXT · not unique city_id INTEGER · → cities cuisine TEXT is_veg_only BOOLEAN cost_for_two INTEGER · rupees onboarded_date DATE Sample rows (300 total) menu_items 2,482 rows · 6 columns item_id INTEGER · primary key restaurant_id INTEGER · → restaurants item_name TEXT category TEXT · main | starter | bread | rice | dessert | beverage is_veg BOOLEAN price INTEGER · rupees Sample rows (2,482 total) deliveries 9,173 rows · 6 columns order_id INTEGER · primary key, → orders (delivered and refunded orders only) partner_id INTEGER · → delivery_partners picked_up_at TIMESTAMP delivered_at TIMESTAMP distance_km NUMERIC(4,1) promised_minutes INTEGER · time promised at checkout, from ordered_at Sample rows (9,173 total) ratings 4,181 rows · 4 columns order_id INTEGER · primary key, → orders food_rating INTEGER · 1–5 delivery_rating INTEGER · 1–5, can be NULL rated_at TIMESTAMP Sample rows (4,181 total) delivery_partners 400 rows · 5 columns partner_id INTEGER · primary key name TEXT city_id INTEGER · → cities vehicle_type TEXT · bike | scooter | ev_scooter | bicycle joined_date DATE Sample rows (400 total) coupons 8 rows · 7 columns coupon_code TEXT · primary key description TEXT discount_pct INTEGER max_discount INTEGER · rupees min_order_value INTEGER · rupees, on subtotal valid_from DATE valid_to DATE Sample rows (8 total) cities 8 rows · 4 columns city_id INTEGER · primary key city TEXT state TEXT tier INTEGER · 1 = metro, 2 = smaller city Sample rows (8 total) Next: Restaurants with no December orders →