SQL Server Interview Topic 31: Data Types Deep Dive
This topic checks whether you can choose correct data types. Wrong data types create bugs, storage waste, and reporting problems.
You should be able to choose data types for common application fields and explain why.
Q190. When do you use INT and BIGINT?
Quick interview answer:
Use INT for normal whole numbers like ids and counts. Use BIGINT only when values can become very large. Do not use bigger types without a reason.
Study in detail: Data Types - This lesson explains number types.
Q191. DECIMAL vs MONEY: what do you prefer?
Quick interview answer:
DECIMAL is usually preferred for exact numeric values because precision and scale are clear. For fees or amounts, DECIMAL(18,2) is common. Follow project standards if they already exist.
Study in detail: Data Types - This article explains decimal values.
Q192. VARCHAR vs NVARCHAR: what is the difference?
Quick interview answer:
VARCHAR stores non-Unicode text. NVARCHAR stores Unicode text and supports many languages. For names and addresses in Indian applications, NVARCHAR is often safer.
Study in detail: Data Types - This lesson explains text types.
Q193. DATE vs DATETIME: when do you use each?
Quick interview answer:
Use DATE when only the date is needed, such as date of birth. Use DATETIME or similar date-time types when time is also needed, such as created date or payment time.
Study in detail: Data Types and Date Functions - These lessons explain date usage.
Q194. What is BIT used for?
Quick interview answer:
BIT stores true or false style values, usually 1 or 0. It is useful for fields like IsActive, IsDeleted, or IsPaid.
Study in detail: Data Types - This article explains Boolean-style values.
For data type answers, mention the business meaning of the column. That shows design thinking.