• 4 hours
  • Easy

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 2/3/21

Choose the Right Data Types for Your Data

Let's Review the Common Data Types

Now that we’ve had a look around at SQL Server Express Edition and how to create tables and work with scripts, let's refresh your memory on the data types we will be working with in our DBMS.

Text data can contain any kind of data, but you usually reserve data that you can perform calculations on for the other data types.

Numeric, or number, data values hold numbers in different formats such as currency, integer, and decimal.

Date/time values contain most any variation of date and time data.

Boolean values indicate a yes or no condition.

Select and Configure Data Types to Handle Expected Data

Data types are not one-size-fits-all, and they are customizable for the data you need to store. As a developer, you should take advantage of the ability to precisely store what you need.

SQL Server offers a number of options. For example, numeric data can contain integers or values with decimals.  You can customize the size of the values and whether or not decimal values are allowed (and to what size).  Those numeric data types include BigInt, Float, Numeric, Money, Small Int, Small Money, and Tiny Int. Let's have a closer look together:

Let’s Recap!

  • Data types define the type of data that can be stored in an attribute within a table.

  • Number stores numeric types of data.

  • Boolean stores only yes or no data.

  • Date/time stores various formats of date/time.

  • Text data is the most common, and stores most any kind of data.

Now that we've selected the right data types for the data we expect to collect and store in our database, let's ensure our database's integrity.

Example of certificate of achievement
Example of certificate of achievement