Hello friends, In this post, I have listed out the interview questions that needs to be prepared if you planning to attained the technical interview on database and sql.
- What is anomalies in DBMS? Types of anomalies?
- What is normalization? Advantage and Disadvantage of normalization?
- What is normal forms in relational database? how many types of normal form are available?
- What is keys ? What are the different types of keys available in DBMS – Super Key, Primary Key, Candidate Key, Foreign Key, Non Key.
- What is constraints in SQL Server? Types of constraints ? Give example of constraints?
- Difference between Primary Key vs Candidate Key?
- Difference between Primary Key vs Unique Key?
- Difference between Primary Key vs Foreign Key?
- Difference between Group By vs Order By?
- Order of execution of Group By, Order By, Where, Having?
- Difference between Char and Varchar in sql server?
- Difference between Varchar and NVarchar?
- Difference between Delete, Drop and Truncate table? Which is faster and why?
- What is Stored procedure? Advantage of using Stored procedures?
- Compare Query vs Stored procedure? Which is good for performance?
- What is User Defined Function? Advantage of using UDF?
- Types of UDF? What is Scaler and Table valued function?
- Types of Table valued functions – Inline and multi-statement function?
- Difference between Stored procedure vs UDF? Scenario of using SP and UDF?
- What is View ? Advantage of using View ? When we should use View?
- What is Updatable view? What are the rules for updatable view?
- What is Index view/Materialized view? How to write a indexed view in sql server?
- Difference between View and Stored Procedure? Scenario of using View and Stored Procedures?
- What is JOINs? Types of JOINs in sql server?
- Difference between Inner/Outer/Full Join?
- What is Self Join? Example?
- What is Equi join and Natural Join?
- How to optimize JOINs if we have multiple table ?
- Union and UnionAll? Differences?
- What is Temp table? Types of Temp table? Where does Temp table stores data?
- Difference between Local Temp table vs Global temp tables?
- How does Temp table behaves within the stored procedure?
- What is Common Table expression- CTE? What is the use of CTE ? Types of CTE ? Syntax of using CTE?
- Can we use CTE as target in DML operations?
- Should we use CTE immediately after definition? Restriction of using CTE?
- What is trigger? Advantage of using trigger?
- If we have SP then why do we need triggers? What is the real use of triggers? Example
- Difference between Trigger and stored procedure?
- Can we execute trigger through code or script?
- How can you handle exceptions in sql server?
- What is cursor in sql server?
- Advantage and Disadvantage of using cursor?
- What is Index? Types of index? Syntax?
- Difference between Cluster and Non-Clustered index?
- What are the points needs to be considered when applying indexes on table?
- What are the Locking mechanism used in sql server? What is pessimistic and optimistic locks? How to implement?
- What is transactions? Why do we need transaction? How to implement transaction?
- What is Partitioning ? Types of Partitioning ? Differences?
- What is Sharding in sql server?
- What are the various way to improve the performance of sql query and stored procedure?
Frequently asked Queries :
- 1. How to get Nth highest salary from employee table?
- 2. Department wise highest salary when 2 tables has given – Employee and Department.
- 3. List out EmployeeName with ManagerName from the given Employee Table.
- 4. Query which needs LIKE keyword.