JSON和SQL之间的区别 [英] Difference between JSON and SQL

查看:679
本文介绍了JSON和SQL之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Web开发的新手,所以这是一个简单的问题.我一直在用Django做一些教程,设置一个SQL数据库,这一切都很好.我现在遇到了我不完全了解的JSON格式. Wikipedia上的定义是:它主要用于在服务器和Web应用程序之间传输数据,以替代XML .这是否意味着JSON是像SQL这样的数据库?如果没有,那么SQL和JSON有什么区别?

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 across the JSON format, which I am not fully understanding. The definition on Wikipedia is: It is used primarily to transmit data between a server and web application, as an alternative to XML. Does this mean that JSON is a database like SQL? If not, what is the difference between SQL and JSON?

谢谢!

推荐答案

JSON是数据标记格式.您可以使用它来定义数据的含义.例如:这辆车是蓝色的,有4个座位.

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是一种数据操作语言.您可以使用它来定义要对数据执行的操作.例如:找到我所有的绿色汽车.将所有红色汽车更改为蓝色汽车.

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'

SQL数据库是使用SQL查询数据库中存储的数据的数据库,格式可能不同.其他类型的数据库也可用.

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.

这篇关于JSON和SQL之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆