Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Numerical data types
Integer data types
2. integer
Floating point data types
Decimal data types
Summary

Instruction

Let's start off with a data type you already know – integer. As you can expect, this data type stores integer or whole numbers (like 3, 7, or -4). We use it to count things like chairs, books, legs, etc. In our database, the integer type can store whole numbers from -217483648 to 217483647.

Our database has various numeric data types that can store values of different ranges. integer is the most popular type, but if you need a greater range, just check the documentation of your database.

Exercise

Peter wants to have a list of users who paid to get a premium account on his dating website. Create a simple table named premium_account that has a single integer column called user_id.