Oracle SQL Questions and Answers – DDL Command

This set of Oracle Database Multiple Choice Questions & Answers (MCQs) focuses on “DDL Commands”.

1. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
a) Data Definition Language(DDL)
b) Data Manipulation Language(DML)
c) DML and DDL
d) None of the Mentioned
View Answer

Answer: a
Explanation: The DDL is used to manage table and index structure.CREATE, ALTER, RENAME, DROP and TRUNCATE statements are the names of few data definition elements.

2. Which of the following is/are the DDL statements?
a) Create
b) Drop
c) Alter
d) All of the Mentioned
View Answer

Answer: d
Explanation: All the mentioned commands are the part of DDL statements.

3. In SQL, which command(s) is(are) used to change a table’s storage characteristics?
a) ALTER TABLE
b) MODIFY TABLE
c) CHANGE TABLE
d) All of the Mentioned
View Answer

Answer: a
Explanation: To change the structure of the table we use ALTER TABLE Syntax:
ALTER TABLE “table_name” ADD “column_name” datatype
OR
ALTER TABLE “table_name” DROP COLUMN “column_name”.
advertisement
advertisement

4. In SQL, which of the following is not a data definition language commands?
a) RENAME
b) REVOKE
c) GRANT
d) UPDATE
View Answer

Answer: a
Explanation: With RENAME statement you can rename a table.RENAME, REVOKE and GRANT are DDL commands and UPDATE is DML command.

5. ________clause is an additional filter that is applied to the result.
a) Select
b) Group-by
c) Having
d) Order by
View Answer

Answer: c
Explanation: The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions.

6. ___________ defines rules regarding the values allowed in columns and is the standard mechanism for enforcing database integrity.
a) Column
b) Constraint
c) Index
d) Trigger
View Answer

Answer: b
Explanation: SQL constraints are used to specify rules for the data in a table.If there is any violation between the constraint and the data action, the action is aborted by the constraint.

7. SQL has how many main commands for DDL:
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: c
Explanation: Create, Delete, Alter these are 3 main command.
advertisement

8. Which command defines its columns, integrity constraint in create table:
a) Create command
b) Drop table command
c) Alter table command
d) All of the Mentioned
View Answer

Answer: a
Explanation: The CREATE TABLE statement is used to create a table in a database.Tables are organized into rows and columns.

9. Which command is used for removing a table and all its data from the database:
a) Create command
b) Drop table command
c) Alter table command
d) All of the Mentioned
View Answer

Answer: b
Explanation: The DROP INDEX statement is used to delete an index in a table.
advertisement

10. Which command allows the removal of all rows from a table but flushes a table more efficiently since no rollback information is retained:
a) TRUNCATE command
b) Create command
c) Drop table command
d) Alter table command
View Answer

Answer: a
Explanation: The SQL TRUNCATE TABLE command is used to delete complete data from an existing table.You can also use DROP TABLE command to delete complete table but it would remove complete table structure form the database and you would need to re-create this table once again if you wish you store some data.

Sanfoundry Global Education & Learning Series – Oracle Database.

To practice all areas of Oracle Database, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.