86.
Which statement will remove the column UPDATE_DT from the table STATE?
- [A]ALTER TABLE STATE DROP COLUMN UPDATE_DT;
- [B]ALTER TABLE STATE REMOVE COLUMN UPDATE_DT;
- [C]DROP COLUMN UPDATE_DT FROM STATE;
- [D]ALTER TABLE STATE SET UNUSED COLUMN UPDATE_DT;
- [E]You cannot drop a column from the table
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
You can use the DROP COLUMN clause with the ALTER TABLE statement to drop a column. There is no separate DROP COLUMN statement or a REMOVE clause in the ALTER TABLE statement. The SET UNUSED clause is used to mark the column as unused. This column can be dropped later using the DROP UNUSED COLUMNS clause. |
87.
What is the default length of a CHAR datatype column if no length is specified in the table
definition?
- [A]256
- [B]1,000
- [C]64
- [D]1
- [E]You must always specify a length for CHAR columns.
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
If you do not specify a length for a CHAR datatype column, the default length of 1 is assumed. |
88.
The HIRING table has the following data: EMPNO HIREDATE --------- ---------- 1021 12-DEC-00 3400 24-JAN-01 2398 30-JUN-01 What will be result of the following query? SELECT hiredate+1 FROM hiring WHERE empno = 3400;
- [A]4-FEB-01
- [B]25-JAN-01
- [C]N-02
- [D]None of the above
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :
In date arithmetic, adding 1 is equivalent to adding 24 hours. To add 6 hours to a date value with time, add 0.25. |
89.
The STATE table has six rows. You issue the following command:
ALTER TABLE STATE ADD UPDATE_DT DATE DEFAULT SYSDATE;
Which of the following is correct?
Which of the following is correct?
- [A]A new column, UPDATE_DT, is added to the STATE table, and its contents for the existing rows are NULL.
- [B]Since the table is not empty, you cannot add a new column
- [C]The DEFAULT value cannot be provided if the table has rows.
- [D]A new column, UPDATE_DT, is added to STATE and is populated with the current system date and time.
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
When a default value is specified in the new column added, the column values for the existing rows are populated with the default value. If you include the NOT NULL constraint with the DEFAULT value, only the dictionary is updated. |
90.
Which dictionary view would you query to list only the tables you own?
- [A]ALL_TABLES
- [B]DBA_TABLES
- [C]USER_TABLES
- [D]USR_TABLES
- Answer & Explanation
- Report
Answer : [C]
Explanation :
Explanation :
The USER_TABLES view provides information on the tables owned by the user who has logged on that session. DBA_TABLES will have all the tables in the database, and ALL_ TABLES will have the tables owned by you as well as the tables to which you have access. USR_TABLES is not a valid dictionary view. |