1.

Consider the table 'Company'. XYZ wanted to display the highest salary of each department along with department names.                     Table: CompanyEMPIDDEPARTMENTSALARYE101PERSONNEL60,000E102PERSONNEL65,000E103MARKETING40,000E104PERSONNEL62,004E105PERSONNEL50,000E105MARKETING35,000XYZ entered the following SQL statement:Select Department, MAX (Salary)From CompanyORDER BY Department;Identify error(s) in the above SQL statement.Rewrite the correct SQL statement.

Answer»

Select Department, MAX (Salary)

From Company

Group BY Department;



Discussion

No Comment Found

Related InterviewSolutions