You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

用JSON表示数据库Schema:employee与car表结构转换需求

数据库Schema的JSON表示

没问题,我把你给出的employee和car两张表的结构转换成了清晰易读的JSON格式,你可以直接用这个来表示你的数据库Schema:

{
  "tables": [
    {
      "name": "employee",
      "columns": [
        {"col_name": "eid", "data_type": "int"},
        {"col_name": "name", "data_type": "string"},
        {"col_name": "salary", "data_type": "int"},
        {"col_name": "destination", "data_type": "string"}
      ]
    },
    {
      "name": "car",
      "columns": [
        {"col_name": "cid", "data_type": "int"},
        {"col_name": "name", "data_type": "string"},
        {"col_name": "model", "data_type": "string"},
        {"col_name": "cylinders", "data_type": "int"},
        {"col_name": "price", "data_type": "int"}
      ]
    }
  ]
}

这个结构用tables数组统一管理所有表信息,每个表对象包含表名和对应的列详情,每一列都明确映射了字段名和数据类型,不管是用于文档记录还是程序解析都很方便。

内容的提问来源于stack exchange,提问作者Craig

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:49:20