1. What does DDL stand for in SQL?
Explanation: DDL is used to define the structure of a database, including tables, constraints, and relationships.
Report for correction2. Which DDL statement is used to create a new table?
Explanation: The CREATE TABLE statement is used to create a new table in a database.
Report for correction3. Which DDL statement is used to add a new column to an existing table?
Explanation: The ADD COLUMN statement is used to add a new column to an existing table.
Report for correction4. What is the purpose of the ALTER TABLE statement in DDL?
Explanation: The ALTER TABLE statement is used to modify the structure of an existing table.
Report for correction5. Which DDL statement is used to delete a table from a database?
Explanation: The DROP TABLE statement is used to delete a table from a database.
Report for correction6. What is the purpose of the PRIMARY KEY constraint in DDL?
Explanation: The PRIMARY KEY constraint is used to ensure that each row in a table has a unique value in the specified column.
Report for correction7. Which DDL statement is used to remove a PRIMARY KEY constraint from a table?
Explanation: The DROP PRIMARY KEY statement is used to remove a PRIMARY KEY constraint from a table.
Report for correction8. Which DDL statement is used to create a unique constraint on a column?
Explanation: The ADD CONSTRAINT statement is used to create a unique constraint on a column.
Report for correction9. What is the purpose of the FOREIGN KEY constraint in DDL?
Explanation: The FOREIGN KEY constraint is used to create a relationship between two tables and ensure referential integrity.
Report for correction10. Which DDL statement is used to remove a FOREIGN KEY constraint from a table?
Explanation: The DROP FOREIGN KEY statement is used to remove a FOREIGN KEY constraint from a table.
Report for correction11. Which DDL statement is used to change the data type of a column in an existing table?
Explanation: ALTER COLUMN statements are used to change the data type of a column in an existing table.
Report for correction12. What is the purpose of the CHECK constraint in DDL?
Explanation: The CHECK constraint is used to enforce data integrity rules on a column.
Report for correction13. Which DDL statement is used to add a default value to a column?
Explanation: The SET DEFAULT statement is used to add a default value to a column.
Report for correction14. What is the purpose of the INDEX keyword in DDL?
Explanation: The INDEX keyword is used to define an index on one or more columns in a table.
Report for correction15. Which DDL statement is used to rename a table?
Explanation: The RENAME TABLE statement is used to rename a table in DDL.
Report for correction16. What is the purpose of the VIEW keyword in DDL?
Explanation: The VIEW keyword is used to define a virtual table based on the result of a query.
Report for correction17. Which DDL statement is used to remove a view?
Explanation: The DROP VIEW statement is used to remove a view.
Report for correction18. What is the purpose of the TRUNCATE TABLE statement in DDL?
Explanation: The TRUNCATE TABLE statement is used to remove all rows from a table while keeping the table structure intact.
Report for correction19. Which DDL statement is used to add a new constraint to an existing table?
Explanation: The ADD CONSTRAINT statement is used to add a new constraint to an existing table.
Report for correction20. What is the purpose of the UNIQUE constraint in DDL?
Explanation: The UNIQUE constraint is used to enforce uniqueness on a column, ensuring that all values in the column are distinct.
Report for correction21. Which DDL statement is used to remove a UNIQUE constraint from a column?
Explanation: The DROP UNIQUE statement is used to remove a UNIQUE constraint from a column.
Report for correction22. What is the purpose of the DEFAULT constraint in DDL?
Explanation: The DEFAULT constraint is used to specify a default value for a column.
Report for correction23. Which DDL statement is used to modify the name of a column in an existing table?
Explanation: The RENAME COLUMN statement is used to modify the name of a column in an existing table.
Report for correction24. What does the CASCADE option do when removing a foreign key constraint in DDL?
Explanation: The CASCADE option, when used with the removal of a foreign key constraint, will drop all dependent tables.
Report for correction