Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Numbers
Boolean
Date and time
Summary

Instruction

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

Our database, and any other database for that matter, has various number types of different ranges. INT is the most popular one, but if you need any other range, just check the documentation of your database.

Exercise

Peter wants to have a list of users who paid some money to get a premium account on his dating website. Create a simple table premium_account with a single integer column user_id.

Stuck? Here's a hint!

Type

CREATE TABLE premium_account (user_id int);