Master Using SQL with Python: Lesson 11 - Using JSON with SQLite

  Рет қаралды 12,778

Bryan Cafferky

Bryan Cafferky

Күн бұрын

Пікірлер: 31
@danmisener
@danmisener 2 жыл бұрын
Thanks for making this video, Bryan. It's the clearest example of working with JSON in SQLite using Python I've seen! Much appreciated!
@BryanCafferky
@BryanCafferky 2 жыл бұрын
Glad it helped!
@user-lg4le8xr4s
@user-lg4le8xr4s 10 ай бұрын
Definitely would like more videos working with both JSON and REGEX in SQL
@BryanCafferky
@BryanCafferky 10 ай бұрын
Yeah. Good topics! Thanks
@notterboutuyer2781
@notterboutuyer2781 Жыл бұрын
i definitely like to see more about the json usage in sqlite/postgres with python. especially using twitter api v2. thanks for the series. it really helps. best.
@michaeleidson9210
@michaeleidson9210 2 жыл бұрын
Thanks Bryan! Add my vote to doing more sessions with Python/JSON --> into SQL Server, SQLite, & even Snowflake if you have the time!!! Thanks again for your great series!
@georgwagner5577
@georgwagner5577 3 ай бұрын
I used to work with pandas - I hate it. Time to switch :) Thank you, I love your guidance.
@sherlockholmes676
@sherlockholmes676 2 жыл бұрын
exactly what I needed. Thanks Bryan!
@BryanCafferky
@BryanCafferky 2 жыл бұрын
YW. Check out the whole series. I think you may find it useful.
@OrigamOx
@OrigamOx 3 жыл бұрын
Thank you very much. Your explanations are very good
@BryanCafferky
@BryanCafferky 3 жыл бұрын
You're Welcome!
@Imaginativeone_DF
@Imaginativeone_DF 3 жыл бұрын
Would these efforts be this straightforward using JavaScript?
@BryanCafferky
@BryanCafferky 3 жыл бұрын
Well. It can be done using JavaScript but SQLite is built into Python and Python has a massive set of libraries for data analysis. I think Python is a stronger choice for data-centric work while JavaScript is the better choice for web/mobile apps. But either can be used in both cases.
@izthed9117
@izthed9117 2 жыл бұрын
i get this issue when i try the panda lib Execution failed on sql ' select json_extract(data, '$.id') as id, order by id, limit 5;': near "order": syntax error
@BryanCafferky
@BryanCafferky 2 жыл бұрын
Yep. It's a syntax error. I don't see a FROM clause and don't think the comma after order by id is needed. If that does not solve the issue I would reommend googling Python pnadas SQL jason_extract.
@tiagocostadossantos6379
@tiagocostadossantos6379 2 жыл бұрын
Thanks Bryan!
@SAliGhasempouri
@SAliGhasempouri 2 жыл бұрын
Hi. Thanks for your great content. I use sqlite3 version 3.34 with python 3.8. I get error when using json extract: cursor.execute('''select json_extract(data, '$.name', '$.iso2Code', '$.id') from countries;''').fetchmany(8) OperationalError: no such function: json_extract
@BryanCafferky
@BryanCafferky 2 жыл бұрын
I used sqlite3.sqlite_version 3.37.0 and sqlite3.version 2.6.0. I assume you are running this in the Jupyter Notebook I put in GitHub? If so, looks like a library versioning issue so upgrading the SQLite libraries may fix it.
@SAliGhasempouri
@SAliGhasempouri 2 жыл бұрын
@@BryanCafferky thanks. Yes i used that one. By the way i tried to look for how to upgrade my sqlite but strangely i could not understand
@SAliGhasempouri
@SAliGhasempouri 2 жыл бұрын
@@BryanCafferky I fixed it. i upgraded and it works😎
@BryanCafferky
@BryanCafferky 2 жыл бұрын
@@SAliGhasempouri Awesome!
@CarlosMoreno-vw4ir
@CarlosMoreno-vw4ir 2 жыл бұрын
Awesome video! Thanks so much…
@jiweihe3413
@jiweihe3413 2 жыл бұрын
thank you. How can we json_extract a nested variable?
@jiweihe3413
@jiweihe3413 2 жыл бұрын
realize it can be done by json_extract(data, '$.var1.nested_var2') as var2. I wonder if we store the data in json format, will query be troublesome?
@BryanCafferky
@BryanCafferky 2 жыл бұрын
YW. See this blog. adatis.co.uk/parsing-nested-json-lists-in-databricks-using-python/
@paolorussi8739
@paolorussi8739 3 жыл бұрын
Why I'm getting "OperationalError: no such function: json_extract " without doing anything on the code! Getting mad:)
@BryanCafferky
@BryanCafferky 3 жыл бұрын
Why are you getting mad?
@paolorussi8739
@paolorussi8739 3 жыл бұрын
@@BryanCafferky I found that SQLite package was not updated, so it was not able to call JSON functions. I solved installing the latest version. Thanks a lot! Great video
@BryanCafferky
@BryanCafferky 3 жыл бұрын
@@paolorussi8739 Ok. The word "mad" threw me. I did not intend to anger people. But coding errors can happen from many causes and missing or out-of-date libraries is one. To solve errors, I had to get really good at googling. Calmly dealing with and solving bugs is a rare but essential skill to develop. Everybody hates hitting a bug but that is part of the work.
@OrigamOx
@OrigamOx 3 жыл бұрын
Thank you very much. You solved my problem ! :)
@jiweihe3413
@jiweihe3413 2 жыл бұрын
@@OrigamOx same here! thank you
SQLite for beginners: JSON
6:44
Mycelial
Рет қаралды 8 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 52 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 61 МЛН
SQLite in Python || Python Tutorial || Learn Python Programming
10:11
Upload A CSV File (Or Any Data File) To SQLite Using Python
5:44
Introduction to Scaling Analytics Using DuckDB with Python
29:33
Bryan Cafferky
Рет қаралды 4,4 М.
Parse and Query JSON Data with SQL
8:24
Anthony Smoak
Рет қаралды 6 М.
Make Python code 1000x Faster with Numba
20:33
Jack of Some
Рет қаралды 447 М.
Python's creator wishes this feature never existed
7:21
mCoding
Рет қаралды 327 М.
SQLite Backend for Beginners - Create Quick Databases with Python and SQL
13:32
SQLAlchemy Turns Python Objects Into Database Entries
22:23
NeuralNine
Рет қаралды 185 М.
How to Use SQL with Excel using Python
16:52
SATSifaction
Рет қаралды 123 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 52 МЛН