- Home
- Database
- Oracle 12 C
- OCA Oracle 12 C SQl Fundamentals(1Z0-061)
46.
The STATE table has the following constraints (the constraint status is shown in
parentheses):
You execute the following SQL code:
CREATE TABLE STATE_NEW AS SELECT * FROM STATE;
How many constraints will there be in the new table?
CREATE TABLE STATE_NEW AS SELECT * FROM STATE;
How many constraints will there be in the new table?
- A.0
- B.1
- C.3
- D.5
- E.2
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :
When you create a table using CTAS (CREATE TABLE AS SELECT), only the NOT NULL constraints are copied. |
47.
Which line of code has an error?
1. CREATE TABLE FRUITS_VEGETABLES
2. (FRUIT_TYPE VARCHAR2,
3. FRUIT_NAME CHAR (20),
4. QUANTITY NUMBER);
1. CREATE TABLE FRUITS_VEGETABLES
2. (FRUIT_TYPE VARCHAR2,
3. FRUIT_NAME CHAR (20),
4. QUANTITY NUMBER);
- A.1
- B.2
- C.3
- D.4
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :
A VARCHAR2 datatype should always specify the maximum length of the column. |
48.
Which statement successfully adds a new column, ORDER_DATE, to the table ORDERS?
- A.ALTER TABLE ORDERS ADD COLUMN ORDER_DATE DATE;
- B.ALTER TABLE ORDERS ADD ORDER_DATE (DATE);
- C.ALTER TABLE ORDERS ADD ORDER_DATE DATE;
- D.ALTER TABLE ORDERS NEW COLUMN ORDER_DATE TYPE DATE;
- Answer & Explanation
- Report
Answer : [C]
Explanation :
Explanation :
The correct statement is C. When you are adding only one column, the column definition doesn’t need to be enclosed in parentheses. |
49.
What special characters are allowed in a table name? (Choose all that apply.)
- A.&
- B.#
- C.@
- D.$
- Answer & Explanation
- Report
Answer : [B, D]
Explanation :
Explanation :
Only three special characters ($, _, and #) are allowed in table names along with letters and numbers. |
50.
Consider the following statement:
CREATE TABLE MY_TABLE (
1ST_COLUMN NUMBER,
2ND_COLUMN VARCHAR2 (20));
Which of the following best describes this statement?
CREATE TABLE MY_TABLE (
1ST_COLUMN NUMBER,
2ND_COLUMN VARCHAR2 (20));
Which of the following best describes this statement?
- A.Tables cannot be created without defining a primary key. The primary key is missing form the table definition.
- B.The reserved word COLUMN cannot be part of the column name.
- C.The column names are invalid.
- D.No maximum length is specified for the first column definition. You must always specify a length for character and numeric columns.
- E.There is no error in the statement.
- Answer & Explanation
- Report
Answer : [C]
Explanation :
Explanation :
All identifiers (column names, table names, and so on) must begin with an alphabetic character. An identifier can contain alphabetic characters, numbers, and the special characters $, #, and _. |