OCP-1Z0-051-Question Analysis-33rd question

Source: Internet
Author: User

33.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 shocould be the current date.
3) The order amount shocould not be less than 50.
4) The order status will have values either shipped or not shipped.
5) The order payment mode shocould be cheque, credit card, or cash on delivery (COD ).
Which is the valid DDL statement for creating the ORD_DETAIL table?
1) The order ID is not empty and unique. → Primary key
2) The default value of order date is the current date and is not empty. → Default sysdate Not NULL
3) order amount must be greater than or equal to 50. → Check (order_mount> = 50)
4) The value of order status is shipped or not shipped. → CHECK (ord_status IN ('shipped ', 'not Shipped ')
5) The value of order payment mode is cheque, credit card, or cash on delivery. → CHECK (ord_pay_mode IN ('cheque ', 'credit Card', 'cash On delivery ')
A.

CREATE TABLE ord_details  (     ord_id       NUMBER(2) CONSTRAINT ord_id_nn NOT NULL,     ord_date     DATE DEFAULT SYSDATE NOT NULL,     ord_amount   NUMBER(5, 2) CONSTRAINT ord_amount_min CHECK (ord_amount > 50),     ord_status   VARCHAR2(15) CONSTRAINT ord_status_chk CHECK (ord_status IN ('Shipped', 'Not Shipped')),     ord_pay_mode VARCHAR2(15) CONSTRAINT ord_pay_chk CHECK (ord_pay_mode IN ('Cheque', 'Credit Card', 'Cash On Delivery'))  );
Error: ord_amount should be greater than or equal to 50.
B.

CREATE TABLE ord_details  (     ord_id       NUMBER(2) CONSTRAINT ord_id_uk UNIQUE NOT NULL,     ord_date     DATE DEFAULT SYSDATE NOT NULL,     ord_amount   NUMBER(5, 2) CONSTRAINT ord_amount_min CHECK (ord_amount > 50),     ord_status   VARCHAR2(15) CONSTRAINT ord_status_chk CHECK (ord_status IN ('Shipped', 'Not Shipped')),     ord_pay_mode VARCHAR2(15) CONSTRAINT ord_pay_chk CHECK (ord_pay_mode IN ('Cheque', 'Credit Card', 'Cash On Delivery'))  );
Error: ord_amount should be greater than or equal to 50.
C.

CREATE TABLE ord_details  (     ord_id       NUMBER(2) CONSTRAINT ord_id_pk PRIMARY KEY,     ord_date     DATE DEFAULT SYSDATE NOT NULL,     ord_amount   NUMBER(5, 2) CONSTRAINT ord_amount_min CHECK (ord_amount >= 50),     ord_status   VARCHAR2(15) CONSTRAINT ord_status_chk CHECK (ord_status IN ('Shipped', 'Not Shipped')),     ord_pay_mode VARCHAR2(15) CONSTRAINT ord_pay_chk CHECK (ord_pay_mode IN ('Cheque', 'Credit Card', 'Cash On Delivery'))  );
D.
CREATE TABLE ord_details  (     ord_id       NUMBER(2),     ord_date     DATE NOT NULL DEFAULT SYSDATE,     ord_amount   NUMBER(5, 2) CONSTRAINT ord_amount_min CHECK (ord_amount >= 50),     ord_status   VARCHAR2(15) CONSTRAINT ord_status_chk CHECK (ord_status IN ('Shipped', 'Not Shipped')),     ord_pay_mode VARCHAR2(15) CONSTRAINT ord_pay_chk CHECK (ord_pay_mode IN ('Cheque', 'Credit Card', 'Cash On Delivery'))  );
Error. ord_id is the primary key.

Answer: C


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.