Question: ATTRIBUTE DATA TYPE SIZE AUTO NULL CONSTRAINT order_id integer 11 yes no primary cust_id integer 11 no foreign employee_id integer 11 no foreign order_date date
| ATTRIBUTE | DATA TYPE | SIZE | AUTO | NULL | CONSTRAINT |
|---|---|---|---|---|---|
| order_id | integer | 11 | yes | no | primary |
| cust_id | integer | 11 | no | foreign | |
| employee_id | integer | 11 | no | foreign | |
| order_date | date | no | |||
| shipping_cost | float | yes | |||
| complete | integer | 1 | no |
The following metadata table shows details for ORDERTABLE relational model. Assume that all other related tables are already created.
Which of the following DDL statement is correct for creating the ordertable:
| CREATE TABLE ordertable (order_id int (11) not null AUTO_INCREMENT, cust_id int (11) not null, employee_id int(11) not null, order_date date not null, shipping_cost float, complete int(1) not null, CONSTRAINT order_pk PRIMARY KEY (order_id, cust_id, employee_id)) ENGINE = INNODB;
| ||
| CREATE TABLE ordertable (order_id int (11) not null AUTO_INCREMENT, cust_id int (11) not null, employee_id int(11) not null, order_date date not null, shipping_cost float, complete int(1) not null, CONSTRAINT order_pk PRIMARY KEY (order_id), CONSTRAINT order_fk1 FOREIGN KEY (cust_id) REFERENCES customer_T (cust_id), CONSTRAINT order_fk2 FOREIGN KEY (employee_id) REFERENCES employee_T (employee_id)) ENGINE = INNODB;
| ||
| CREATE TABLE ordertable (order_id int (11) not null AUTO_INCREMENT, cust_id int (11) not null, employee_id int(11) not null, order_date date not null, shipping_cost float, complete int(1) not null, CONSTRAINT order_pk PRIMARY KEY (order_id), CONSTRAINT order_fk1 FOREIGN KEY (cust_id), CONSTRAINT order_fk2 FOREIGN KEY (employee_id)) ENGINE = INNODB;
| ||
| CREATE TABLE ordertable (order_id int (11) not null AUTO_INCREMENT, cust_id int (11) not null, employee_id int(11) not null, order_date date not null, shipping_cost float, complete int(1) not null, CONSTRAINT order_pk PRIMARY KEY (order_id), CONSTRAINT order_fk FOREIGN KEY (cust_id, employee id)) ENGINE = INNODB;
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
