0 votes
in Sql by
What are the TRUNCATE, DELETE and DROP statements?

1 Answer

0 votes
by

DELETE statement is used to delete rows from a table.

DELETE FROM Candidates

WHERE CandidateId > 1000;

TRUNCATE command is used to delete all the rows from the table and free the space containing the table.

TRUNCATE TABLE Candidates;

DROP command is used to remove an object from the database. If you drop a table, all the rows in the table is deleted and the table structure is removed from the database.

DROP TABLE Candidates;

Q   =>   Write a SQL statement to wipe a table 'Temporary' from memory.

Q   =>   Write a SQL query to remove first 1000 records from table 'Temporary' based on 'id'.

Q   =>   Write a SQL statement to delete the table 'Temporary' while keeping its relations intact.

Related questions

0 votes
asked Jul 10, 2020 in Sql by SakshiSharma
0 votes
asked Jul 7, 2020 in Sql by Robindeniel
...