PostgreSQL_CE
PGCES-02 · Question #123
PGCES-02 Question #123: Real Exam Question with Answer & Explanation
Sign in or unlock PGCES-02 to reveal the answer and full explanation for question #123. The question stem and answer options stay visible for context.
Question
You want to set a constraint so that the "item_id" in the "sales" table will always have a value that already exists as "id" in the "item_master" table. Select the correct SQL statement to fill in the underlined blank of the "sales" table. Definitions: CREATE TABLE item_master ( id INTEGER PRIMARY KEY, name TEXT ); CREATE TABLE sales ( sales_id INTEGER, item_id INTEGER, num INTEGER, ); PostgreSQL CE PGCES-02 Exam
Options
- AFOREIGN KEY (id) REFERENCESitem_master (item_id)
- BFOREIGN KEY (item_id) REFERENCES item_master (id)
- CREFERENCESitem_master (item_id)
- DREFERENCESitem_master (id)
- EREFERENCESitem_master (id) TO item_id
Unlock PGCES-02 to see the answer
You've previewed enough free PGCES-02 questions. Unlock PGCES-02 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.