
create table comp_worker(worker_id integer primary key, worker_name text not null, worker_age text, worker_address text, worker_salary text)

Now let’s see the different examples of export to csv for better understanding as follows.įirst, we need to create the new table by using the following statement as follows. The dot command is deciphered by the sqlite3.exe order line program, not by SQLite itself. As such, a dot command can’t happen at a continuation brief. A dot command can’t happen in a standard SQL statement.The dot command should be completely contained on a solitary info line.A dot command should start with the “.” at the left edge with no previous whitespace.However, speck orders are more prohibitive: Normal SQL statements are freestyle, and can be spread across various lines, and can have whitespace and remarks anyplace. Issue the query to select information from the table to which you need to export.In the third step, we need to send the output to a specified CSV file.After that, we need to set the output mode of the file that is csv mode.Enable the header by using the dot command that means the.To export data into the csv file, we need to follow some steps as follows. Now let’s see how we export the table into the csv file in SQLite as follows. The last query actually writes the content by using the select clause. once: It is used to write content into the csv by using this command, and it also contains the path of the csv file that means where we need to store the csv file.

mode csv: After that, we need to enable the csv mode by using the above-mentioned command.
