I want to use mathematica to analyze some data of sqlite?
But i don't know how to do that .
And I'm not sure whether mathematica support the data of sqlite.
You can export the structure and contents to a . sql file that can be read by just about anything. File > Export > Database to SQL file. Technically, the SQLite shell is not SQLite but a console application linked to SQLite which only is a library.
The . dump command converts the entire structure and data of an SQLite database into a single text file. By default, the . dump command outputs the SQL statements on screen. To issue the output to a file, you use the .
Apparently, SQLite support is already available in Mathematica though it is undocumented. As such, proceed carefully!
Open a database with:
db = Database`OpenDatabase["thefilename.sqlite"]
Then run SQL statements with:
results = Database`QueryDatabase[db, "SELECT foo FROM bar WHERE boo = ?", { "some string" }]
That should be enough for you to get going. (You have to pull data into Mathematica from the database to analyze it; nothing can be done while it is just “at rest” on disk. If you're doing complex analyses, it might be worth your while to put some of that in the SQL queries, especially if there are sensible indices set on the database.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With