Oracle Database Quiz Questions

Course Name:Oracle
Chapter Name:Chapter 5 - DDL (Data Definition Language)
Lesson Content Link:DEFAULT Constraint
Current Quiz Count:30
Progress
0%
Q1
True / False

In Oracle, a DEFAULT constraint is used to provide a default value for a column when no value is specified during an insert operation.

Q2
True / False

The DEFAULT value for a column in Oracle must be a constant expression.

Q3
True / False

In Oracle, you can define a DEFAULT value for any data type, including numbers, strings, and dates.

Q4
True / False

In Oracle, the DEFAULT constraint can be added to an existing column using the ALTER TABLE statement.

Q5
True / False

If a DEFAULT constraint is defined on a column, it will override any value provided during an insert operation.

Q6
True / False

In Oracle, a column with a DEFAULT constraint can also have a NOT NULL constraint.

Q7
True / False

In Oracle, the DEFAULT constraint can reference other columns in the same table.

Q8
True / False

When modifying an existing DEFAULT constraint in Oracle, the new default value will apply to all existing rows in the table.

Q9
True / False

In Oracle, you can drop a DEFAULT constraint using the ALTER TABLE statement.

Q10
True / False

The Oracle Certified Professional (OCP) exam includes knowledge on creating, managing, and modifying DEFAULT constraints in database tables.

Q11
Single Choice

What is the primary purpose of the DEFAULT constraint in Oracle?

Q12
Single Choice

In 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?

Q13
Single Choice

Which of the following SQL statements will insert a row into the EMPLOYEES table with the DEFAULT value for the SALARY column in Oracle?

SQL Code
CREATE TABLE EMPLOYEES (
 ID NUMBER PRIMARY KEY,
 NAME VARCHAR2(100),
 SALARY NUMBER DEFAULT 3000
);

INSERT INTO EMPLOYEES (ID, NAME)
VALUES (1, 'John Doe');
Q14
Single Choice

In Oracle, how can you modify an existing table to add a DEFAULT constraint to the HIRE_DATE column, setting the default value to the current date?

Q15
Single Choice

Given the following Oracle SQL code, what value will be inserted into the BONUS column if no value is provided?

SQL Code
CREATE TABLE EMPLOYEES (
 ID NUMBER PRIMARY KEY,
 NAME VARCHAR2(100),
 BONUS NUMBER DEFAULT 1000
);

INSERT INTO EMPLOYEES (ID, NAME)
VALUES (2, 'Jane Smith');
Q16
Single Choice

How would you define a DEFAULT constraint on a STATUS column in the ORDERS table in Oracle, where the default value should be 'Pending'?

Q17
Single Choice

Consider the following Oracle SQL table creation. What will happen if an INSERT statement does not provide a value for the CREATED_AT column?

SQL Code
CREATE TABLE DOCUMENTS (
 DOC_ID NUMBER PRIMARY KEY,
 DOC_NAME VARCHAR2(100),
 CREATED_AT DATE DEFAULT SYSDATE
);
Q18
Single Choice

In Oracle, which of the following statements correctly drops the DEFAULT constraint from the DISCOUNT column in the ORDERS table?

Q19
Single Choice

What will happen in Oracle if a DEFAULT constraint is defined on a NOT NULL column, and an insert statement does not provide a value for that column?

Q20
Single Choice

In Oracle, which of the following is true when you define a DEFAULT constraint on a column?

Q21
Multiple Choice

Identify the SQL scripts that correctly define a DEFAULT constraint on a numeric column in Oracle.

Q22
Multiple Choice

Select the SQL scripts that correctly modify an existing column to add a DEFAULT constraint in Oracle.

Q23
Multiple Choice

Determine the SQL scripts that correctly query rows where a column has its DEFAULT value in Oracle.

Q24
Multiple Choice

Identify the SQL scripts that correctly insert data using a DEFAULT constraint in Oracle.

Q25
Multiple Choice

Select the SQL scripts that correctly enforce a DEFAULT constraint during table creation in Oracle.

Q26
Multiple Choice

Identify the SQL scripts that correctly remove a DEFAULT constraint from an existing column in Oracle.

Q27
Multiple Choice

Determine the SQL scripts that correctly define a table with multiple DEFAULT constraints in Oracle.

Q28
Multiple Choice

Select the SQL scripts that correctly validate data after adding a DEFAULT constraint in Oracle.

Q29
Multiple Choice

Identify the SQL scripts that correctly use the DEFAULT constraint when inserting multiple rows in Oracle.

Q30
Multiple Choice

Determine the SQL scripts that correctly handle inserting NULL into a column with a DEFAULT constraint in Oracle.