exam questions

Exam 1z0-071 All Questions

View all questions & answers for the 1z0-071 exam

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 (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
darkma
Highly Voted 8 months, 2 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 5 times
NSilva
1 month, 1 week 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 2 times
...
...
alelejaja
Most Recent 1 week, 5 days ago
A is the correct answer
upvoted 1 times
...
m_darwish
2 weeks, 5 days ago
Ignore semicolon , A will fail .
upvoted 1 times
...
MIGHTYSTUNNERS
1 month, 1 week ago
C is wrong Because HAVING Clause come under group by clause
upvoted 1 times
...
zouve
11 months, 1 week 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
1 year ago
D is the right answer. Works fine and AB and C are incorrect by semicolon
upvoted 2 times
yanoolthecool
10 months, 2 weeks ago
Agreed, that is if we assume the question is 'which statement will NOT fail'
upvoted 1 times
...
...
karols32
1 year, 1 month 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, 4 months ago
ABC are incorrect for semicolon and even for HVAING should comes after GROUP BY clause.
upvoted 1 times
TheOracleWasTaken
10 months, 2 weeks ago
I think it works regardless, probably not correct but it works
upvoted 1 times
...
...
JCKOMI
1 year, 5 months ago
A IS NOT correct for semicolon and also count is not applied to where clause
upvoted 1 times
...
MZEnuovazelanda
1 year, 9 months ago
It's a mess! the first three are incorrect for the semicolon
upvoted 3 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago