There is a table in sqlite: Name Quantity Price There is the same table in excele. The question is how from the excel table to import all the data into the database using sql query.
2 answers
- Save file as csv
- Use the .import command:
List item
.separator ","
.import excel_file.csv your_table
More details:
|
You can also write a function in Excel that will create a SQL query.
Type
=CONCATENATE("INSERT INTO [table] (name, price, qty) VALUES ('", A1, "', ", B1, ", ", C1, ");") Paste it into all the rows in the table in Excel. Then the result of copy-paste in phpMyAdmin (or that you use to manage the database) and run.
This is not the best option, of course. But sometimes it is faster than other options. Especially if you have a table of three columns just ...
|