Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q) Find the instructor earning the second highest salary. (Dont use ORDER BY and LIMIT in your solution.) in MySQL here is the table I

Q) Find the instructor earning the second highest salary. (Dont use ORDER BY and LIMIT in your solution.) in MySQL here is the table I am using named Instructor with the following 4 attributes: Instructor(ID, name, dept_name, salary) ID is the primary key I am supposed to report the answer with the name, ID and salary of the second highest salaried instructor. I know how to do it if I only needed to report the second highest salary, but I am having trouble getting it with the corresponding name and id as well. This is what I am trying: Select ID, name, max(salary) as salary From instructor Where salary < (select max(salary) From instructor); but it is saying "Error Code: 1140. In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'database.instructor.ID'; this is incompatible with sql_mode=only_full_group_by" Any help is appreciated!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago

Question

4. Explain the strengths and weaknesses of each approach.

Answered: 1 week ago