zoukankan      html  css  js  c++  java
  • OCP-1Z0-新051-61题版本-36

    QUESTION NO: 36

    Which CREATE TABLE statement is valid?

    A.

    CREATE TABLE ord_details

    (ord_no NUMBER(2) PRIMARY KEY,

    item_no NUMBER(3) PRIMARY KEY,

    ord_date DATE NOT NULL);

    B.

    CREATE TABLE ord_details

    (ord_no NUMBER(2) UNIQUE, NOT NULL,

    item_no NUMBER(3),

    ord_date DATE DEFAULT SYSDATE NOT NULL);

    C.

    CREATE TABLE ord_details

    (ord_no NUMBER(2) ,

    item_no NUMBER(3),

    ord_date DATE DEFAULT NOT NULL,

    CONSTRAINT ord_uq UNIQUE (ord_no),

    CONSTRAINT ord_pk PRIMARY KEY (ord_no));

    D.

    CREATE TABLE ord_details

    (ord_no NUMBER(2),

    item_no NUMBER(3),

    ord_date DATE DEFAULT SYSDATE NOT NULL,

    CONSTRAINT ord_pk PRIMARY KEY (ord_no, item_no));

    Answer: D

    答案解析:

    参考:32:http://blog.csdn.net/rlhua/article/details/11737627

    Explanation:

    PRIMARY KEY Constraint

    A PRIMARY KEY constraint creates a primary key for the table. Only one primary key can be

    created for each table. The PRIMARY KEY constraint is a column or a set of columns that

    uniquely identifies each row in a table. This constraint enforces the uniqueness of the column or

    column combination and ensures that no column that is part of the primary key can contain a null

    value.

    Note: Because uniqueness is part of the primary key constraint definition, the Oracle server

    enforces the uniqueness by implicitly creating a unique index on the primary key column or

    columns.

  • 相关阅读:
    C语言面试题——寻找错误
    C语言的声明解释的在线工具——cdecl
    C语言面试题——指针运算
    const 指针与指向const的指针
    C语言复杂声明解释
    poj1248
    poj1750
    poj1484
    poj1853
    poj1575
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13316211.html
Copyright © 2011-2022 走看看