Answer & Explanation

4 Answers
Verified Correct Answer

Option A

CREATE TABLE orders (id BIGINT PRIMARY KEY, customer_id BIGINT NOT NULL, FOREIGN KEY (customer_id) REFERENCES customers(id));
Additional Explanation
Correct implementation. Prefer parameterized queries in application code, validate affected rows for UPDATE/DELETE, and use transactions for related writes.
Sarkari Resultess
Editorial Answer 1
Verified

Option B

CHECK (customer_id IN customers);
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 2
Verified

Option C

FOREIGN KEY (customer_id) REFERENCES customers(name);
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 3
Verified

Option D

UNIQUE (customer_id) REFERENCES customers(id);
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 4