SQL Data Definition Language MCQ
SQL Data Definition Language MCQs : This section focuses on the "Data Definition Language (DDL) " of the SQL. These Multiple Choice Questions (mcq) should be practiced to improve the SQL skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
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
Ans : 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
Ans : D
Explanation: All the mentioned commands are the part of DDL statements.
3. SQL has how many main commands for DDL:
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : C
Explanation: Create, Delete, Alter these are 3 main command.
4. Which of the following statement removes database including its related components?
A. DROP DATABASE
B. DELETE DATABASE
C. REMOVE DATABASE
D. None of the mentioned
View Answer
Ans : A
Explanation: DROP statement adds support for dropping database snapshots.
5. Which of the following statement removes sales and suppliers database?
A. DROP DATABASE Sales, NewSales
B. DROP DATABASE Sales, suppliers
C. DROP DATABASE Sales and suppliers
D. DROP DATABASE Sales-suppliers
View Answer
Ans : B
Explanation: DROP DATABASE can be used for removing multiple databases in one statement.
6. View used used for displaying current status of database is ___________
A. system.databases
B. current.databases
C. sys.databases
D. status.databases
View Answer
Ans : C
Explanation: sys.databases catalog view is used for displaying the present status of the system.
7. Command that is used to add attributes to an existing relation, is said to be
A. Alter
B. Modify
C. Tailor
D. Eliminate
View Answer
Ans : A
Explanation: Command that is used to add attributes to an existing relation, is said to be Alter.
8. Which requirements can be implemented using a CHECK constraint?
A. Customer must be greater than 21 years old
B. Customer must have a residence in an Asian Country
C. Both A and B
D. None of the above
View Answer
Ans : C
Explanation: Both A and B requirements can be implemented using a CHECK constraint
9. Which of the following statements are TRUE?
A. A Unique constraint allows multiple rows to have NULL value
B. Integrity constraint can be added to a table even if table data is in violation
C. A PRIMARY KEY allows a single row to contain NULL
D. Both A and B
View Answer
Ans : A
Explanation: A Unique constraint allows multiple rows to have NULL value is the following statements TRUE.
10. Which statement would add a column CGPA to a table Student which is already created
A. ALTER TABLE Student ADD COLUMN (CGPA NUMBER(3,1));
B. ALTER TABLE Student CGPA NUMBER(3,1);
C. ALTER TABLE Student ADD (CGPA NUMBER(3,1));
D. Both A and C
View Answer
Ans : C
Explanation: ALTER TABLE Student ADD (CGPA NUMBER(3,1)); statement would add a column CGPA to a table Student which is already created.
Also check :
Discussion