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 3 Question 4 Discussion

SQL statements were executed in the following order:CREATE TABLE fmaster(id INTEGER PRIMARY KEY, name TEXT);CREATE TABLE ftrans(id INTEGER REFERENCES fmaster (id), stat INTEGER, date DATE);INSERT INTO fmaster VALUES (1, 'itemA');INSERT INTO ftrans VALUES (1, 1, CURRENT_DATE);Select two SQL statements that will generate an error when executed next.
A) INSERT INTO ftrans VALUES (1, 1, CURRENT_DATE); and C) UPDATE fmaster SET name = 'itemAX' WHERE id = 1;
B) INSERT INTO ftrans VALUES (2, 1, '2007-07-07');
D) UPDATE fmaster SET id = 100 WHERE id = 1;
E) UPDATE ftrans SET id = 200 WHERE id = 1;

PostgreSQL PGCES-02 Exam - Topic 3 Question 4 Discussion

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

SQL statements were executed in the following order:

CREATE TABLE fmaster

(id INTEGER PRIMARY KEY, name TEXT);

CREATE TABLE ftrans

(id INTEGER REFERENCES fmaster (id), stat INTEGER, date DATE);

INSERT INTO fmaster VALUES (1, 'itemA');

INSERT INTO ftrans VALUES (1, 1, CURRENT_DATE);

Select two SQL statements that will generate an error when executed next.

Show Suggested Answer Hide Answer
Suggested Answer: A, C

Contribute your Thoughts:

0/2000 characters
Mindy
8 months ago
Wait, can you really update the id in ftrans? That seems risky.
upvoted 0 times
...
Dulce
8 months ago
D is a big no-no! Can't change primary key values like that.
upvoted 0 times
...
Maile
9 months ago
No way, C is fine! It updates a name, not an id.
upvoted 0 times
...
Felicia
9 months ago
I think B might also throw an error since id 2 doesn't exist.
upvoted 0 times
...
Naomi
9 months ago
A and D will definitely cause errors.
upvoted 0 times
...
Lavonna
9 months ago
I’m a bit confused about option A. Didn’t we already insert that same value? Would it cause a duplicate key error?
upvoted 0 times
...
Queen
9 months ago
I remember a practice question where we had to check foreign key constraints. I think option E will throw an error because 200 isn't a valid reference in fmaster.
upvoted 0 times
...
Lemuel
9 months ago
I'm not entirely sure, but I feel like option D could also cause an issue since changing the primary key might break something.
upvoted 0 times
...
Glory
9 months ago
I think option B might generate an error because the ID 2 doesn't exist in fmaster, right?
upvoted 0 times
...
Eliseo
9 months ago
This question seems straightforward, I think I know the answer based on my understanding of SIP URI dialing.
upvoted 0 times
...
Meaghan
10 months ago
I'm a bit confused on this question. I know InnoDB encryption is supposed to be transparent, but I'm not sure if that means it supports all indexes transparently. I'll have to think about that one.
upvoted 0 times
...
Kenda
10 months ago
The discount rate seems like it could be an issue, but I'm not entirely sure. I'll need to review the rationale for using 10% and see if that's the right approach.
upvoted 0 times
...

Save Cancel