文章目录
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.
id | name | gender | age | major | class | telphone |
---|---|---|---|---|---|---|
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 (eX
tensible M
arkup L
anguage)
<?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 (J
avaS
cript O
bject N
otation)
-
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.