Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Your First Table
CREATE TABLE basics
7. CREATE TABLE with one column
Entity Relationship Diagrams (ERD)
Summary

Instruction

Oops! You did your job correctly, but as you may have noticed, the operation still failed. Why? Well, data types are very strict. If we have a column intended for number values, we can't insert text values there.

Okay, you are finally ready to learn how to create tables! Let's create a very simple table with one column that stores numbers. Take a look at the example:

CREATE TABLE airplane (id integer);

First, we put the keywords CREATE TABLE, after which we provide the name of the table. Then, inside parentheses, we write the name of the column, insert a space, and then specify the data type. The data type integer is a column type used to store integer numbers (like 4 or -157).

Exercise

It's time for you to practice. Create a table named result with one number column called score.

Stuck? Here's a hint!

Type:

CREATE TABLE result (
  score integer
);