Average Deal Size and Revenue by Product Line
Write a query to analyze won opportunities (Closed Won) in Q1 2026 by product line. Return product_line, avg_deal_size, total_revenue, won_count. Order by total_revenue descending.
12 SQL practice questions in our Salesforce collection, part of our 188-question bank across 23 companies. Write SQL against practice datasets and get checked in your browser. Free, no card or trial.
No account needed to start. Draft SQL stays in this browser; create an account to sync solved history.
1 Easy · 6 Medium · 5 Hard
Independent practice resource. Not affiliated with or endorsed by Salesforce.
These topics come from the questions in this set. Pick one to open the matching problems.
Write a query to analyze won opportunities (Closed Won) in Q1 2026 by product line. Return product_line, avg_deal_size, total_revenue, won_count. Order by total_revenue descending.
Identify high-engagement accounts in Q1 2026: those with 20+ activities and 5+ different activity types. Return account_id, account_name, total_activities, activity_type_count, total_engagement_minutes. Order by total_activities descending.
For opportunities created in Q1 2026, calculate win rates by billing region and stage. Join accounts, opportunities, and opportunity_stages to get region and stage details. Return billing_region, stage_name, stage_order, opportunity_count, won_count, win_rate_pct. Order by billing_region, stage_order.
12 Salesforce problems, each with its own dataset. Click one and you’re in the workspace, free, right in your browser.
Your dataset
opportunity_id (VARCHAR) · account_id (VARCHAR) · amount (DECIMAL) · close_date (DATE) · stage_name (VARCHAR) · is_won (BOOLEAN)
line_item_id (VARCHAR) · opportunity_id (VARCHAR) · product_id (VARCHAR) · quantity (INTEGER) · unit_price (DECIMAL)
product_id (VARCHAR) · product_name (VARCHAR) · product_line (VARCHAR)
Start free, no account needed. When you create one, everything you’ve solved comes with you — solved marks, streaks, and concept ratings on your dashboard.
Practice Salesforce SQL free188 SQL practice questions. 23 companies. Free access to every problem.