Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 1z0-071 topic 1 question 47 discussion

Actual exam question from Oracle's 1z0-071
Question #: 47
Topic #: 1
[All 1z0-071 Questions]

Examine the description of the EMPLOYEES table:

Which statement will fail?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: A

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
MIGHTYSTUNNERS
2 weeks, 3 days ago
C is wrong Because HAVING Clause come under group by clause
upvoted 1 times
...
darkma
7 months, 3 weeks ago
The first query is syntactically incorrect. You cannot use the COUNT function in the WHERE clause. The second query is also incorrect. The HAVING clause is used to filter the results of an aggregation, and it should be used after the GROUP BY clause, not after the WHERE clause. The third query is also incorrect for the same reason as the second one. The HAVING clause should come after the GROUP BY clause. The fourth query is correct and will work as expected. It filters rows where the department_id is not equal to 90 using the WHERE clause, groups the remaining rows by department_id, and then applies the HAVING clause to count the rows within each group and filter out groups where the count is greater than or equal to 3.
upvoted 3 times
NSilva
2 weeks, 4 days ago
I tried it out in Oracle's Apex (Db v19C), using a data set from the internet. SELECT id FROM TITANIC HAVING ID = 1 GROUP BY ID; It does not affect the result if you use HAVING and GROUP BY in a different position from one to another.
upvoted 1 times
...
...
zouve
10 months, 2 weeks ago
A if you correct the semicolon to each and every query A the one that is failing with ORA-00934: group function is not allowed here
upvoted 2 times
...
fgramos
11 months, 1 week ago
D is the right answer. Works fine and AB and C are incorrect by semicolon
upvoted 2 times
yanoolthecool
9 months, 3 weeks ago
Agreed, that is if we assume the question is 'which statement will NOT fail'
upvoted 1 times
...
...
karols32
1 year ago
Don't pay attention about semicolon and the answer is A. Order of HAVING and GROUP BY doesn't matter. WHERE is not required in statement.
upvoted 2 times
...
Orxan_H
1 year, 1 month ago
A B are incorrect answers
upvoted 1 times
...
Ronit_8055
1 year, 3 months ago
ABC are incorrect for semicolon and even for HVAING should comes after GROUP BY clause.
upvoted 1 times
TheOracleWasTaken
9 months, 3 weeks ago
I think it works regardless, probably not correct but it works
upvoted 1 times
...
...
JCKOMI
1 year, 4 months ago
A IS NOT correct for semicolon and also count is not applied to where clause
upvoted 1 times
...
MZEnuovazelanda
1 year, 8 months ago
It's a mess! the first three are incorrect for the semicolon
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...