Complete the code to define a composite primary key on columns 'order_id' and 'product_id'.
CREATE TABLE order_details (order_id INT, product_id INT, quantity INT, PRIMARY KEY ([1]));The composite primary key must include both 'order_id' and 'product_id' together to uniquely identify each row.
Complete the code to add a composite primary key constraint named 'pk_enrollment' on 'student_id' and 'course_id'.
ALTER TABLE enrollments ADD CONSTRAINT pk_enrollment [1] (student_id, course_id);The constraint to define a composite primary key is 'PRIMARY KEY'.
Fix the error in the composite primary key definition by completing the code.
CREATE TABLE attendance (student_id INT, class_id INT, date DATE, PRIMARY KEY [1]);The columns in a PRIMARY KEY must be enclosed in parentheses.
Fill both blanks to create a table 'subscriptions' with a composite primary key on 'user_id' and 'service_id'.
CREATE TABLE subscriptions (user_id INT, service_id INT, start_date DATE, [1] PRIMARY KEY [2]);
Use 'CONSTRAINT sub_pk' to name the primary key, followed by the columns in parentheses.
Fill all three blanks to define a composite primary key named 'pk_order_item' on 'order_id' and 'item_id' in the 'order_items' table.
CREATE TABLE order_items (order_id INT, item_id INT, quantity INT, [1] pk_order_item [2] [3] (order_id, item_id));
The correct syntax is: CONSTRAINT pk_order_item PRIMARY KEY (order_id, item_id).