L2 Engineer
L2 Engineer Interview Questions and Answers for Freshers
Q1. Can we delete the primary key?
No, primary keys should not be deleted as they uniquely identify each record in a database.
Primary keys are essential for maintaining data integrity and ensuring uniqueness of records.
Deleting a primary key can lead to data inconsistencies and errors in the database.
If a primary key needs to be changed, it is better to update it rather than delete it.
Q2. Difference between drop and delete?
Drop means to remove a database object, while delete means to remove data from a table.
Drop is used to remove an entire database object like a table, view, or database itself.
Delete is used to remove specific rows of data from a table.
Drop operation is irreversible and can lead to loss of data, while delete operation can be rolled back if within a transaction.
Example: DROP TABLE employees; DELETE FROM employees WHERE age > 50;
Q3. What are triggers?
Triggers are special stored procedures in databases that are automatically executed or fired when certain events occur.
Triggers are used to maintain data integrity by enforcing business rules or automating actions.
They can be set to execute before or after an INSERT, UPDATE, or DELETE operation on a table.
Examples of triggers include auditing changes to a table, updating a related table when a record is inserted, or enforcing constraints.
L2 Engineer Jobs
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month