June 26, 2022 at 6:37 am
Hello,
I need to help my boss come up with a simple-ish SQL quiz. Myself and another analyst from our department are leaving and were the only two who know how to write queries. I am beginner level at best and I don't feel qualified to test someones capabilities. I received a job offer and when they found out i could write sql they gave me this quiz in access. (We use MSFT SQL server management server)
SELECT userid, AVG(orderid), FROM tbl.companytable HAVING (orderid) > 0;
"Whats wrong with this query?"
Me - you need to partition orderid by userid otherwise you will get multiple user IDs and have the same average of all order IDs
Them - right, so group by
I want to do something like this, but cant really think of the best parameters in our DB to use, any advice on a simple query question to ask is greatly appreciated.
My main goal is to not filter out a potentially good candidate just because i asked a poor question.
Thanks in advance.
June 26, 2022 at 5:35 pm
Sounds like a prelude to spam... why would anyone in their right mind try to take an average on such an identifier column? Really bad question and, since you say they say you got the answer right, I doubt their ability to form a decent question, as well.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 27, 2022 at 1:51 pm
For introductory stuff, I always asked these questions. Obviously, a few would need to be updated, it being 2022 & all. However, I'd still say these were pretty basic, core stuff, to get a quick understanding of where someone's knowlege level is.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy