Difference between JSON and SQL

后端 未结 4 600
小鲜肉
小鲜肉 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: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.

提交回复
热议问题