⚡️ Pass with Confidence Sale - 40% off ALL packages! ⚡️

2 days, 2 hours remaining!

CompTIA Data+ DA0-002 (V2) Practice Question

A retail company maintains a SQL Server database that includes a table named Projects with the columns project_id (primary key), project_name, dept_id, and budget. Management wants a list of every project whose budget is greater than the average project budget within the same department, generated in a single query without creating any temporary objects. Which SQL statement meets the requirement by using a nested query?

  • SELECT project_name
    FROM Projects
    WHERE budget > (
        SELECT AVG(budget)
        FROM Projects
    );
    
  • SELECT project_name
    FROM Projects p
    WHERE p.budget > (
        SELECT AVG(budget)
        FROM Projects
        WHERE dept_id = p.dept_id
    );
    
  • SELECT project_name
    FROM Projects p
    WHERE (
        SELECT AVG(budget)
        FROM Projects
        WHERE dept_id = p.dept_id
    ) > p.budget;
    
  • SELECT p.project_name
    FROM Projects p
    JOIN (
      SELECT dept_id, AVG(budget) AS avg_budget
      FROM Projects
      GROUP BY dept_id
    ) a  ON p.dept_id = a.dept_id
    WHERE p.budget < a.avg_budget;
    
CompTIA Data+ DA0-002 (V2)
Data Acquisition and Preparation
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot