Tech Point Fundamentals

Tuesday, July 20, 2021

Most Frequently Asked SQL Interview Questions

Most Frequently Asked SQL Interview Questions 

Most-Frequently-Asked-SQL-Interview-Questions-2021

Are you preparing for your SQL Developer Interview? Here you can find the Top SQL Interview Questions. The Most Common SQL Interview Questions list for both freshers and experienced involves a lot of topics like creating database schema, SQL query, procedure, trigger, function, constraints, joins, etc.  


You can visit my YouTube Channel for SQL Interview Questions and Answers videos by the below link:


Watch SQL Interview Questions and Answers videos here.




Below are the Most Frequently Asked SQL Interview Questions list for both freshers and experienced:


Q01. What do you understand by Normalization in SQL?

Q02. What are the different normal forms in SQL?

Q03. What is De-Normalization and why do we need it?

Q04. What is the 8KB Page Concept in SQL?


Please watch the SQL 8KB Page video here.


Q05. What is Heap in SQL?


Please watch the HEAP vs Clustered Table video here.


Q06. What is the difference between Table Scan and Index Scan?

Q07. What is the SQL Profiler?

Q08. What is an SQL Server Agent?

Q09. What are the MASTER and TEMPDB databases? What is the use of these databases?

Q10. Which TCP/IP port does SQL Server run on? How can you change it?



Q11. What is a Linked Server? How can you create it?

Q12. What are the different authentication modes in SQL Server?

Q13. What is Collation in SQL, how it affects the database?


Please watch how the collation affects the data storage and SQL logic by the LEN vs Datalength video here


Q14. What is Constraint in SQL Server? What are the different types of Constraints available in SQL Server?

Q15. What is CHECK Constraint in SQL Server?

Q16. What is the Primary Key Constraint in SQL Server?


Please watch the PRIMARY KEY video here.


Q17. What is Foreign Key Constraint in SQL Server?


Please watch the FOREIGN KEY video here.


Q18. What is the difference between Primary Key and Unique Key?


Please watch the PRIMARY KEY vs. UNIQUE KEY video here.


Q19. What is the difference between Unique Key and Unique Index?


Please watch the PRIMARY KEY vs. UNIQUE KEY video here.

Q21. What is the difference between Primary Key and Clustered Index?


Please watch the PRIMARY KEY video here and CLUSTERED INDEX video here.


Q22. What is an index and what are the different types of available indexes in SQL?

Q23. What is the difference between a Clustered Index and a Non-Clustered Index in SQL Server?


Please watch the Clustered vs Non-Clustered Index video here.


Q24. What is the difference between VARCHAR and CHAR datatypes?

Q25. What is the difference between VARCHAR and NVARCHAR datatypes?

Q26. What is the use of DBCC commands?

Q27. What is a NULL value in SQL Server?


Please watch the SQL NULL Value video here. and SQL Three Valued Logic video here.


Q28. What is the difference between DELETE and TRUNCATE command?


 Please watch the DELETE vs TRUNCATE video here.


Q29. What is the difference between the WHERE clause and HAVING clause in SQL Server?


Please watch the WHERE vs HAVING clause video here.


Q30. What is sub-query? What are the different types of sub-query in SQL?


 Please watch the sub-query video here.



Q31. What is the use of the LIKE keyword in SQL?

Q32. What is the difference between ISNULL() and COALESCE() function?


 Please watch the ISNULL vs COALESCE video here.


Q33. What is the difference between COUNT(*), COUNT(<column-name>), and COUNT(1) in SQL?


Please watch the Count(*) vs Count(col)  video here.


Q34. What is the difference between UNION and UNION ALL in SQL?


Please watch the UNION vs UNION ALL video here.


Q35. What is the difference between @@IDENTITY, SCOPE_IDENTITY(), and IDENT_CURRENT() in SQL?



Q36. What is a Temporary Table in SQL?


Please watch the Temp Table video here.


Q37. What is the difference between Dirty Read and Phantom Read in SQL?

Q38. What is the use of WITH NOLOCK hint in SQL?

Q39. What does it mean to have QUOTED_IDENTIFIER ON in SQL?


Please watch the SET QUOTED_IDENTIFIER ON flag video here.


Q40. What is Join in SQL Server? What are the different types of JOINS available in SQL?


Please watch the INNER JOIN video here, LEFT OUTER JOIN video here,   RIGHT OUTER JOIN video here, FULL OUTER JOIN video here, CROSS JOIN   video here, and SELF JOIN video here.



Q41. What is the difference between FULL JOIN and CROSS JOIN in SQL?


Please watch the FULL JOIN vs CROSS JOIN video here.


Q42. What is Self JOIN in SQL? How it is different from INNER JOIN?


Please watch the SELF JOIN video here and the INNER JOIN video here.


Q43. What is the difference between Stored Procedure and Function in SQL?

Q44. Can you use DDL or DML commands in SQL functions?

Q45. Can you call a stored procedure from a function in SQL?



Q46. What is View in SQL and what are the different types of view in SQL?

Q47. Can you add the Primary Key or Index in the View? Which types of indexes can be created in the views?

Q48. Can you Update or Delete the records from View? How?

Q49. What do you understand by Schema Bound view?

Q50. What is a Trigger and what is the use of Trigger in SQL? What are the different types of Triggers?



Q51. What are the MAGIC TABLEs used by Triggers in SQL Server?

Q52. What are the INSERTED and DELETED tables in SQL and what is the use of these tables? How you can access these tables?

Q53. What is the use of the OUTPUT clause in SQL?

Q54. What is a Transaction in SQL?

Q55. What is TCL (Transaction Control Language) in SQL and what are different commands of it?

Q56. What are ACID properties in SQL?

Q57. What is the difference between COMMIT and SAVE transactions in SQL?

Q58. What is concurrency in SQL and what are the different Concurrency Modes available in SQL?

Q59. What is LOCK in SQL? What are the different types of Locks in SQL?

Q60. What is a Deadlock in SQL? How can you check and prevent Deadlock?



Q61. What is the Cursor? How can you avoid cursor?

Q62. What is the difference between Loop and Cursor?

Q63. What is a SQL Sequence?

Q64. What is the difference between IDENTITY and Sequence in SQL?

Q65. How can you Handle Exceptions in SQL? Can you use the TRY/CATCH block in SQL?

Q66. What is the difference between the RAISERROR function and the throw statement?



Q67. What is the difference between LEN() and DATALENGTH() function?


Please watch the LEN vs DATALENGTH video here.


Q68. What is the difference between ROW_NUMBER(), RANK(), and DENSE_RANK() in SQL?


Please watch the ROW_NUMBER vs RANK vs DENSE_RANK video here.


Q69. How will you get the 3rd highest salary in SQL?


Please visit this article for different ways to get the 3rd highest salary in SQL. You can also watch the video for the same here.


Q70. How can you delete the duplicate records from a table?

 
Please watch the different ways to remove Duplicate Records video here.

Please watch the CTE video here and the DT video here checking and deleting the duplicate records in SQL.


Q71. How can you update the records of a table based on other table values?

Q72. How can you get the last inserted record id in SQL?

Q73. What is Common Table Expression or CTE in SQL?


Please watch the Common Table Expression (CTE) video here.


Q74. What is Derived Table or DT in SQL? How DT is different from Common Table Expression or CTE in SQL?


Please watch the Derived Table (DT) video here.


Q75. What is the difference between the Cast() and Convert() functions in SQL?



Q76. What is PIVOT Function in SQL?

Q77. What is the main difference between IN() and NOT IN() operators in SQL?


Please watch the IN() vs NOT IN() operator video here.


Q78. What is the difference between SQL INTERSECT and EXCEPT operator?


Please watch the INTERSECT vs EXCEPT operator video here.


Q79. What does it mean to have ANSI_NULL ON or OFF in SQL?

Q80. What does it mean to have ANSI_PADDING ON or OFF in SQL?


Please watch the ANSI_NULLS and ANSI_PADDING set options video here.




Q81. How you can improve the performance of a query or stored procedure?

Q82. What is the difference between Table Variable and Temp Table in SQL?


Please watch the SQL Table Variable video here.


Q83. What is the CASE statement in SQL? Can you use the CASE statement in the WHERE clause?

Q84. What is Table-Valued Type (TVT) or User Defined Table Type (UDTT) in SQL? Why do we need it?


Please watch the SQL Table Valued Type video here.


Q85. How can you delete a record from a table which is being referenced by a Foreign Key in SQL?



Q86. How an Inline Table-Valued Functions is different from Scalar Valued Functions?

Q87. What is SQL Type in SQL? How a Scalar Valued Type is different from a Table-Valued Type?

Q88. What is the difference between ON Clause and WHERE clause in SQL?


Please watch the ON clause vs WHERE clause video here.


Q89. What is the difference between INNER JOIN and IN() clause?


Please watch the INNER JOIN vs IN() clause video here.


Q90. What is the difference between ISNULL(), COALESCE(), and IFNULL() in SQL?


Please watch the ISNULL vs COALESCE vs IFNULL video here.



Q91. What is Dynamic SQL Query(D-SQL) in SQL?

Q92. What is SQL Injection, how can you prevent SQL Injection attacks?

Q93. What is the difference between EXECUTE() and sp_executesql() in SQL?

Q94. What is the difference between Unicode and Non-Unicode data types in SQL?

Q95. Can you give me some Real Use Cases of Dynamic SQL Query?



Q96. What is SQL Three Valued Logic? How does it affect the program logic?


Please watch the SQL Three Valued Logic video here.


Q97. What is Co-Related SubQuery? How can you get the 3rd highest salary using it?


Please watch the Co-Related SubQuery video here.


Q98. What is the difference between GO and Semicolon(;) Statement Terminator in SQL?


Please watch the GO vs Semicolon statement terminator video here.


Q99. What is the use of the UPDATE_STATISTICS command in SQL?

Q100.What is the SQL Bulkcopy command? When it can be used?

Q101.How can you copy the data from one table to another table?





Watch our related videos here




Recommended Articles


Most Frequently Asked C# Interview Questions

Derived Table (DT) Interview Questions
Table Variable (TV) Interview Questions
Common Table Expression(CTE) Interview Questions
Temp Table Interview Questions
Partial Interface Methods in C# 8
Interface Member Modifiers in C# 8
Multiple Interface Inheritance in C# 8
Interface Virtual Method in C# 8
Interface Access Modifiers in C# 8





Thanks for visiting this page. Please follow us on Twitter, Facebook, LinkedIn, Telegram, WhatsApp, Youtube, and Pinterest for regular updates.

No comments:

Post a Comment

Please do not enter any HTML. JavaScript or spam link in the comment box.