Question
What is the difference between DELETE, TRUNCATE, and
DROP commands in SQL?Solution
DELETE is DML β removes rows matching a WHERE clause, fires row-level triggers, logs each deletion, and can be rolled back within a transaction. TRUNCATE is DDL β removes ALL rows instantly by deallocating data pages, cannot be rolled back (in most RDBMS), does not fire row triggers, resets identity/auto-increment counters. DROP removes the table schema entirely β structure, data, indexes, triggers are all permanently gone. Critical distinction for banking database administration.
Find the average number of female employees in Marketing, HR and Production departments together.
Find the number of females of tribe Dimasa.
Find the average number of employees in HR, Sales and Operation together.
The total number of employees working in the Accounts department forms what per cent of the total number of employees in the organization?
What is the ratio between the sum of the number of girls and boys in school A and the number of teachers in school C?
Find the ratio of the number of female of tribe Raba and Dimasa.
What is the average of number of male employees who are unmarried and number of female employees who are married?
Find the total number of students who play at least 2 games.
Find the number of Red apples sold by βSβ
What is the difference between the number of teachers from school B and the average number of girls from school A and B?