QuestionQ15Verified/Retrieving data using the SQL SELECT statementCopy linkReport a problemAsk AstroTutorSave questionReview the following data in the EMPLOYEES table: Which statement executes successfully?ASELECT dept_id, INSTR(last_name, ‘A’), SUM(salary) FROM employees GROUP BY dept_id;BSELECT dept_id, STDDEV(last_name), SUM(salary) FROM employees GROUP BY dept_id;CSELECT dept_id, LENGTH(last_name), SUM(salary) FROM employees GROUP BY dept_id;DSELECT dept_id, MAX(last_name), SUM(salary) FROM employees GROUP BY dept_id;Show AnswerAnswerExplanationWith GROUP BY dept_id, each selected item must be a grouping expression, an aggregate function, a constant, or an expression derived from those. MAX(last_name) and SUM(salary) are aggregate functions, while dept_id is the grouping column. Oracle documents this rule for select lists that contain a GROUP BY clause.Learn moreOracle Database SQL Language Reference — Aggregate FunctionsShow comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion