【2019年8月版】OCP 071認證考試原題-第41題

choose three

The ORDERS table has a primary key constraint on the ORDER_ID column.

The ORDER_ITEMS table has a foreign key constraint on the ORDER_ID column,referencing the primary key of the ORDERS table.

The constraint is defined with on DELETE CASCADE.

There are rows in the ORDERS table with an ORDER_TOTAL less than 1000.

Which three DELETE statements execute successfully?

A) DELETE FROM orders WHERE order_total<1000;

B) DELETE * FROM orders WHERE order_total<1000;

C) DELETE orders WHERE order_total<1000;

D) DELETE FROM orders;

E) DELETE order_id FROM orders WHERE order_total<1000;

Answer:ACD

(解析:這個考的是語法題,屬於低智商題目,因爲定義外鍵的時候用了 DELETE CASCADE 選項,所以父表的行是可以刪除。)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章