Inserting data with INSERT

Add data to the table using INSERT INTO:

Note

We assume that you already created tables in step Creating a table and populated them with data in step Adding data to a table.

  1. INSERT INTO episodes
  2. (
  3. series_id,
  4. season_id,
  5. episode_id,
  6. title,
  7. air_date
  8. )
  9. VALUES
  10. (
  11. 2,
  12. 5,
  13. 21,
  14. "Test 21",
  15. CAST(Date("2018-08-27") AS Uint64)
  16. ), -- Rows are separated by commas.
  17. (
  18. 2,
  19. 5,
  20. 22,
  21. "Test 22",
  22. CAST(Date("2018-08-27") AS Uint64)
  23. )
  24. ;
  25. COMMIT;
  26. -- View result:
  27. SELECT * FROM episodes WHERE series_id = 2 AND season_id = 5;
  28. COMMIT;

Inserting data with INSERT - 图1