SQL Interview Questions!
Basic SQL Interview Questions:
What is SQL?
What are the different types of SQL commands?
What is the difference between DDL, DML, DCL, and TCL?
What is the difference between SQL and MySQL?
What is a primary key?
What is a foreign key?
What is a unique key?
What is the difference between primary key and unique key?
What is the difference between HAVING and WHERE?
What are constraints in SQL? Name a few.
What is the difference between CHAR and VARCHAR?
What is Normalization? What are its types?
What is Denormalization?
What is an index in SQL?
What are the different types of indexes?
What is the difference between Clustered and Non clustered indexes?
What is an alias in SQL?
What is the difference between DELETE and TRUNCATE?
What is the difference between TRUNCATE and DROP?
What is a view in SQL?
Intermediate SQL Interview Questions:
What is a self join?
What is an inner join?
What is the difference between INNER JOIN and OUTER JOIN?
What are the types of OUTER JOIN?
What is a cross join?
What is a Cartesian join?
[Link]
What is the difference between UNION and UNION ALL?
What is the difference between JOIN and UNION?
What is a stored procedure?
What is a trigger in SQL?
What are the different types of triggers?
What is the difference between HAVING and GROUP BY?
What are subqueries?
What are correlated subqueries?
What is an EXISTS clause in SQL?
What is the difference between EXISTS and IN?
What is a cursor in SQL?
What is the difference between OLTP and OLAP?
What are ACID properties in SQL?
What is normalization? Explain 1NF, 2NF, 3NF, and BCNF.
What is a composite key?
What is a surrogate key?
What is the use of the COALESCE function?
What is the difference between IS
NULL and IS NOT NULL?
What is partitioning in SQL?
Advanced SQL Interview Questions:
What are window functions in SQL?
What is CTE (Common Table Expression)?
What is the difference between TEMP TABLE and CTE?
What is the difference between RANK(), DENSE_RANK(), and ROW_NUMBER()?
What is a materialized view?
What is the difference between materialized views and normal views?
What is sharding in SQL?
What is the MERGE statement?
What is the JSON data type in SQL?
[Link]
What is recursive CTE?
What is the difference between LEFT JOIN and LEFT OUTER JOIN?
How does indexing impact performance?
What is the difference between OLAP and OLTP?
What is ETL (Extract, Transform, Load)?
What are window functions? Explain LEAD, LAG, and NTILE.
What is a pivot table in SQL?
What is Dynamic SQL?
What is a NoSQL database? How is it different from SQL databases?
What is the difference between SQL and PL/SQL?
How to find the N th highest salary in SQL?
Practical SQL Queries:
Find the second highest salary from an Employee table.
Find duplicate records in a table.
Write a SQL query to find the count of employees in each department.
Write a query to find employees who earn more than their managers.
Write a query to fetch the first three characters of a string.
Write a SQL query to swap two columns in a table without using a temporary table.
Write a query to find all employees who joined in the last 6 months.
Write a query to find the most repeated values in a column.
Write a query to delete duplicate rows from a table.
Write a SQL query to find all customers who made more than 5 purchases.
[Link]