• 4 heures
  • Facile

Ce cours est visible gratuitement en ligne.



J'ai tout compris !

Mis à jour le 03/02/2021

Choose the Right Data Types for Your Data

Connectez-vous ou inscrivez-vous gratuitement pour bénéficier de toutes les fonctionnalités de ce cours !

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.

Exemple de certificat de réussite
Exemple de certificat de réussite