---json { "aliases": [ { "path": ":howto:database:tabul_load_generated_data" } ], "description": "This how-to will show you how to fill a table with auto-generated data and the Tabul fill action.", "low_quality_page": "false", "name": "Fill a table with Auto Data Generation", "page_id": "jdsfx82vgfkzalqpn6pcm" } --- ====== SQLite - How to fill a table with auto generated data ====== ===== About ===== This [[..:howto|how-to]] will show you how to [[docs:op:fill|fill]] a [[docs:resource:sql_table|table]] with auto-[[docs:generator:generator|generated data]] and the [[docs:tabul:data:fill|Tabul fill action]]. ===== Steps ===== ==== Prerequisites ==== You should have ''Tabulify'' installed on your computer. [[howto:getting_started:1_install]] tabul data drop *@sqlite ==== Create the target table ==== For the purpose of this ''how-to'', we will work with the ''date_dim'' [[docs:system:tpcds|TPC-DS]] table. tabul data create date_dim@tpcds @sqlite Results of the create operation input target -------------- --------------- date_dim@tpcds date_dim@sqlite ==== Fill the date_dim table with 10 rows ==== With the [[docs:tabul:data:fill|tabul data fill operation]], insert ''10'' rows automatically generated into the [[docs:resource:sql_table|table]] ''date_dim'' tabul data fill --max-record-count 10 date_dim@sqlite Transfer results input target latency record_count error_code error_message --------------- --------------- ------- ------------ ---------- ------------- date_dim@memgen date_dim@sqlite 0.54s 10 ==== Check the result ==== With the [[docs:tabul:data:print|data print command]], we can see the content of the ''date_dim'' table in the [[docs:connection:howtos|sqlite connection]] tabul data print date_dim@sqlite date_dim@sqlite d_date_sk d_date_id d_date d_month_seq d_week_seq d_quarter_seq d_year d_dow d_moy d_dom d_qoy d_fy_year d_fy_quarter_seq d_fy_week_seq d_day_name d_quarter_name d_holiday d_weekend d_following_holiday d_first_dom d_last_dom d_same_day_ly d_same_day_lq d_current_day d_current_week d_current_month d_current_quarter d_current_year --------- --------- ---------- ----------- ---------- ------------- ------ ----- ----- ----- ----- --------- ---------------- ------------- ---------- -------------- --------- --------- ------------------- ----------- ---------- ------------- ------------- ------------- -------------- --------------- ----------------- -------------- 1 a 2025-10-12 9 7 2 7 6 8 5 5 6 8 4 m r q d g 7 8 4 2 g k x f v 2 b 2025-10-13 8 6 4 2 3 4 8 6 0 2 1 s p p c z 10 9 5 1 b s k s r 3 c 2025-10-11 1 6 8 3 1 3 9 1 9 7 8 w i q c e 10 1 3 3 z j h n h 4 d 2025-10-11 7 0 1 9 5 10 6 3 3 0 1 r r a b n 9 2 3 4 p a z k z 5 e 2025-10-15 4 0 10 1 5 4 0 2 7 5 4 k r y m v 10 3 5 0 o p o f v 6 f 2025-10-15 7 10 2 0 9 9 3 6 6 2 2 m u u b l 9 9 1 0 a e o t b 7 g 2025-10-10 6 6 10 8 1 8 9 8 0 0 10 q i o y m 10 9 10 8 l h x x b 8 h 2025-10-18 6 5 10 7 10 6 3 2 5 7 5 o x d z s 3 8 3 7 s q r w d 9 i 2025-10-14 9 9 2 7 0 1 7 8 4 4 3 m d s b g 1 9 10 5 u u f g p 10 j 2025-10-20 3 7 3 10 0 2 9 3 3 1 5 x w h q j 10 2 1 6 t d y y m ==== Fill the ''date_dim'' table with ''10.000'' rows ==== tabul data fill --max-record-count 10000 date_dim@sqlite Transfer results input target latency record_count error_code error_message --------------- --------------- ------- ------------ ---------- ------------- date_dim@memgen date_dim@sqlite 0.588s 10000 ==== Check the result ==== And we got ''10.000'' rows tabul data list -a count date_dim@sqlite path media_type count -------- ---------- ----- date_dim table 10000 ==== Next ==== The generated data follows a default definition but you can define the generated data that you want with the help of a ''data definition'' file. [[howto:sql_table:defined_generated_data|Learn how to fill a table with defined generated data]]