Section 1 - Instruction

Last time we learned about database hierarchy. Now let's explore what types of information can actually be stored in those columns.

Just like you wouldn't store phone numbers in your calendar app, database columns have specific data types that determine what kind of information they can hold.

Engagement Message

Why might it matter what type of data goes in each column?

Section 2 - Instruction

Numeric data types store numbers. There are two main categories: integers (whole numbers like 42, 100, -5) and decimals (numbers with decimal points like 19.99, 3.14159).

Integers take less storage space, while decimals can represent precise measurements and prices.

Engagement Message

Would you use an integer or decimal to store a book's price?

Section 3 - Instruction

Text data types store words, sentences, and characters. The most common are VARCHAR (variable-length text up to a limit) and TEXT (for longer content).

VARCHAR(50) can hold up to 50 characters, while TEXT can hold thousands of characters like full book descriptions.

Engagement Message

Which text type would work better for storing customer names?

Section 4 - Instruction

Date and time types store when something happened. DATE stores just the day (like 2024-03-15), while DATETIME includes the exact time (2024-03-15 14:30:22).

These types enable powerful date calculations and sorting by chronological order.

Engagement Message

Would you use DATE or DATETIME to track when customers place orders?

Section 5 - Instruction

Boolean types store simple TRUE or FALSE values. Perfect for yes/no questions like "Is this book available?" or "Has this customer subscribed to emails?"

Many databases represent boolean as 1 (true) or 0 (false).

Engagement Message

What boolean column might be useful in a customer table?

Section 6 - Instruction
Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal