Cyber Monday 2024! 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
5 days 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
...
Jules
9 days 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
10 days ago
Haha, dropping the 'bar' column? That's a bold move, let's see if it works!
upvoted 0 times
...
Ona
12 days ago
I believe no error is generated.
upvoted 0 times
...
Glen
20 days 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
21 days 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
Lenna
6 days ago
I think the answer is E. No error is generated.
upvoted 0 times
...
...
Jules
23 days ago
I think an error occurs when executing the (3) SQL statement.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77