1Z0-051 30. Evaluate thefollowing CREATE TABLE commands
2017-07-04 11:12
471 查看
30. Evaluate thefollowing CREATE TABLE commands:
CREATE TABLEorders
(ord_noNUMBER(2) CONSTRAINT ord_pk PRIMARY KEY,
ord_date DATE,
cust_idNUMBER(4));
CREATE TABLEord_items
(ord_noNUMBER(2),
item_noNUMBER(3),
qty NUMBER(3)CHECK (qty BETWEEN 100 AND 200),
expiry_date dateCHECK (expiry_date > SYSDATE),
CONSTRAINT it_pkPRIMARY KEY (ord_no,item_no),
CONSTRAINTord_fk FOREIGN KEY(ord_no) REFERENCES orders(ord_no));
The abovecommand fails when executed. What could be the reason?
A. SYSDATEcannot be used with the CHECK constraint.
B. The BETWEENclause cannot be used for the CHECK constraint.
C. The CHECKconstraint cannot be placed on columns having the DATE data type.
D. ORD_NO andITEM_NO cannot be used as a composite primary key because ORD_NO is also the
FOREIGN KEY.
答案:A。sysdate是变量所以不能用在check约束中,但是可以用作默认值
CREATE TABLEorders
(ord_noNUMBER(2) CONSTRAINT ord_pk PRIMARY KEY,
ord_date DATE,
cust_idNUMBER(4));
CREATE TABLEord_items
(ord_noNUMBER(2),
item_noNUMBER(3),
qty NUMBER(3)CHECK (qty BETWEEN 100 AND 200),
expiry_date dateCHECK (expiry_date > SYSDATE),
CONSTRAINT it_pkPRIMARY KEY (ord_no,item_no),
CONSTRAINTord_fk FOREIGN KEY(ord_no) REFERENCES orders(ord_no));
The abovecommand fails when executed. What could be the reason?
A. SYSDATEcannot be used with the CHECK constraint.
B. The BETWEENclause cannot be used for the CHECK constraint.
C. The CHECKconstraint cannot be placed on columns having the DATE data type.
D. ORD_NO andITEM_NO cannot be used as a composite primary key because ORD_NO is also the
FOREIGN KEY.
答案:A。sysdate是变量所以不能用在check约束中,但是可以用作默认值
相关文章推荐
- 30.Evaluate the following CREATE TABLE commands:
- 1Z0-051 25. You need to create a table with the following column specifications:
- 39.Evaluate the following command:CREATE TABLE employees(employee_id NUMBER(2) PRIMARY KEY
- 1Z0-051 37. You issued the following command to drop the PRODUCTS table:
- 145.Examine the commands executed in a DBA session: SQL> CREATE BIGFILE TABLESPACE MRKT 2 DATAFILE '
- 25.You need to create a table with the following column specifications:
- 43.Evaluate the following CREATE SEQUENCE statement:
- 157.Examine the commands executed in the following sequence: 1: SQL> CREATE ROLE mgrrole; 2: SQL> G
- 33.You want to create an ORD_DETAIL table to store details for an order placed having the following
- 149.You executed the following command to create a tablespace called SALES_DATA: SQL> CREATE TABLESP
- The following table shows the core technology areas of the .NET Framework.
- OCP 1Z0 051 QUESTION NO: 30
- Mysql :Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
- create the model and table
- 【12C考题精解】OCP 1z0-060 QUESTION 3: Managing the SYSAUX Tablespace
- 【12C考题精解】OCP 1z0-060 QUESTION 6: Recovery of a Tablespace in the PDB
- 122 The user SYS creates a job by using the following command: BEGIN DBMS_SCHEDULER.CREATE_JOB ( job
- 10.Examine the following statement that is used to modify the constraint on the SALES table:
- 92.You executed the following commands in an RMAN session for your database instance that has failur
- 问题:The following build commands failed: CompileXIB **.xib