Published:
Last updated:

SQL

Authors
Time yourself:
Your progress:

00:30:00

0%

Filter by difficulty

52 of 52 questions shown

Basics of SQL

1. What are primary keys and foreign keys?

Junior
Flag important question
Mark as complete

2. Explain the difference between DDL, DML, DCL, and TCL.

Mid-level
Flag important question
Mark as complete

3. What are constraints in SQL?

Junior
Flag important question
Mark as complete

Data Retrieval

4. What is the difference between SELECT and SELECT DISTINCT?

Mid-level
Flag important question
Mark as complete

5. Why is it not recommended to use SELECT DISTINCT?

Mid-level
Flag important question
Mark as complete

Free preview complete

You’ve reached the end of the free preview

Get every remaining question and complete answer, plus progress tracking across the full Interview Question Library.

  • 47 more questions and complete answers in this topic
  • Full access to every interview topic
  • Progress tracking and question flags
  • New questions and improvements during your subscription

Full access from

$12/month

No long-term commitment. Cancel whenever you want.

6. What is the purpose of GROUP BY and HAVING?

JuniorPaid Question

7. What is the difference between LIMIT and OFFSET?

Mid-levelPaid Question

Joins and Relationships

8. What are the different types of joins in SQL?

JuniorPaid Question

9. Explain the difference between INNER JOIN and OUTER JOIN.

Mid-levelPaid Question

10. What is a self-join, and how is it used?

JuniorPaid Question

11. What are cross joins and natural joins?

JuniorPaid Question

12. How do you use multiple joins in a query?

Mid-levelPaid Question

Subqueries and Nested Queries

13. What is a subquery, and how is it used?

JuniorPaid Question

14. What is the difference between correlated and non-correlated subqueries?

Mid-levelPaid Question

15. Can you use subqueries in SELECT, FROM, or WHERE clauses?

Mid-levelPaid Question

16. What is an inline view?

JuniorPaid Question

17. What are scalar and multi-row subqueries?

JuniorPaid Question

SQL Functions

18. What is the purpose of the ROW_NUMBER() function?

JuniorPaid Question

19. What are aggregate functions in SQL, and how are they used?

JuniorPaid Question

20. How do you use string functions like CONCAT and SUBSTRING?

Mid-levelPaid Question

21. What are date and time functions in SQL?

JuniorPaid Question

22. Explain the purpose of mathematical functions in SQL.

JuniorPaid Question

Data Modification

23. What is the difference between DELETE, TRUNCATE, and DROP?

Mid-levelPaid Question

24. How do you handle upserts in SQL?

Mid-levelPaid Question

Indexes and Performance

25. What is an index, and how does it improve performance?

Mid-levelPaid Question

26. What are the types of indexes in SQL?

Mid-levelPaid Question

Indexes and Performance

27. What is a clustered index, and how is it different from a non-clustered index?

Mid-levelPaid Question

28. How do you analyze and optimize a query using EXPLAIN or EXPLAIN PLAN?

SeniorPaid Question

29. What are common performance optimization techniques in SQL?

Mid-levelPaid Question

Transactions and Concurrency

30. What is a transaction in SQL, and how do you use it?

Mid-levelPaid Question

31. Explain the four isolation levels in SQL.

Mid-levelPaid Question

32. What is a deadlock, and how do you resolve it?

SeniorPaid Question

Database Design and Normalization

33. What is normalization, and why is it important?

JuniorPaid Question

34. Explain the different normal forms (1NF, 2NF, 3NF, BCNF).

Mid-levelPaid Question

35. What is denormalization, and when should it be used?

JuniorPaid Question

36. What are database relationships (one-to-one, one-to-many, many-to-many)?

JuniorPaid Question

37. What is the purpose of surrogate keys?

JuniorPaid Question

Advanced Topics

38. What is a view, and how is it used?

Mid-levelPaid Question

39. What are stored procedures and functions in SQL?

Mid-levelPaid Question

40. What are triggers, and how do they work?

Mid-levelPaid Question

41. Explain the difference between a materialized view and a regular view.

Mid-levelPaid Question

42. What are common SQL extensions (e.g., PL/SQL, T-SQL)?

Mid-levelPaid Question

Security

43. What are SQL injections, and how do you prevent them?

Mid-levelPaid Question

44. How do you manage user privileges in SQL?

Mid-levelPaid Question

45. What is row-level security in SQL?

Mid-levelPaid Question

46. How do you encrypt data in SQL?

Mid-levelPaid Question

47. Explain the role of roles and grants in SQL security.

Mid-levelPaid Question

Working with NoSQL and Newer Features

48. How do you work with JSON data in SQL?

Mid-levelPaid Question

49. What are window functions, and how do they work?

Mid-levelPaid Question

50. What is Common Table Expression (CTE)?

JuniorPaid Question

51. How do you work with recursive queries in SQL?

Mid-levelPaid Question

52. Explain the purpose of partitioning in SQL.

JuniorPaid Question