Q81. DELETE vs TRUNCATE?
See the comparison table above. Key differences: `DELETE` is DML (row-by-row, rollbackable, fires triggers, has WHERE). `TRUNCATE` is DDL (bulk page deallocation, faster,...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (119 available).
See the comparison table above. Key differences: `DELETE` is DML (row-by-row, rollbackable, fires triggers, has WHERE). `TRUNCATE` is DDL (bulk page deallocation, faster,...
The **`CREATE TABLE`** statement defines and provisions a new table schema: ```sql CREATE TABLE Customers ( customer_id INT AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR...
Collation defines the **rules for comparing and sorting** characters. It works with the character set. - `utf8mb4_general_ci`: Case-insensitive, faster - `utf8mb4_unicode...
Automatically generates sequential unique integers for a column, typically the PRIMARY KEY. ```sql CREATE TABLE users (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50)...
MySQL supports a complete set of integrity constraints: 1. **`PRIMARY KEY`**: Uniquely identifies each row (implies `NOT NULL` and `UNIQUE`). 2. **`FOREIGN KEY`**: Enforc...
Any assertion claiming that **constraints are optional in production** or that **constraints significantly slow down reads** is false. ### Why Constraints Are Vital: - Co...
The **`NOT NULL`** constraint enforces that a column must always contain a valid data value and cannot accept `NULL`: ```sql CREATE TABLE employees ( id INT PRIMARY KEY, ...
To enforce that every value in a non-primary key column is unique, apply the **`UNIQUE`** constraint: ```sql CREATE TABLE users ( id INT PRIMARY KEY, email VARCHAR(255) U...
A **`CHECK`** constraint ensures that all values stored in a column satisfy a specific boolean condition: ```sql CREATE TABLE products ( product_id INT PRIMARY KEY, name ...
| PRIMARY KEY | UNIQUE | |-------------|--------| | One per table | Multiple per table | | Cannot be NULL | Usually allows one NULL | | Implicitly indexed | Explicitly in...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.