Introduction
Numbers
Boolean
Date and time
Summary

Instruction

The calculations are now correct, excellent!

Before we move on to another data type, we've got a small exercise for you.

Exercise

Peter is really happy with his website and he decided to open a dedicated webstore with products for people who fell in love. Heart-shaped balloons, rings, fresh flowers - anything you can imagine. Let's create a table product for him. Take a look at the description below, decide on the data types and provide a suitable SQL statement.

Each product has an id which is an integer number and a name which is 64 characters long at most. It also has a description which can be of any length. We also need the price for each product (all of them cost below 300.00 dollars).

Stuck? Here's a hint!

Type

CREATE TABLE product (
    id int,
    name varchar(64),
    description clob,
    price decimal(5,2)
);

Console

Code editor

Result

TableConsole