August 2017
Intermediate to advanced
214 pages
4h 31m
English
We start by inserting a dummy value into our temperature table:
INSERT INTO temperature VALUES (datetime('now'), 16.7);
This is standard SQL syntax, where we direct SQLite to insert the current datetime and dummy value of 16.7 into our temperature table. The order of values should be the same as the order of columns defined in our CREATE TABLE statement from before.
The datetime function is specific to SQLite. Based on its arguments, it returns the datetime in a number of formats. When we call this function with the argument of now, it returns the current date and time at the moment of calling the datetime function in the ISO string format (for example, 2017-06-18 12:13:50).
Read now
Unlock full access