About Question enthuware.oce-jpad.v6.2.490 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
romsky
Posts: 39
Joined: Thu Jan 29, 2015 4:49 pm
Contact:

About Question enthuware.oce-jpad.v6.2.490 :

Post by romsky »

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.

romsky
Posts: 39
Joined: Thu Jan 29, 2015 4:49 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.490 :

Post by romsky »

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.

admin
Site Admin
Posts: 10043
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.490 :

Post by admin »

The problem statement is updated 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.

PtFyEH
Posts: 8
Joined: Sun Dec 20, 2015 6:28 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.490 :

Post by PtFyEH »

I think none of the answers are correct as the SIZE function must be used instead of COUNT. Also the following explanation seems wrong:
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.
As an association field is allowed but must be single valued. See BNF:
COUNT ([DISTINCT] identification_variable | state_valued_path_expression |
single_valued_object_path_expression))
And also JPA 2.1, section 4.4.4.1:
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.

admin
Site Admin
Posts: 10043
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.490 :

Post by admin »

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.
If you like our products and services, please help us by posting your review here.

costin1989
Posts: 15
Joined: Tue Apr 21, 2015 1:36 am
Contact:

Re: About Question enthuware.oce-jpad.v6.2.490 :

Post by costin1989 »

The problem with this answer is that a student with 0 presentations will not be take into consideration. Because the question is
return the firstname and the number of presentatins that a student has made
I understand that all students must be returned, and also 0 is a number.

So i propose a LEFT JOIN instead of simple JOIN

What do you think?

admin
Site Admin
Posts: 10043
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.490 :

Post by admin »

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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests