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

Moderator: admin

Post Reply
supafly
Posts: 9
Joined: Mon Apr 18, 2016 2:05 pm
Contact:

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

Post by supafly » Sun Jul 16, 2017 7:37 am

The explanation to option 4 is wrong. COUNT(), MIN() and MAX() can be used without a GROUP BY clause. But they can only be used in side a select clause.

For example this is valid:

SELECT COUNT(o)
FROM Order o

cheers

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post by himaiMinh » Sun Jul 16, 2017 7:46 pm

Hi, Supafly,
Which test and which question no. this question belongs?
But this is not valid:
Select o.id, count(o) from Order o because group by clause does not exist.
When there are more than one path in the select clause with aggregate functions (count, max, min....), the group by clause is needed.

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

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

Post by admin » Sun Jul 16, 2017 10:12 pm

The explanation doesn't say that you cannot use count without group by at all. It says you cannot mix grouped columns and non-grouped columns without a group by.

This explanation is in context of the option 5:
select s.firstname, count(p) from Student s left join s.presentations p

Here, you cannot mix s.firstname and count(p) without a group by for firstname.

Himai, this is in test 3, q 47. But you can simply open the question by doing control+q and entering 2.490 in ETS Viewer.

HTH,
Paul.

supafly
Posts: 9
Joined: Mon Apr 18, 2016 2:05 pm
Contact:

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

Post by supafly » Mon Jul 17, 2017 12:51 am

That is true, i misread the explanation.

dominik.jenik
Posts: 2
Joined: Tue Jul 04, 2017 4:00 am
Contact:

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

Post by dominik.jenik » Sat Dec 16, 2017 4:09 am

Looks like logical contradiction. I think answer 1 is also correct. Because we are not having multiple students with same name therefore with or without grouping we get the same result.
Attachments
duplicate_vs_unique.png
duplicate_vs_unique.png (69.2 KiB) Viewed 1134 times

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

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

Post by admin » Sat Dec 16, 2017 10:24 pm

No, it is not contradictory. "First names are unique" implies that no two students have same first name. Duplicate rows in the results will be there if same student make multiple presentations.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests