The Choose Data Types module provides you with the instruction and server hardware to develop your hands on skills in the defined topics. This module includes the following exercises:

Learning Outcomes

In this module, you will complete the following exercises:

  • Exercise 1 - Work with Different Data Types

After completing this lab, you will be able to:

  • Store multiple data types in a table

Exam Objectives

The following exam objective is covered in this lab:

  • 1.2 Create database objects, choose data types

Lab Duration

It will take approximately 20 minutes to complete this lab.

Exercise 1 - Working with Different Data Types

While creating a table, you need to define the type of information that a column can hold such as characters, numbers, or dates. Defining a data type helps the system to know the type of data value allowed for each column as well as the storage size of the data. SQL Server provides you with a number of data types. You should choose the appropriate data type for the columns of a table to improve performance and the use of disk space efficiently. Some of the examples of the data types provided by the SQL Server 2016 include int, money, numeric, float, date, char, varchar, text, image, xml and so on.

Consider certain guidelines while you select data types for the columns of your table.

  • If you have a varying length data value for a column such as names, you can use varchar instead of char.
  • When you specify the tinyint data type for a column such as the book identifier, then you should not insert a book with a book number 256.
  • In general, to get the required level of precision for numeric data types use decimal data type.
  • For currency, use the money data type.

Learning Outcomes

After completing this exercise, you will be able to:

  • Store multiple data types in a table

Comprehensive Learning

See the full benefits of our immersive learning experience with interactive courses and guided career paths.