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)
DROP - how to remove a table

Instruction

Ooops! You did your job right, but as you can see, the operation 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 which stores numbers. Take a look at the example:

CREATE TABLE airplane (id int);

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, put a space and then specify the data type. The data type int is short for integer - this column type is 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 int
);