Deal of The Day! 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

Posted by Shawnta on Sep 12, 2024 at 09:07 PM

Select two suitable statements regarding the following SQL statement:

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

Suggested Answer: C

Get Premium PGCES-02 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
34 comments · newest first
GL
Glendora 10 months ago
No way, 'UPDATE' still happens even if 'write_log' returns NULL.
DE
Deane 11 months ago
I think 'DROP TRIGGER' does delete it, right?
TA
Tasia 11 months ago
Wait, does 'write_log' really run before the update? That seems off.
GW
Gwen 11 months ago
Agreed, 'write_log' runs after every update on 'sales'.
JA
Jacquelyne 11 months ago
It's definitely defining a trigger 'trigger_1'.
NA
Nancey 12 months ago
I think option E is true too, as we discussed how to drop triggers in our practice questions.
BR
Brigette 12 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.
MA
Matilda 12 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.
LE
Lenita 1 year ago
I remember that a trigger is defined to perform actions automatically, so I think option A is definitely correct.
GE
Georgeanna 1 year 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.
FR
France 1 year 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.
TI
Timmy 1 year 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.
KI
Kimberlie 1 year 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.
AD
Adelina 1 year ago
This looks like a pretty straightforward SQL trigger question. I'm confident I can handle this.
SH
Shawna 1 year 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.
TR
Truman 1 year ago
E is correct. The given statement would delete the defined trigger.
CA
Carli 1 year ago
D is incorrect. The 'write_log' function is called regardless of its return value.
RE
Reita 1 year ago
C is incorrect. The trigger is defined to execute the function after the update, not before.
IL
Ilene 1 year ago
↳ replying to Reita
D) 'UPDATE' is not executed if 'write_log' returns NULL.
GA
Gabriele 1 year ago
↳ replying to Reita
B) Every time 'UPDATE' is executed on the 'sales' table, the 'write_log' function is called once.
VO
Von 1 year ago
↳ replying to Reita
B) Every time 'UPDATE' is executed on the 'sales' table, the 'write_log' function is called once.
CA
Carlee 1 year ago
↳ replying to Reita
A) It is defining a trigger 'trigger_1'.
AV
Avery 1 year ago
↳ replying to Reita
A) It is defining a trigger 'trigger_1'.
AN
An 1 year ago
A and B are correct. The trigger is defined to execute the 'write_log' function after an update on the 'sales' table.
TR
Trinidad 1 year ago
↳ replying to An
User: A and B are correct. The trigger is defined to execute the 'write_log' function after an update on the 'sales' table.
SU
Suzan 1 year ago
↳ replying to An
B) Every time 'UPDATE' is executed on the 'sales' table, the 'write_log' function is called once.
TE
Teri 1 year ago
↳ replying to An
A) It is defining a trigger 'trigger_1'.
NI
Nikita 1 year ago
↳ replying to An
B) And the 'write_log' function is called after each update on the 'sales' table.
SU
Sue 1 year ago
↳ replying to An
A) Yes, that's correct. The trigger is named 'trigger_1'.
HE
Herminia 1 year ago
↳ replying to An
B) Every time 'UPDATE' is executed on the 'sales' table, the 'write_log' function is called once.
GA
Gabriele 1 year ago
↳ replying to An
A) It is defining a trigger 'trigger_1'.
NI
Nicolette 2 years ago
I'm not sure about statement C, I think the function is called after the update.
TO
Tonja 2 years ago
I agree with Gwen, the trigger is defined and the function is called after each update.
GW
Gwen 2 years ago
I think statement A and B are correct.
0/2000 characters

Save Cancel