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 11 Question 58 Discussion

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

A table named "sample" is defined as below. Select two statements which will generate a constraint error. CREATE TABLE sample ( i INTEGER PRIMARY KEY, j INTEGER,

CHECK ( i > 0 AND j < 0 ) );

Show Suggested Answer Hide Answer
Suggested Answer: A, D

Contribute your Thoughts:

Janey
18 days ago
This is a job for the SQL Ninja! *strikes a dramatic pose* Okay, let's see... The `i` column must be greater than 0, and the `j` column must be less than 0. That means (A) and (D) are the troublemakers here. Time to show off my database kung-fu skills! *cracks knuckles*
upvoted 0 times
...
Blondell
21 days ago
Alright, let's do this! Hmm, the `i` column has to be positive, and the `j` column has to be negative. So (A) and (C) are definitely going to fail. Wait, did they say two statements? Guess I better double-check my work. *scratches head* Where's my SQL cheat sheet when I need it?
upvoted 0 times
...
Yaeko
29 days ago
Ah, the joys of database design. Clearly, the table gods have blessed us with a challenge! I'm gonna go with (C) and (D) as the troublemakers here. Null values and CHECK constraints don't always play nicely, you know. But hey, at least it's not a production database, right? *laughs nervously*
upvoted 0 times
Kimbery
3 days ago
User 3: Always a fun challenge in database design!
upvoted 0 times
...
Ashton
13 days ago
User 2: Yeah, null values and constraints can be tricky.
upvoted 0 times
...
Gerardo
15 days ago
User 1: I think (C) and (D) are the culprits.
upvoted 0 times
...
...
Jose
2 months ago
Ooh, a tricky one! Okay, let's think this through. The table definition says the `i` column must be greater than 0 and the `j` column must be less than 0. So (B) and (E) should be good, but (A), (C), and (D) are gonna trigger that constraint error for sure. Time to put on my SQL thinking cap!
upvoted 0 times
Mari
3 days ago
User2: Yeah, because the value of j is not less than 0.
upvoted 0 times
...
Cheryll
15 days ago
User1: I think (A) will cause a constraint error.
upvoted 0 times
...
Gregoria
20 days ago
User2: Yeah, because the value of j is not less than 0.
upvoted 0 times
...
Rozella
27 days ago
User1: I think (A) will cause a constraint error.
upvoted 0 times
...
...
Berry
2 months ago
Well, look at that, an opportunity to show off my SQL prowess! Let's see, the question is which statements will generate a constraint error. Hmmm, I'm thinking (A) and (C) are the ones that will fail. Gotta love those pesky CHECK constraints!
upvoted 0 times
...
Dortha
2 months ago
I believe statement D will also generate a constraint error because it has a NULL value for i.
upvoted 0 times
...
Dannette
2 months ago
I agree with Rosina. The constraint CHECK ( i > 0 AND j < 0 ) will be violated with statement B.
upvoted 0 times
...
Rosina
2 months ago
I think statement B will generate a constraint error.
upvoted 0 times
...

Save Cancel