JSON and SQL Tutorial - Convert a table to JSON and JSON to table

JSON and SQL Tutorial - Convert a table to JSON and JSON to table

James Oliver

4 года назад

125,165 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@Ferruccio_Guicciardi
@Ferruccio_Guicciardi - 03.10.2023 22:32

Thanks for sharing the most flexible way to define the JSON tree from the dataset source !

Ответить
@jaxamokoto2783
@jaxamokoto2783 - 07.07.2023 17:59

Exactly what I needed! Thank you!!

Ответить
@codeflu
@codeflu - 23.06.2023 10:52

I have created Web tool to generate tables from complex JSON effortlessly and run SQL queries for powerful data analysis

Ответить
@mehmetkaya4330
@mehmetkaya4330 - 22.06.2023 23:04

Super!!! Thank you so much for this great tutorial

Ответить
@Pollux70
@Pollux70 - 31.05.2023 18:53

STOP saying ok after every sentence you're not a parrot, ok.

Ответить
@karlethapaxton7281
@karlethapaxton7281 - 21.02.2023 05:53

cool

Ответить
@javaguitarist
@javaguitarist - 17.08.2022 01:29

This helped me enormously - thank you!

Ответить
@hasanmougharbel8030
@hasanmougharbel8030 - 21.07.2022 20:55

God bless your great efforts in this channel.
I have a simple question to ask as a newbie sql learner.
Could i manage to channel or extract all sql data generated from an accounting program (based on sql) to our new sql server.
The reason that we are bounded with the graphical interface of this accounting software as we cant
come up with any solutions regarding analytics and automation, unless we can tailor and rearrange this sql database based to our specific needs.
Thanks for helping me.

Ответить
@n.boukari6323
@n.boukari6323 - 07.07.2022 22:50

Thank u kann as solution for the big data manipulation

Ответить
@renz82
@renz82 - 24.06.2022 01:38

How do you do this for oracle database?

Ответить
@hyungtaecf
@hyungtaecf - 27.05.2022 13:08

This json looks bad. It doesn’t actually needs the “customers” and “customer” keys. It could be simplified as just a json array with key-value pairs of id and body.

Ответить
@hiphopheaven
@hiphopheaven - 11.05.2022 16:44

Does it works with postgres?

Ответить
@temidayofolorunsho9334
@temidayofolorunsho9334 - 10.04.2022 17:38

How do I add a fetched JSON api and get value of the returned value ?

Ответить
@cubicle_monkey
@cubicle_monkey - 03.04.2022 03:15

I FINALLY got this working! Thanks for the walk through. If you had to iterate this process through multiple files, what do you think would work best?

Ответить
@theilluminatimember8896
@theilluminatimember8896 - 30.03.2022 09:48

Is is possible to cast values like this from a json column as well? I'm struggling with a Laravel project where I need to order rows by a value stored in a json column. The problem is the default Laravel query builder orders it like a string where as I need it ordered numerically. If it's possible to cast the values into a numeric datatype it would sort properly.

Ответить
@justdrawit3038
@justdrawit3038 - 07.02.2022 11:18

Very clear! 👍

Ответить
@programminglearner4652
@programminglearner4652 - 28.01.2022 18:10

Can we convert JSON (data received from api) to MySQL table for cloning api data

Ответить
@mahsapourshahmari8458
@mahsapourshahmari8458 - 09.12.2021 12:10

I really like the way you say OKAY :) it makes it sound too easy to follow, like you get it? it is that simple :)

Ответить
@gauravdutta5486
@gauravdutta5486 - 21.10.2021 11:06

Hello Sir ., which db is this
Do we have to do the same thing in postgres

Ответить
@raunelperez9421
@raunelperez9421 - 27.08.2021 02:40

I just listen "ok ok ok"

Ответить
@dougfranklin4552
@dougfranklin4552 - 29.07.2021 16:20

Will these functions work with SQLite?

Ответить
@KukuFamily
@KukuFamily - 15.07.2021 18:33

Hi Oliver , we get json as a single row data, is it possible to have separate json row for each record?

Ответить
@tchpowdog
@tchpowdog - 14.07.2021 18:18

I have being using FOR JSON religiously since it's release back in 2016 (I think). I do not use it for "json to table", rather, I use it for "table to json" in normal select queries. I think this feature is, by far, the best SQL feature that no one knows about. Thanks for making this video. Everyone should know about FOR JSON and use it - especially in the modern world of web development. Front-end frameworks like Angular and React are json-based (because they are javascript-based) and going from SQL to front-end was always a nightmare because SQL could never handle nested objects - until now!

I have written some very complex json queries that, in the past, would have been N number of queries to your database, where now it's just one query.

I use procedures to execute my json queries, and because FOR JSON returns a string, you must return that string like this in your procedure:

create procedure MyTestJson
(
-- parameters
)
as
begin
declare @result nvarchar(max)
set @result = (
-- for json select query
)
select @result;
end

If you do not return your result this way, your json string will be truncated.

Also, I highly recommend to not use FOR JSON AUTO. Learn how to implement FOR JSON PATH and only use that. You have a lot more control using PATH and AUTO can give you mixed results that you may not expect.

Ответить
@v300
@v300 - 05.07.2021 00:37

What SQL is this Oracle or DB/2?

Ответить
@andynelson2340
@andynelson2340 - 19.06.2021 22:21

Awesome, thanks!

Ответить
@KimboH55
@KimboH55 - 19.06.2021 04:25

ok ok okay

Ответить
@mohammedameen6583
@mohammedameen6583 - 18.06.2021 21:09

Which ide is this

Ответить
@dexter9459
@dexter9459 - 07.06.2021 13:06

hey chief got the following error with this "Msg 319, Level 15, State 1, Line 27
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon."
with your query directly from your google docs

Ответить
@taricov4662
@taricov4662 - 03.06.2021 15:02

Can anybody explains to me why the Dollar sign $ is used? I am new to SQL

Ответить
@pawelp.1334
@pawelp.1334 - 02.06.2021 01:05

do we always have to paste whole json into the code?

Ответить
@peterkhumalo9837
@peterkhumalo9837 - 31.05.2021 19:58

Why am i getting NULL values..Please help

Ответить
@gameisrigged6942
@gameisrigged6942 - 30.04.2021 21:24

Ok

Ответить
@sonaligund
@sonaligund - 25.04.2021 03:12

could you please guide how to create json from table data in oracle 11g. It would be helpful. Thanks.

Ответить
@barryreeves6916
@barryreeves6916 - 06.03.2021 22:54

Very Helpful. Thanks

Ответить
@monikamalladi5603
@monikamalladi5603 - 10.02.2021 17:24

In JSON to table section using OPENJSON where can we assign the table name ?

Ответить
@sradhawebcreations
@sradhawebcreations - 09.12.2020 11:13

How to send SQL server data to json file

Ответить
@dannyanicamamasgo6482
@dannyanicamamasgo6482 - 27.11.2020 03:34

Thx Jame! one question, how to process when there is character special column "año" json? Like n'$."Dueño Data"

Ответить
@paapaasare
@paapaasare - 19.11.2020 20:06

How would this work on data from a json API url?

Ответить
@pratikpatra8836
@pratikpatra8836 - 06.11.2020 10:48

Hello James, Why you've used N while setting the value in JSON

Ответить
@voltairend
@voltairend - 26.10.2020 08:35

Thanks James

Ответить
@jobsjobs9987
@jobsjobs9987 - 20.10.2020 02:31

Can you do this in SQL SERVER 2014? Using BUILT IN JSON components?

Ответить
@giaptiennbros
@giaptiennbros - 22.08.2020 22:33

Hi James, does it work if I work with Oracle ?

Ответить
@rossocorsa6577
@rossocorsa6577 - 20.07.2020 11:47

Okay?

Ответить
@utkarshverma1832
@utkarshverma1832 - 17.07.2020 16:35

Hi James,
Just on the same Context can we create an JSON output file from the MSSQL with suffix of DATE time<yyyymmddHHMMSS>. Can we do this?
Can we insert the data into a table of SQL so that i can import it?
How can i read a JSON file which has ABCD_XX_12345_<yyyymmddHHMMSS>

Ответить
@MrsHelepolis
@MrsHelepolis - 24.06.2020 23:54

Hello james ,i'm using mongo atlas sample database to train myself. i have an array in json format
"cast": [
"Charles Kayser",
"John Ott"
]
how do i transfer this array to table?

Ответить
@sachin3941
@sachin3941 - 16.06.2020 15:52

How do i convert a whole column having many jsons to a table format?

Ответить
@workstephens3135
@workstephens3135 - 08.06.2020 16:48

Anyway you can provide as downloads the original .txt and .sql files you have entered above? I try to type exactly as you have it but still get errors. Msg 102, Level 15, State 1, Line 1 - Incorrect syntax near '{'.Msg 103, Level 15, State 4, Line 2, The identifier that starts with '

Ответить
@oussamaoussama6364
@oussamaoussama6364 - 11.04.2020 15:07

Pardon my out of context question: can you please upload the back propagation video for the neural networks series? Great explanation by the way.

Ответить
@MrYeduguri
@MrYeduguri - 08.04.2020 16:24

Kindly explain various grid formatting options and document formatting options as well James. Thanks in advance!

Ответить