Q1
True / FalseIn Oracle, a DEFAULT constraint is used to provide a default value for a column when no value is specified during an insert operation.
The DEFAULT constraint automatically assigns a specified value to a column if no value is provided during an insert operation.
Q2
True / FalseThe DEFAULT value for a column in Oracle must be a constant expression.
The DEFAULT value must be a constant expression and cannot be a subquery or a function that returns varying results.
Q3
True / FalseIn Oracle, you can define a DEFAULT value for any data type, including numbers, strings, and dates.
DEFAULT values can be defined for various data types, including numeric, character, and date data types.
Q4
True / FalseIn Oracle, the DEFAULT constraint can be added to an existing column using the ALTER TABLE statement.
The DEFAULT constraint can be added to an existing column using the ALTER TABLE statement with the MODIFY clause.
Q5
True / FalseIf a DEFAULT constraint is defined on a column, it will override any value provided during an insert operation.
The DEFAULT constraint only provides a value if none is specified; it does not override values provided during an insert operation.
Q6
True / FalseIn Oracle, a column with a DEFAULT constraint can also have a NOT NULL constraint.
A column can have both a DEFAULT and a NOT NULL constraint, ensuring that the column always has a value, either provided or defaulted.
Q7
True / FalseIn Oracle, the DEFAULT constraint can reference other columns in the same table.
The DEFAULT constraint cannot reference other columns; it must be a constant expression.
Q8
True / FalseWhen modifying an existing DEFAULT constraint in Oracle, the new default value will apply to all existing rows in the table.
Modifying the DEFAULT constraint only affects new rows inserted after the change; existing rows are not updated with the new default value.
Q9
True / FalseIn Oracle, you can drop a DEFAULT constraint using the ALTER TABLE statement.
The DEFAULT constraint can be dropped using the ALTER TABLE statement with the MODIFY clause to remove the default value.
Q10
True / FalseThe Oracle Certified Professional (OCP) exam includes knowledge on creating, managing, and modifying DEFAULT constraints in database tables.
The OCP certification covers advanced topics, including the creation, management, and modification of DEFAULT constraints to ensure data integrity and consistency in Oracle databases.
Q12
Single ChoiceIn Oracle, which of the following SQL commands correctly defines a DEFAULT constraint for the SALARY column in the EMPLOYEES table, where the default value should be 5000?
The correct syntax in Oracle to define a DEFAULT constraint for the SALARY column is to use SALARY NUMBER DEFAULT 5000.
Q24
Multiple ChoiceIdentify the SQL scripts that correctly insert data using a DEFAULT constraint in Oracle.
Inserting data into a column with a DEFAULT constraint allows you to omit that column from the insert statement, letting the default value be applied. The correct scripts will demonstrate these methods.
Q29
Multiple ChoiceIdentify the SQL scripts that correctly use the DEFAULT constraint when inserting multiple rows in Oracle.
Inserting multiple rows while using the DEFAULT constraint involves omitting the 'category' column in some insert statements to allow the default value to be applied. The correct scripts will demonstrate this.