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

Instruction

Excellent! Now, if you want to insert more than one column in your table, just use commas between them:

CREATE TABLE airplane (
  id integer,
  max_passengers integer,
  production_date date
);

As you may have figured out, we've added two columns:

  1. max_passengers, an integer-type column, and
  2. production_date, a date-type column.
    Remember that the format is 'year-month-day' and not 'year-day-month', which is commonly used in the US.

Exercise

Let's create a more sophisticated version of the previous table. Create a table named result with two integer columns: id and score, and one column with the type date: score_date.

Stuck? Here's a hint!

Type:

CREATE TABLE result (
  id integer,
  score integer,
  score_date date
);