DROP e 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:
É importante mencionar mais duas operações em DDL: DROP e TRUNCATE.
Vamos considerar brevemente o que cada uma dessas operações faz:
DROP: Utilizado para excluir objetos de banco de dados como tabelas, bancos de dados e índices.
TRUNCATE: Remove todas as linhas de uma tabela, mas preserva a estrutura da tabela.
Eu utilizei essas operações para limpar ou excluir tabelas ao verificar tarefas em capítulos anteriores. Sua sintaxe é bastante simples; vamos olhar para elas:
DROP TABLE employees;
1TRUNCATE TABLE employees;
TRUNCATE TABLE employees;
Obrigado pelo seu feedback!
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
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?
Incrível!
Completion taxa melhorada para 4
DROP e TRUNCATE
Deslize para mostrar o menu
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:
É importante mencionar mais duas operações em DDL: DROP e TRUNCATE.
Vamos considerar brevemente o que cada uma dessas operações faz:
DROP: Utilizado para excluir objetos de banco de dados como tabelas, bancos de dados e índices.
TRUNCATE: Remove todas as linhas de uma tabela, mas preserva a estrutura da tabela.
Eu utilizei essas operações para limpar ou excluir tabelas ao verificar tarefas em capítulos anteriores. Sua sintaxe é bastante simples; vamos olhar para elas:
DROP TABLE employees;
1TRUNCATE TABLE employees;
TRUNCATE TABLE employees;
Obrigado pelo seu feedback!