DROP and TRUNCATE
It's worth mentioning two more operations in DDL: DROP
and TRUNCATE
.
DROP
: Used to delete database objects such as tables, databases, and indexes.
TRUNCATE
: Removes all rows from a table but preserves the table's structure.
We've used these operations to clear or delete tables to check tasks in previous chapters:
Es importante mencionar dos operaciones más en DDL: DROP
y TRUNCATE
.
Veamos brevemente qué hace cada una de estas operaciones:
DROP
: Se utiliza para eliminar objetos de la base de datos como tablas, bases de datos e índices.
TRUNCATE
: Elimina todas las filas de una tabla pero conserva la estructura de la misma.
He utilizado estas operaciones para limpiar o eliminar tablas al verificar tareas en capítulos anteriores. Su sintaxis es bastante simple; veámoslas:
DROP TABLE employees;
1TRUNCATE TABLE employees;
TRUNCATE TABLE employees;
¡Gracias por tus comentarios!
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
What is the difference between DROP and TRUNCATE in SQL?
Can you explain more about soft deletion and how to implement it?
What permissions are typically required to use DROP or TRUNCATE commands?
Awesome!
Completion rate improved to 4
DROP and TRUNCATE
Desliza para mostrar el menú
It's worth mentioning two more operations in DDL: DROP
and TRUNCATE
.
DROP
: Used to delete database objects such as tables, databases, and indexes.
TRUNCATE
: Removes all rows from a table but preserves the table's structure.
We've used these operations to clear or delete tables to check tasks in previous chapters:
Es importante mencionar dos operaciones más en DDL: DROP
y TRUNCATE
.
Veamos brevemente qué hace cada una de estas operaciones:
DROP
: Se utiliza para eliminar objetos de la base de datos como tablas, bases de datos e índices.
TRUNCATE
: Elimina todas las filas de una tabla pero conserva la estructura de la misma.
He utilizado estas operaciones para limpiar o eliminar tablas al verificar tareas en capítulos anteriores. Su sintaxis es bastante simple; veámoslas:
DROP TABLE employees;
1TRUNCATE TABLE employees;
TRUNCATE TABLE employees;
¡Gracias por tus comentarios!