cookies-icon

Our website uses cookies. By using this website, you agree to their use in accordance with the browser settings. You can modify your browser settings on your own. For more information see our Privacy Policy.

Course

Basic

Data Types in SQL

Choose the right type of data for your needs. A data type tells the database what kind of information a column will store. Learn about common data types in SQL Server, MySQL, Oracle, and PostgreSQL.

Table of contents

10 free interactive coding challenges

Lifetime access

B042DDD8-A1C9-4053-8AF3-463EB31543B8@2x

limited to this course only

$39

Buy now

Want a better deal?

B042DDD8-A1C9-4053-8AF3-463EB31543B8@2x

Get unlimited lifetime access to all 65 present and future courses

Save $450

Unlimited lifetime access

B042DDD8-A1C9-4053-8AF3-463EB31543B8@2x

to all 65 present and future courses

$149

$599

75% OFF

Buy now
Details
89

Interactive exercises

10 h

Estimated time

6897

Users enrolled

☆☆☆☆☆
★★★★★

635 ratings

Welcome to Data Types in SQL! This is the second course in the Creating Database Structure track. We assume that you already know how to create a table in SQL. If not, take The Basics of Creating Tables in SQL before you start this course.

Cover image for the course 'Data Types in SQL'

Data types are extremely important. A data type tells the database the kind of information (number, text, date, etc.) each column will store. It influences the functions and operations you can do on a column, how much space the column will take, how the database stores the data internally, and so on.

In this course, we will discuss the most basic data types and the primary differences between them. After you complete the exercises, you’ll know how to select the right data type for whatever information you want to store.

This interactive tutorial is based on standard SQL. But don't worry. The data types shown here will work in all popular relational database management systems, including SQL Server, MySQL, Oracle, and PostgreSQL.

Are you a beginning IT professional, computer science student, or database administrator (DBA)? Do you work as a programmer or developer? If you need to understand or work with data types in a relational database, this is the perfect course for you.

In Data Types in SQL, we discuss:

  • Text data types that can store short texts of variable length (VARCHAR) and predefined length (CHAR). We also talk about data types that store text files (TEXT, CLOB).
  • Numerical data types and the differences between integer types (INTEGER), floating point numbers (DOUBLE PRECISION), and decimal numbers (DECIMAL).
  • Identity columns and sequences, which auto-generate values and primary key identifiers (GENERATED ALWAYS BY DEFAULT, GENERATED ALWAYS BY DEFAULT AS IDENTITY).
  • Boolean and date/time data types, which are used to store true and false values (BOOLEAN) or date and time data (DATE, TIME, TIMESTAMP).
  • How to modify a column’s data type, e.g. when can you alter a column’s defined data type and what happens to the data when you do.

This course is interactive. You’ll learn how to work with different data types by writing real SQL commands and solving exercises directly in your web browser. Our platform runs your command and verifies your solution. You don’t need to install any software.

What Do You Need to Take This Course?

  • A web browser and an internet connection.
  • Knowledge of SQL, including SELECT, INSERT, UPDATE, and DELETE.
  • Basic understanding of the CREATE TABLE syntax.

This Course Will Teach You How To:

  • Choose the right data type for different columns.
  • Auto-generate column values with GENERATED ALWAYS.
  • Create a sequence.
  • Use sequences to auto-generate values.
  • How to alter tables and change column data types.

Who Should Take This Course?

  • Beginning developers and programmers
  • Beginning database administrators (DBAs)
  • Students taking classes in relational databases
  • Anyone who wants to understand the data types used in relational databases

Table of contents

Free

Paid content

0%

Course progress

0/89

Exercises completed

4.

Boolean, Date, and Time data types

How to store true/false information, and date and time information in your database.

0/14

6.

Final Quiz

Time to test your knowledge!

0/8

Reviews (0)

Average rating

4.68/5

☆☆☆☆☆
★★★★★

635 ratings

Details

5 stars

69%

4 stars

31%

3 stars

0%

2 stars

0%

1 stars

0%