Most commonly used SQL Server Data Types
In our previous blog, we have discussed about Flat Files. Giving a precise definition about Flat files:
Flat files are data files which give the table data. (Only Table Data Not Schema).
In this blog, we are going to discuss about the SQL Server Data Types.
Data Type: The term ‘Data Type’ describes what type of data a variable can hold. The type of data that a variable contains is called Data Type.
Note: In SQL Server, every variable and object must have a type.
Based on the variables storage characteristics in SQL Server, data types are categorized into 7 following types:
|SQL Server Data Type|
I. Exact Numeric Data Types: - are those that use integer data. An integer is a number with no fractional part; it can be positive, negative or zero.
II. Approximate Numeric Data Types: - are those that use floating point numeric data.
III. Date and Time Data Types: - are those that accept date and time values.
IV. Character Strings Data Type: - are string non-Unicode data type of either fixed length or variable length.
V. Unicode Character Strings Data Type: - are string Unicode data type of either fixed length or variable length.
VI. Binary Data Types: - are binary data type of either fixed length or variable length.
VII. Other Data Types: - remaining data type is counted in this category.
Note: You will find out how to use the data type while creating tables.
We are going to discuss every category in detail in our upcoming blogs. And how to use them with some real time practical examples.
For any query, comment us below.
Related Questions: -
Q-1 Which category does ‘nvarchar’ data type belongs to?
I) Character Strings Data Types
II) Unicode Character Strings Data Types
III) Binary Data Types
IV) Date and Time Data Types
Choose the correct option from below given alternatives:
A) Only I
B) Only II
C) II and III Both
D) I, III and IV
Ans- Option (B).
Explanation: ‘nvarchar’ belongs to Unicode Character Strings Data Types. It Unicode data and use the UNICODE UCS-2 character set.
Q-2 Which one of the following is invalid Date and Time Data Types?
Explanation: GETDATE() or getdate() is a non-deterministic function, which retrieves the current date and time based on the clock settings on the local system on which the instance of SQL Server is running.
Click imagination hunt to read latest blogs.
Keep learning and sharing...