MySQL Forums
Forum List  »  Newbie

What are some common questions related to SQL optimization?
Posted by: Alish B
Date: February 24, 2023 04:56AM

Which of the following claims about SQL queries is TRUE?
P: Even if there is no GROUP BY clause in a SQL query, it can have a HAVING clause.

Q: If a SQL query has a GROUP BY clause, it can only have a HAVING clause.

R: The SELECT clause must include all attributes used in the GROUP BY clause.

S: The SELECT clause does not have to include all of the attributes used in the GROUP BY clause.
Question reference: https://www.interviewbit.com/sql-query-interview-questions/

I was shocked to find that the reporting SQL I was asked to take a look at in a SQL Server 2K5 environment contained 4 to 5 levels of the subquery, distinct clauses, unions, and NoLock hints. These hints were necessary due to the SQL taking so long that it was blocking standard processing. All of these elements were present in the same set!


I have been mistakenly labeled as an expert in SQL and now I have been asked to create a test to evaluate a candidate's ability to optimize SQL. Does anyone have any resources or suggestions that I could use to assess these interviewees?

Options: ReplyQuote


Subject
Written By
Posted
What are some common questions related to SQL optimization?
February 24, 2023 04:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.