Difference between JSON and SQL

后端 未结 4 576
小鲜肉
小鲜肉 2021-01-04 13:55

I\'m a newbie at web development, so here\'s a simple question. I\'ve been doing a few tutorials in Django, setting up an SQL database, which is all good. I have now come ac

相关标签:
4条回答
  • 2021-01-04 14:18

    JSON isn't a database, but there isn't anything stopping you from using JSON in a database. Mongo DB is a database that uses JSON (it's actually BSON behind closed doors) to communicate with the database. If you enjoy using JSON and you understand it, I recommend looking into Mongo!

    0 讨论(0)
  • 2021-01-04 14:30

    JSON is data markup format. You use it to define what the data is and means. eg: This car is blue, it has 4 seats.

    {
        "colour": "blue",
        "seats": 4
    }
    

    SQL is a data manipulation language. You use it to define the operations you want to perform on the data. eg: Find me all the green cars. Change all the red cars to blue cars.

    select * from cars where colour = 'green'
    update cars set colour='blue' where colour='red'
    

    A SQL database is a database that uses SQL to query the data stored within, in whatever format that might be. Other types of databases are available.

    0 讨论(0)
  • 2021-01-04 14:38

    They are 2 completely different things.

    SQL is used to communicate with databases, usually to Create, Update and Delete data entries.

    JSON provides a standardized object notation/structure to talk to web services.

    Why standardized?

    Because JSON is relatively easy to process both on the front end (with javascript) and the backend. With no-SQL databases becoming the norm, JSON/JSON-like documents/objects are being used in the database as well.

    0 讨论(0)
  • 2021-01-04 14:38

    Absolutely not. JSON is the data format in order to pass the data from the sender to the receiver. SQL is the language used by relational databases in order to define data structures and query the information from them. JSON is not associated with any way to store or retrieve the data.

    0 讨论(0)
提交回复
热议问题