About Question enthuware.oce-jpad.v6.2.490 :
Moderators: Site Manager, fjwalraven
-
- Posts: 39
- Joined: Thu Jan 29, 2015 4:49 pm
- Contact:
About Question enthuware.oce-jpad.v6.2.490 :
The second option is wrong.
If there are two Johns, the first one has 4 presentations and the second one has only 3.
The query will return row: John and 7.
But the task is to "return the firstname and the number of presentations that a student has made". "A student" - one student, rather then all students with same name.
The option will return correct result.
The task has to be elaborated.
If there are two Johns, the first one has 4 presentations and the second one has only 3.
The query will return row: John and 7.
But the task is to "return the firstname and the number of presentations that a student has made". "A student" - one student, rather then all students with same name.
The option will return correct result.
The task has to be elaborated.
-
- Posts: 39
- Joined: Thu Jan 29, 2015 4:49 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.490 :
The explanation to 4th option is relevant only to MySQL. Your server probably has ONLY_FULL_GROUP_BY turned on. You can either turn it off or add each of your selected fields to the group by.
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.490 :
The problem statement is updated to make it clear.
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 8
- Joined: Sun Dec 20, 2015 6:28 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.490 :
I think none of the answers are correct as the SIZE function must be used instead of COUNT. Also the following explanation seems wrong:
As an association field is allowed but must be single valued. See BNF:Note: As per Section 4.8.5, the path expression argument to COUNT may terminate in either a state field or a association field, or the argument to COUNT may be an identification variable. Therefore, the COUNT(s.presentations) should be valid.
And also JPA 2.1, section 4.4.4.1:COUNT ([DISTINCT] identification_variable | state_valued_path_expression |
single_valued_object_path_expression))
It is illegal to use a collection_valued_path_expression other than in the FROM clause of a query
except in an empty_collection_comparison_expression, in a collection_member_expression, or
as an argument to the SIZE operator.
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.490 :
There does seem to be a little contradiction in different parts of the specification on this. This does not affect the answer though because none of the options involving count(s.presentations) is correct anyway.
We have left the additional details and this discussion here so that readers are aware of the issue.
HTH,
Paul.
We have left the additional details and this discussion here so that readers are aware of the issue.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 15
- Joined: Tue Apr 21, 2015 1:36 am
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.490 :
The problem with this answer is that a student with 0 presentations will not be take into consideration. Because the question is
So i propose a LEFT JOIN instead of simple JOIN
What do you think?
I understand that all students must be returned, and also 0 is a number.return the firstname and the number of presentatins that a student has made
So i propose a LEFT JOIN instead of simple JOIN
What do you think?
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.490 :
You are right about the query not returning students with zero presentations. However, there is no option that considers this possibility and there is no "None of the above" option either. So from the exam perspective, it is safe to assume that students with zero presentations is not required.
We have updated the problem statement to make it clear.
thank you for your feedback!
Paul.
We have updated the problem statement to make it clear.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 20 guests