Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Your first table
Text data types
Summary

Instruction

Good. Just as you'd expect, we can't enter a value that's longer than the defined limit into a char(x) column.

We're now going to introduce another text data type. Depending on the database, it's called text or clob. However, both names refer to the same data type. This data type is used to store text information of any length. You can store one word or 1,000 words in such a field.

In this course, we're using a PostgreSQL database, which supports text but not clob. We'll use text throughout this course. Remember to always check your database documentation to find out what data types it supports.

Exercise

Peter decided that the old table user_account was not enough and that the 10-character-long nicknames didn't really work. What's more, he wants users to describe themselves!

Let's create a new user_account table with the following columns:

  • first_name of the type varchar(32).
  • nickname of the type varchar(32).
  • description of the type text.