Your first table
2. Insert some data
CREATE TABLE basics
Entity Relationship Diagrams (ERD)
DROP - how to remove a table

Instruction

Excellent! You have just created your first table! Its name is exhibit and it has the following columns: id, name, country, and production_year.

For now, our table is empty. Let's fill it up with some data. We have an entire course which deals with data insertion, modification and deletion, but here's a little reminder:

INSERT INTO exhibit VALUES (10, 'Doll', 'USA', 1995);

The above statements adds a new row to the table called exhibit with the values

  • 10 for column id,
  • 'Doll' for column name,
  • 'USA' for column country, and
  • 1995 for column production_year.
Note that we put quotes around text like 'Doll', but not around numbers like 1995. Remember to specify the values in this exact order - this is the same order in which we provided column names when creating the table.

Exercise

Peter has gathered a few toys already and he wants to insert them into the table exhibit. Help him add a Matryoshka with id 1. The toy comes from Russia and was produced in 1989.

Stuck? Here's a hint!

Type

INSERT INTO exhibit 
VALUES (1, 'Matryoshka', 'Russia', 1989);

Console

Code editor

Result

TableConsole