Revision
5. Date and time data types - revision

Instruction

Good! Do you remember the types connected with date and time that you've learned?

You've learned DATE, TIME and DATETIME also known as TIMESTAMP, which is a combination of the two.

Exercise

The local university wants us to create a table with the dates of exams during the examination period.

Let's create a table called exam with the following colums:

  • exam_id (integer number),
  • lecture_id (integer number) and
  • date_time (a column with both the date and the exact time).

Stuck? Here's a hint!

Type

CREATE TABLE exam (
   exam_id int,
   lecture_id int,
   date_time timestamp
);

Console

Code editor

Result

TableConsole