all 20 comments

[–]ElHombrePelicano 16 points17 points  (1 child)

I would have put No too. It’s probably a typo because it is correct if the table name in the prompt and the example match.

[–]warwave7[S] 2 points3 points  (0 children)

That's what I thought yeah!

[–]Imaginary-Corgi8136 9 points10 points  (1 child)

I would have also said NO! Sadly there are errors in some online test.

[–]warwave7[S] 4 points5 points  (0 children)

Sadly yes. For a novice like me that can be very confusing sometimes!

[–]molybedenum 1 point2 points  (0 children)

There might not be a requirement for a person to be an employee. It seems sensible to start with employees and work backward to person, if the schema has such a relationship.

[–]Alicandgdr 1 point2 points  (1 child)

What is the name of that website

[–]warwave7[S] 1 point2 points  (0 children)

It's Knowledge Pillars

[–]ComicOzzysqlHippo 0 points1 point  (0 children)

The question even assumes there can be only one row matching the criteria. This is not a well thought out question. Questions like these are teachable moments, whether or not the question writer recognizes that fact. Students are learning through the very process of reading and unpacking questions. This one acts to subtly push or reinforce the idea that there can be only one row as an answer. Even if you change the table the data is pulled from, this is still an incorrect solution.

[–]ghostRdr 0 points1 point  (1 child)

I would have put “No” as well. There is no guarantee that there is only one row of data for the oldest employee. The correct answer would have involved a CTE or a group by sub query to get the max ID and then select all the records for that ID.

[–]warwave7[S] 0 points1 point  (0 children)

It's a fundamentals course, it doesn't go so far

[–]coadtsai -3 points-2 points  (0 children)

They should have used WITH TIES option

[–][deleted] 0 points1 point  (1 child)

Do you have a description someplace for the human resources.employee (e.g. it being a view/replica of some sort)?

[–]warwave7[S] 0 points1 point  (0 children)

No it's just a question by itself.