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

Instruction

Excellent! You have just created your first table! Its name is exhibit and it has the following columns: id, name, country, production_year, and acquisition_date. For now, our table is empty. Let's fill it up with some data. We have other courses which deal with data insertion, modification, and deletion, but here's a little piece of code to get you started:

INSERT INTO exhibit VALUES
(10, 'Doll', 'USA', 1995, '2007-02-21');

The above statement adds a new row to the table called exhibit with the values 10 for the column id, 'Doll' for the column name, 'USA' for the column country, 1995 for the column production_year, and '2007-02-21' for the acquisition_date.

Note that we put quotes around text like 'Doll' but not around numbers like 10. Remember to specify the values in this exact order, for this is the same order in which we provided column names while creating the table.

Exercise

Peter has already gathered a few toys, and he wants to insert them into the exhibit table. Help him add a Matryoshka with ID of 1. The toy comes from Russia, was produced in 1989, and was acquired by the museum on May 21, 2012.

Stuck? Here's a hint!

Type

INSERT INTO exhibit VALUES
(1, 'Matryoshka', 'Russia', 1989, '2012-05-21');