计算机英语讲课笔记08

本文介绍了数据的重要性,并详细展示了结构化数据(如表格)和半结构化数据(XML、JSON)的示例。结构化数据以表格形式组织,而半结构化数据如XML和JSON提供了更灵活的标记方式,便于数据交换。通过实例,解释了XML和JSON在存储学生记录时的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I. The Sign-in Result

  • Take a look at the screenshot of the sign-in result.
    在这里插入图片描述
  • Let me describe the result. There are forty students in our class. Thirty nine students have signed in. Only one student has not and he did not ask for leave, so he is absent.

II. Data

  • Data is king. 数据为王。

1. Structured Data

  • Create a table named student to store the information of students.
idnamegenderagemajorclasstelphone
202001张三丰19计算机应用20级计应6班13978784560
202002郑晓琳18计算机应用20级计应6班15839787845
202003唐玉文20计算机应用20级计应6班13973454560
202004张小芸18计算机应用20级计应6班13678909456
202005夏雨涵21计算机应用20级计应6班15889897650
  • horizontal: row - tuple - record
  • vertical: column - attribute - field
  • Now there are five records and seven fields in the student table.

2. Semi-Structured Data

(1)XML (eXtensible Markup Language)

<?xml version="1.0" encoding="UTF-8"?>
<students>
	<student>
		<id>202001</id>
		<name>张三丰</name>
		<gender></gender>
		<age>19</age>
		<major>计算机应用</major>
		<class>20级计算机6班</class>
		<telephone>13978784560</telephone>
	</student>
	<student>
		<id>202002</id>
		<name>郑晓琳</name>
		<gender></gender>
		<age>18</age>
		<major>计算机应用</major>
		<class>20级计算机6班</class>
		<telephone>15839787845</telephone>
	</student>
	<student>
		<id>202003</id>
		<name>唐玉文</name>
		<gender></gender>
		<age>20</age>
		<major>计算机应用</major>
		<class>20级计算机6班</class>
		<telephone>13973454560</telephone>
	</student>
	<student>
		<id>202004</id>
		<name>张小芸</name>
		<gender></gender>
		<age>18</age>
		<major>计算机应用</major>
		<class>20级计算机6班</class>
		<telephone>13678909456</telephone>
	</student>
	<student>
		<id>202005</id>
		<name>夏雨涵</name>
		<gender></gender>
		<age>21</age>
		<major>计算机应用</major>
		<class>20级计算机6班</class>
		<telephone>15889897650</telephone>
	</student>
</students>
  • Open students.xml in Notepad++
    在这里插入图片描述
  • Open students.xml file in the Chrome browser
    在这里插入图片描述

(2)JSON (JavaScript Object Notation)

  • Data is king. But knowing how to work with a variety of data has become even more important. Programmers, developers, and IT professionals need to transfer populated data structures from any language to formats that are recognizable by other languages and platforms. JavaScript Object Notation (JSON) is the data-exchange format that makes this possible.

  • JSON has become popular as a data format for developers because of its human-readable text, which is lightweight, requires less coding, and processes

  • Get the citycode of a specified city
    http://toy1.weather.com.cn/search?cityname=泸州
    在这里插入图片描述

  • The citycode of 泸州 is 101271001

  • Use the citycode to query the weather information
    http://t.weather.sojson.com/api/weather/city/101271001
    在这里插入图片描述

  • Use JSON Viewer to view the weather json.
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

  • Now let’s wirte the json for the student records.

[
	{
		"id": "202001",
		"name": "张三丰",
		"gender": "男",
		"age": 19,
		"major": "计算机应用",
		"class": "20级计应6班",
		"telephone": "13978784560"
	},
	{
		"id": "202002",
		"name": "郑晓琳",
		"gender": "女",
		"age": 18,
		"major": "计算机应用",
		"class": "20级计应6班",
		"telephone": "15839787845"
	},
	{
		"id": "202003",
		"name": "唐玉文",
		"gender": "男",
		"age": 20,
		"major": "计算机应用",
		"class": "20级计应6班",
		"telephone": "13973454560"
	},
	{
		"id": "202004",
		"name": "张小芸",
		"gender": "女",
		"age": 18,
		"major": "计算机应用",
		"class": "20级计应6班",
		"telephone": "13678909456"
	},
	{
		"id": "202005",
		"name": "夏雨涵",
		"gender": "女",
		"age": 21,
		"major": "计算机应用",
		"class": "20级计应6班",
		"telephone": "15889897650"
	}	
]
  • Use JSON Viewer to view the student json.
    在这里插入图片描述
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

酒城译痴无心剑

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值