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 Exam PGCES-02 Topic 1 Question 77 Discussion

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

The table "foo" is defined as follows: CREATE TABLE foo (bar

TEXT); Next, four SQL statements were executed in the following order. INSERT INTO foo VALUES ('bar'); -------- (1)

ALTER TABLE foo ADD COLUMN c1 TEXT; ---- (2) ALTER

TABLE foo ADD UNIQUE (c1); ------- (3) ALTER TABLE foo

DROP COLUMN bar; ------- (4) Select the correct statement from those below.

Show Suggested Answer Hide Answer
Suggested Answer: E

Contribute your Thoughts:

Shawna
4 months ago
I'd go with D. Dropping a column that's part of the primary key has got to cause an error, right?
upvoted 0 times
Joaquin
3 months ago
D) An error occurs when executing the (4) SQL statement.
upvoted 0 times
...
Dana
3 months ago
C) An error occurs when executing the (3) SQL statement.
upvoted 0 times
...
Mohammad
3 months ago
B) An error occurs when executing the (2) SQL statement.
upvoted 0 times
...
Aleisha
4 months ago
A) An error occurs when executing the (1) SQL statement.
upvoted 0 times
...
...
Jules
4 months ago
But the UNIQUE constraint should be added to a column, not the table itself. So, I think an error occurs when executing the (3) SQL statement.
upvoted 0 times
...
Gianna
4 months ago
Haha, dropping the 'bar' column? That's a bold move, let's see if it works!
upvoted 0 times
Evette
3 months ago
User3: I believe an error occurs when executing the (3) SQL statement.
upvoted 0 times
...
Martina
4 months ago
User2: No error is generated.
upvoted 0 times
...
Delfina
4 months ago
User1: I think an error occurs when executing the (4) SQL statement.
upvoted 0 times
...
...
Ona
4 months ago
I believe no error is generated.
upvoted 0 times
...
Glen
5 months ago
Hmm, I'm not sure. Maybe the (2) statement would cause an error since you can't add a column to a table that already has data in it.
upvoted 0 times
...
Vivienne
5 months ago
I think the answer is E. No error is generated. The table has been modified successfully, and the data remains intact.
upvoted 0 times
Lanie
3 months ago
So, the correct statement is E. No error is generated.
upvoted 0 times
...
Jill
3 months ago
The data remains intact after the alterations.
upvoted 0 times
...
Amina
3 months ago
I agree, the table has been modified successfully.
upvoted 0 times
...
Lenna
4 months ago
I think the answer is E. No error is generated.
upvoted 0 times
...
...
Jules
5 months ago
I think an error occurs when executing the (3) SQL statement.
upvoted 0 times
...

Save Cancel