Why do we need to use SQL when we have JSON XML and all the others? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why do we need to use SQL when we have JSON XML and all the others?

I know SQL is databases

7th Sep 2018, 6:54 PM
Potato Hacker
Potato Hacker - avatar
4 Answers
+ 13
SQL is a query language -- you "describe" what kind of data (meeting what criteria exactly) you want to extract, update, add or delete to the database. XML and JSON are simply popular formats in which the data are stored and distributed between machines (disregarding databases).
7th Sep 2018, 9:15 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 5
JSON and XML are common formats for exchanging data, these formats is a solution to bridge differences of proprietary formats previously used by common DBMSes, different database engines can exchange data (import/export) thanks to these standards. SQL is a data definition and manipulation language, so its purpose is to define and manipulate data, not for exchanging/transporting data, this IMO is where the difference lies. JSON & XML carries data, but AFAIK neither JSON nor XML can instruct a database engine to do a task. Hth, cmiiw
7th Sep 2018, 9:17 PM
Ipang
+ 2
Thanks To All!!
8th Sep 2018, 3:43 PM
Potato Hacker
Potato Hacker - avatar
+ 1
Because db are optimized for data access (in very large dataset is very noticable), multi-access locking and some other things... in practice db allow you to store data and handle it in more powerful manner while jsob/xml allow you only to store data
7th Sep 2018, 9:12 PM
KrOW
KrOW - avatar