SoftwareTestPilot
LearnCoding RoundsCommunityJobsQA Resources
All questions
BasicSQL~8 min

Employees earning above their team average

Frequently asked correlated-subquery question in database testing rounds

Points available

100/100

Your mission

  1. Read
  2. 2Run
  3. 3Submit
  4. 4Solve

Return name, team and salary of every employee whose salary is higher than the average salary of their own team.

Runs on the QA Shop practice database (customers, products, orders, order_items, payments, employees, bugs, test_runs, audit_log). Each run starts from a fresh copy.

Hints

Each hint costs 10 points on a full solve.

Interviewer follow-ups

  • Rewrite it with a JOIN to a grouped subquery.
  • How would a window function (AVG() OVER) simplify it?

Ctrl+Enter to run · add Shift to submit

1
2
3
Tab inserts two spaces. Press Escape, then Tab, to leave the editor.
Terminal

$ sqlite3 qa-shop.db < solution.sql

Run executes the open file. Submit scores solution.sql against hidden tests.

SoftwareTestPilot

Learn QA, prove your skills, connect with testers and grow your career.

Platform
  • Learn
  • Community
  • Jobs
Resources
  • QA Resources
  • Interview Questions
  • QA Tools
  • Articles
  • Products
Company
  • About
  • Contact
  • Authors & Reviewers
  • Editorial Policy
  • Sitemap
© 2026 SoftwareTestPilot. All rights reserved.
Operated by SoftwareTestPilot · Pune, Maharashtra, India · softwaretestingsapiens@gmail.com
PrivacyTermsCookiesDisclaimerRefundsAccessibility