1Z0-071 Data Definition Language (DDL) 1 — Questions and Answers
Question 1: Which DDL statement creates a new table in Oracle?
- INSERT TABLE
- MAKE TABLE
- CREATE TABLE (Correct answer)
- BUILD TABLE
Correct answer: CREATE TABLE
CREATE TABLE defines a new table with its columns, data types, and optional constraints.
Question 2: What does the ALTER TABLE ... ADD COLUMN statement do?
- Removes an existing column
- Changes the data type of an existing column
- Adds a new column to an existing table (Correct answer)
- Renames the table
Correct answer: Adds a new column to an existing table
ALTER TABLE with the ADD clause inserts a new column definition into an existing table.
Question 3: Which constraint ensures each value in a column is unique and not NULL?
- UNIQUE
- NOT NULL
- CHECK
- PRIMARY KEY (Correct answer)
Correct answer: PRIMARY KEY
A PRIMARY KEY constraint enforces both uniqueness and NOT NULL on the column(s) it covers.
Question 4: What does the DROP TABLE statement do?
- Removes all rows but keeps the table structure
- Removes the table and all its data permanently (Correct answer)
- Moves the table to a different schema
- Disables all constraints on the table
Correct answer: Removes the table and all its data permanently
DROP TABLE removes the table definition and all its rows, freeing all associated storage.
Question 5: Which Oracle DDL command renames an existing table?
- ALTER TABLE old_name RENAME TO new_name
- RENAME old_name TO new_name (Correct answer)
- MODIFY TABLE old_name TO new_name
- UPDATE TABLE old_name SET name = 'new_name'
Correct answer: RENAME old_name TO new_name
The RENAME statement changes the name of a table (or other object) to a new name.
Question 6: Which DDL statement removes all rows from a table but keeps its structure, and cannot be rolled back?
- DELETE FROM table
- DROP TABLE
- TRUNCATE TABLE (Correct answer)
- REMOVE TABLE
Correct answer: TRUNCATE TABLE
TRUNCATE TABLE is a DDL command that removes all rows instantly without logging individual row deletions and cannot be rolled back.
Which DDL statement creates a new table in Oracle?