Skip to content
CodeKruPro

Selecting a name next to MAX(salary)

QuizMedium-Hard

A candidate wants the name of the highest-paid employee and writes:

SELECT name, MAX(salary) FROM employees;

Which statement is true?

  • PostgreSQL rejects it, MySQL rejects it with its default settings, and SQLite returns the row of the highest salary
  • Every database returns the name of the highest-paid employee
  • It returns every name, each with the highest salary
  • It returns the first name in the table with the highest salary

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in