Q91. DROP vs TRUNCATE?
While both `DROP` and `TRUNCATE` are DDL operations, their scope is fundamentally different: | Feature | `TRUNCATE TABLE` | `DROP TABLE` | | :--- | :--- | :--- | | **Data...
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 (118 available).
While both `DROP` and `TRUNCATE` are DDL operations, their scope is fundamentally different: | Feature | `TRUNCATE TABLE` | `DROP TABLE` | | :--- | :--- | :--- | | **Data...
To add an `order_date` column to an existing table, use `ALTER TABLE ... ADD COLUMN`: ```sql ALTER TABLE `orders` ADD COLUMN order_date DATE NOT NULL DEFAULT (CURRENT_DAT...
```sql -- MySQL ALTER TABLE Customer CHANGE Address Addr VARCHAR(50); -- PostgreSQL / Standard ALTER TABLE Customer RENAME COLUMN Address TO Addr; ```
To remove a column from an existing table schema, use `ALTER TABLE ... DROP COLUMN`: ```sql ALTER TABLE addresses DROP COLUMN city; ``` *Production Warning:* Dropping a c...
Data structures (typically B-Trees) that speed up data retrieval at the cost of slower writes and extra storage. Think of them as a book's table of contents.
- **Clustered**: Determines physical storage order. One per table. The data IS the index. - **Non-Clustered**: Separate structure with pointers to data. Multiple allowed ...
`GRANT`. To remove: `REVOKE`. ```sql GRANT SELECT, INSERT ON database.orders TO 'app_user'@'%'; REVOKE DELETE ON database.orders FROM 'app_user'@'%'; ```
1. **System privileges**: CREATE, DROP, ALTER (database-level) 2. **Object privileges**: SELECT, INSERT, UPDATE, DELETE, EXECUTE (table/procedure-level)
In SQL security management, database administrators can grant specific privileges using the `GRANT` statement: - **Data Manipulation Privileges**: `SELECT`, `INSERT`, `UP...
A code injection attack where malicious SQL is inserted via user input. Prevention: 1. **Parameterized queries** (prepared statements) 2. **Input validation** 3. **ORM fr...
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.