New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

PostgreSQL PGCES-02 Exam - Topic 4 Question 72 Discussion

Actual exam question for PostgreSQL's PGCES-02 exam
Question #: 72
Topic #: 4
[All PGCES-02 Questions]

Select two suitable statements regarding the following SQL statement:

CREATE TRIGGER trigger_1 AFTER UPDATE ON sales FOR EACH ROW EXECUTE PROCEDURE write_log();

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

0/2000 characters
Glendora
3 months ago
No way, 'UPDATE' still happens even if 'write_log' returns NULL.
upvoted 0 times
...
Deane
3 months ago
I think 'DROP TRIGGER' does delete it, right?
upvoted 0 times
...
Tasia
3 months ago
Wait, does 'write_log' really run before the update? That seems off.
upvoted 0 times
...
Gwen
4 months ago
Agreed, 'write_log' runs after every update on 'sales'.
upvoted 0 times
...
Jacquelyne
4 months ago
It's definitely defining a trigger 'trigger_1'.
upvoted 0 times
...
Nancey
4 months ago
I think option E is true too, as we discussed how to drop triggers in our practice questions.
upvoted 0 times
...
Brigette
4 months ago
I feel like option C is wrong since it says the function is called before the update, but I can't recall the exact details.
upvoted 0 times
...
Matilda
4 months ago
I'm not entirely sure, but I think option B makes sense because it mentions that the function is called after an update, which aligns with what we learned.
upvoted 0 times
...
Lenita
5 months ago
I remember that a trigger is defined to perform actions automatically, so I think option A is definitely correct.
upvoted 0 times
...
Georgeanna
5 months ago
This is a good opportunity to apply my knowledge of SQL triggers. I'll make sure to read the question carefully and consider each option before selecting my answers.
upvoted 0 times
...
France
5 months ago
I'm a little confused by the wording of some of these options. I'll need to think through the logic of how triggers work to determine the right answers.
upvoted 0 times
...
Timmy
5 months ago
Okay, let's see here. The trigger is defined to run after an UPDATE on the 'sales' table, and it calls the 'write_log' function. I think options A and B are the correct ones, but I'll double-check the other choices just to be sure.
upvoted 0 times
...
Kimberlie
5 months ago
Hmm, I'm a bit unsure about the specifics of how this trigger works. I'll need to carefully read through the options to make sure I understand the details.
upvoted 0 times
...
Adelina
5 months ago
This looks like a pretty straightforward SQL trigger question. I'm confident I can handle this.
upvoted 0 times
...
Shawna
9 months ago
I wonder if the 'write_log' function is as exciting as it sounds. Maybe it just writes 'Another day, another sale' in the log.
upvoted 0 times
...
Truman
9 months ago
E is correct. The given statement would delete the defined trigger.
upvoted 0 times
...
Carli
9 months ago
D is incorrect. The 'write_log' function is called regardless of its return value.
upvoted 0 times
...
Reita
9 months ago
C is incorrect. The trigger is defined to execute the function after the update, not before.
upvoted 0 times
Ilene
8 months ago
D) 'UPDATE' is not executed if 'write_log' returns NULL.
upvoted 0 times
...
Gabriele
9 months ago
B) Every time 'UPDATE' is executed on the 'sales' table, the 'write_log' function is called once.
upvoted 0 times
...
Von
9 months ago
B) Every time 'UPDATE' is executed on the 'sales' table, the 'write_log' function is called once.
upvoted 0 times
...
Carlee
9 months ago
A) It is defining a trigger 'trigger_1'.
upvoted 0 times
...
Avery
9 months ago
A) It is defining a trigger 'trigger_1'.
upvoted 0 times
...
...
An
10 months ago
A and B are correct. The trigger is defined to execute the 'write_log' function after an update on the 'sales' table.
upvoted 0 times
Trinidad
9 months ago
User: A and B are correct. The trigger is defined to execute the 'write_log' function after an update on the 'sales' table.
upvoted 0 times
...
Suzan
9 months ago
B) Every time 'UPDATE' is executed on the 'sales' table, the 'write_log' function is called once.
upvoted 0 times
...
Teri
9 months ago
A) It is defining a trigger 'trigger_1'.
upvoted 0 times
...
Nikita
9 months ago
B) And the 'write_log' function is called after each update on the 'sales' table.
upvoted 0 times
...
Sue
9 months ago
A) Yes, that's correct. The trigger is named 'trigger_1'.
upvoted 0 times
...
Herminia
9 months ago
B) Every time 'UPDATE' is executed on the 'sales' table, the 'write_log' function is called once.
upvoted 0 times
...
Gabriele
10 months ago
A) It is defining a trigger 'trigger_1'.
upvoted 0 times
...
...
Nicolette
11 months ago
I'm not sure about statement C, I think the function is called after the update.
upvoted 0 times
...
Tonja
11 months ago
I agree with Gwen, the trigger is defined and the function is called after each update.
upvoted 0 times
...
Gwen
11 months ago
I think statement A and B are correct.
upvoted 0 times
...

Save Cancel