Oracle Database 12c: SQL Fundamentals — Question 40

You want to create an ORD_DETAIL table to store details for an order placed having the following business requirement:
1) The order ID will be unique and cannot have null values.
2) The order date cannot have null values and the default should be the current date.
3) The order amount should not be less than 50.
4) The order status will have values either shipped or not shipped.
5) The order payment mode should be cheque, credit card, or cash on delivery (COD).
Which is the valid DDL statement for creating the ORD_DETAIL table?

Answer options

Correct answer: C

Explanation

Option C is correct because it correctly defines 'ord_id' as a PRIMARY KEY, ensuring uniqueness and non-nullability. Options A and B incorrectly use UNIQUE and NOT NULL without a primary key, and option D does not define 'ord_id' as a primary key, violating the requirement for uniqueness.