Tech Point Fundamentals

Tuesday, July 27, 2021

SQL Interview Questions on Unicode and Non-Unicode Data Types

SQL Interview Questions on Unicode and Non-Unicode Data Types

SQL-Interview-Questions-2021-Data-Types-And-Collation

In SQL LEN() function returns the number of characters of the specified string expression, excluding trailing blanks but the DATALENGTH() function returns the number of bytes used to represent any string expression. The size represents the no of bytes, not the no of characters for all the SQL UNICODE and NON-UNICODE string data types. 


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




Below are some common interview questions based on the SQL Unicode and Non-Unicode Data Types:


Q01. What is the difference between LEN() and DATALENGTH() in SQL?

Q02. What is the difference between CHAR and VARCHAR data types in SQL?

Q03. What is the difference between CHAR and NCHAR data types in SQL?

Q04. What is the difference between VARCHAR and NVARCHAR data types in SQL?

Q05. What does the size 'n' define in CHAR(n) or VARCHAR(n) and NCHAR(n) and NVARCHAR(n) data types?



Q06. What is Collation and how it affects the data storage size?

Q07. Is the declaration of a field with VARCHAR(8500) is valid in SQL? 

Q08. What is the difference between VARCHAR(n) and VARCHAR(MAX) in SQL?

Q09. Which data type can be used to store Unicode Strings in SQL?

Q10. How many characters can be stored in Varchar(10) and Nvarchar(10) data type fields?

Q11. Can you define a field as CHAR(MAX) in SQL?

Q12. Can you create a Clustered Index on a column that is of VARCHAR(MAX) data type?

Q13. Which data type uses the LOB(Large Object) page to store the data? What can be the maximum size of LOB?



Q14. Why only a maximum of 8000 sizes can be stored in any Non-Unicode string data type in SQL?

Q15. What is the difference between fixed-length data type and variable-length data type?

Q16. Why the max size of a VARCHAR data type is only 8000 in SQL?

Q17. Why the max size of an NVARCHAR data type is only 4000 in SQL?

Q18. What is the difference between NVARCHAR(n) and NVARCHAR(MAX) in SQL?

Q19. Can you create an Index on a VARCHAR(MAX) or NVARCHAR(MAX) data type column?

Q20. Can you create a PRIMARY Key on a VARCHAR(MAX) or NVARCHAR(MAX) data type column? Why?

Q21. Can you create UNIQUE Key on a VARCHAR(MAX) or NVARCHAR(MAX) data type column? Why?

Q22. Can you create on Non-Clustered Index on a VARCHAR(MAX) or NVARCHAR(MAX) data type column? Why?





Live Demo





Watch our related videos here




Recommended Articles


Most Frequently asked 100+ SQL Interview Questions
Derived Table (DT) Interview Questions
Table Variable (TV) Interview Questions
Table Valued Type (TVT) Interview Questions
Common Table Expression(CTE) Interview Questions
Temp Table Interview Questions





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.