vtcbca / csv-file-program-23bca312

23bca-python-sqlite-csv-file-program-303-Python-Programming- created by GitHub Classroom
0 stars 0 forks source link

Do not understand program. #2

Open 23bca312 opened 2 months ago

23bca312 commented 2 months ago

I understand how to create and insert record from sqlite3 but how to export table in csv file?

Please explain and help me to solve this problem.

23bca307 commented 2 months ago

to export table into csv file use dump command

23bca312 commented 2 months ago

How to apply dump command.

23bca307 commented 2 months ago

.dump > .csv

This is the syntax but replace the content written in < > . i am not sure but try this solution.

23bca261 commented 2 months ago

to export table data into csv file , you have to use .output command.

23bca312 commented 2 months ago

Please explain with example.

23bca261 commented 2 months ago

ok.. let me explain you...!!!

for example your table name is stud. and you want to export its data into "stud.csv" file. you have to enter below command.

.mode column .mode csv .output stud > stud.csv

23bca312 commented 2 months ago

Is this command is given after creating insert command.

23bca261 commented 2 months ago

yes... you have to apply this command after creating and inserting record.

one main point is after giving above command, write select query.

select * from stud.