Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda DROP e TRUNCATE | DDL e DML em SQL
SQL Intermediário

bookDROP 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;
1
TRUNCATE TABLE employees;
copy
TRUNCATE TABLE employees;
question mark

What is the main difference between DROP TABLE and TRUNCATE TABLE operations?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 4. Capítulo 3

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

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?

bookDROP 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;
1
TRUNCATE TABLE employees;
copy
TRUNCATE TABLE employees;
question mark

What is the main difference between DROP TABLE and TRUNCATE TABLE operations?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 4. Capítulo 3
some-alt