Delete vs Truncate in MySQL and MS SQL Server DELETE DELETE is a DML command. The DELETE statement is executed using a row lock; each row in the table is locked for deletion. We can specify filters in where clause It deletes specified data if a "where" condition exists. Delete activates a trigger because the operations are logged individually. Slower than truncate because it keeps logs. Rollback is possible. TRUNCATE TRUNCATE is a DDL command. TRUNCATE TABLE always locks the table and page but not each row. Cannot use the WHERE condition. It removes all the data. TRUNCATE TABLE cannot activate a trigger because the operation does not log individual row deletions. Faster performance-wise, because it doesn't keep any logs. Rollback is possible. DELETE and TRUNCATE both can be rolled back when used with TRANSACTION (TRUNCATE can be rolled back in SQL Server, but not in MySQL ). if there is a PK with auto increment, truncate will reset the counter Learn SQL with us at PCWorks...
SQL Project Ideas Have you recently attended a data analytics or similar interview, and they asked how you could prove your skills? Here are some ideas for databases to create and upload to GitHub to showcase your skills if you are looking to change jobs. :
Building Cross-Platform JavaFX Apps with Gluon If you love JavaFX for desktop development, you’ll be excited to know that Gluon takes it a step further—bringing your JavaFX applications to mobile and embedded devices with minimal effort. Java Bootcamp What Is Gluon? Gluon is a powerful suite of tools and libraries that extend JavaFX to run seamlessly across platforms—including iOS , Android , desktop , and even embedded systems . Its mission is simple: to make “write once, run anywhere” truly possible for JavaFX developers. Java Bootcamp Key Highlights of Gluon 1. Cross-Platform Support With Gluon, you can use a single JavaFX codebase to build apps that run natively on mobile, desktop, and embedded devices. This drastically reduces development time and maintenance effort. Java Bootcamp 2. Gluon Mobile Designed for modern devices, Gluon Mobile provides optimized UI controls and themes built for touch interaction—so your app looks and feels natural on smartphones and ta...
Comments
Post a Comment